From nobody Mon Apr 13 15:46:29 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A605C43219 for ; Mon, 14 Nov 2022 20:38:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236601AbiKNUiO (ORCPT ); Mon, 14 Nov 2022 15:38:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233300AbiKNUiK (ORCPT ); Mon, 14 Nov 2022 15:38:10 -0500 Received: from smtp.smtpout.orange.fr (smtp-18.smtpout.orange.fr [80.12.242.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59D3C101D5 for ; Mon, 14 Nov 2022 12:38:08 -0800 (PST) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id ugDVoF0uQzQOKugDVozxfW; Mon, 14 Nov 2022 21:38:06 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 14 Nov 2022 21:38:06 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Linus Walleij , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-usb@vger.kernel.org Subject: [PATCH] usb: fotg210-udc: Remove a useless assignment Date: Mon, 14 Nov 2022 21:38:04 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" There is no need to use an intermediate array for these memory allocations, so, axe it. While at it, turn a '=3D=3D NULL' into a shorter '!' when testing memory allocation failure. Signed-off-by: Christophe JAILLET Reviewed-by: Linus Walleij --- 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/fotg21= 0-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 =3D NULL; - struct fotg210_ep *_ep[FOTG210_MAX_NUM_EP]; int ret =3D 0; int i; =20 @@ -1114,10 +1113,9 @@ int fotg210_udc_probe(struct platform_device *pdev) goto err; =20 for (i =3D 0; i < FOTG210_MAX_NUM_EP; i++) { - _ep[i] =3D kzalloc(sizeof(struct fotg210_ep), GFP_KERNEL); - if (_ep[i] =3D=3D NULL) + fotg210->ep[i] =3D kzalloc(sizeof(struct fotg210_ep), GFP_KERNEL); + if (!fotg210->ep[i]) goto err_alloc; - fotg210->ep[i] =3D _ep[i]; } =20 fotg210->reg =3D ioremap(res->start, resource_size(res)); --=20 2.34.1