From patchwork Mon Nov 14 20:38:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 20028 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2353727wru; Mon, 14 Nov 2022 12:39:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf7go5EFLaTyfHs52fHnypkLR4h5C9p9Gnpehli25YXsZ982TYx381wxj4e2XdIYRz9m4O7g X-Received: by 2002:a17:906:7c5:b0:78d:9f46:5b6 with SMTP id m5-20020a17090607c500b0078d9f4605b6mr11407063ejc.158.1668458375898; Mon, 14 Nov 2022 12:39:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668458375; cv=none; d=google.com; s=arc-20160816; b=Q/HhyVRT8YkWlWpK3WZMwoyYhWz8aFhqpNqXdvAvudxCgakV8O9fkjennq9b4JFqvO phsTWr7YfJh1KeYMZ+BUucWtYnC654lDYgvlBx7FrzkmSVvtF2t8qmNQYrs9zUYjw6NP 1bZET4TnWkZA0rGJ7BHckJx4Zt5htSjxzrQ/l3TSWCCNbIAQd868hoiGwmEBBV0K6OeE nRmmdmZggdw1KKl3UOmEfV2JPns4ShnCEbGjq0H6hJKrkvLfOfMMFeSWwnPI5WQTnSeh 540cnyr2s+2t/YtNuAPaEDdbUWC4rAMjIl3i8Jj+nkQh8S18d9zEwX+gPFDkudF5TgxO 7bPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=XKZf7YRkYKbTy9m1tkf+GKoezBRNP3aZ5NGKSFb59Cg=; b=IjGGGqpbLNTlA3eWoWpZ/YBqJVSlh6PZF8Fmp5mIC/VzTBC3NJAcK1I96i8JcMuX7u VqCoOldT6rKNBsk3yCiO49fDNVydLy/bcJBCXh3PGihsqnxZW0aS/tWsScywwITIjnyh MGaf7AVZnMcsUmGuWGuG6EZUV5VALXeYnuHvw0SOnWAdSLgDhsMxf+MAuWqZIwI88gTg JNxfFSOP8rxO+pShTrO0Dfpx6EGkRtGG2kC0n/Fhf/0UQFLwC+tgwCTV2UX3dcuY+Cht u2ea9GQ1WNFImkKzb+vVQBShBNmCJrYRf6xERzlSAbfYDU4Hx7hetPVoNqY58rcWM/+H 4VYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gu7-20020a170906f28700b007adb3888afbsi7390933ejb.136.2022.11.14.12.39.12; Mon, 14 Nov 2022 12:39:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235592AbiKNUiN (ORCPT + 99 others); Mon, 14 Nov 2022 15:38:13 -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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749505409866717782?= X-GMAIL-MSGID: =?utf-8?q?1749505409866717782?= 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 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/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));