[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <deab9696fc4000499470e7ccbca7c36fca17bd4e.1668458274.git.christophe.jaillet@wanadoo.fr>
Date: Mon, 14 Nov 2022 21:38:04 +0100
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Linus Walleij <linus.walleij@...aro.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
linux-usb@...r.kernel.org
Subject: [PATCH] usb: fotg210-udc: Remove a useless assignment
There is no need to use an intermediate array for these memory allocations,
so, axe it.
While at it, turn a '== NULL' into a shorter '!' when testing memory
allocation failure.
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
drivers/usb/fotg210/fotg210-udc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/fotg210/fotg210-udc.c b/drivers/usb/fotg210/fotg210-udc.c
index 3c357ce42d3b..52b1d69843dd 100644
--- a/drivers/usb/fotg210/fotg210-udc.c
+++ b/drivers/usb/fotg210/fotg210-udc.c
@@ -1090,7 +1090,6 @@ int fotg210_udc_probe(struct platform_device *pdev)
{
struct resource *res, *ires;
struct fotg210_udc *fotg210 = NULL;
- struct fotg210_ep *_ep[FOTG210_MAX_NUM_EP];
int ret = 0;
int i;
@@ -1114,10 +1113,9 @@ int fotg210_udc_probe(struct platform_device *pdev)
goto err;
for (i = 0; i < FOTG210_MAX_NUM_EP; i++) {
- _ep[i] = kzalloc(sizeof(struct fotg210_ep), GFP_KERNEL);
- if (_ep[i] == NULL)
+ fotg210->ep[i] = kzalloc(sizeof(struct fotg210_ep), GFP_KERNEL);
+ if (!fotg210->ep[i])
goto err_alloc;
- fotg210->ep[i] = _ep[i];
}
fotg210->reg = ioremap(res->start, resource_size(res));
--
2.34.1
Powered by blists - more mailing lists