From patchwork Tue Nov 22 21:56:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 24601 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2460876wrr; Tue, 22 Nov 2022 14:06:38 -0800 (PST) X-Google-Smtp-Source: AA0mqf6DfeOvW7n7OsXIoiZOBgKg5U6E41y7j5GU1Qymk6jsXbCK8DiwLAfGUNevOyBdwr8mFVor X-Received: by 2002:a62:1cd4:0:b0:56b:deea:72e9 with SMTP id c203-20020a621cd4000000b0056bdeea72e9mr27151532pfc.47.1669154798122; Tue, 22 Nov 2022 14:06:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669154798; cv=none; d=google.com; s=arc-20160816; b=m3obP/JYj4dE+ProNd23OPg3YREDYaur7p7wh7QCLD1Y9pmIpax8gcUiO18zvQPEAX mSIpGCOLRXzeoIafwePxypJuAPqYEuh5BG6f2PsoD7tHoSSSNsOYeUQcOUxSAKs1hQ+9 etoxBmYi/oIF4H9LvoSPvcMRZ4t+bwl60rc6WBuFYQtwvlkWqjFpr4kq/fq1fCNj/0Hi bA8xlrZotjyKNfm/8l43wyXhzPiF76auis0y5vPgnIOBp9XzGuf4OwuSEUZpvBPIc4Cs CfGvV762No+vLFacA04PzlLMHb746wFgsmYjy9aV0piMUlZ02XifD1AYMKfmIPpo7gk0 d7yQ== 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=824SFzJcvTB2JbHC1JCtx94TdATQoRAOhQZkIVf2p1A=; b=lb24z2O+7CYLzwsiiy04NXEJ5KFL+Uro+XhZNyHjEPix/vgILD5z2c5qEHrK4d3lMo RRD3oyOzMUxAbMvsSZXUvGHs3QPbQiOmVcMgeDNHuaSe7co13Q6nBF0JO86gzKUhXCBA H0Ro21n15+ijPGgEl0+TnQqsHy8pguUfuSrB5hqyDv3OIFPnDDzwum7Yekvtq4in9eFk KfZc2Cf+Yq07Xo3vH6IaVQBZOYKY4qQ3HHYzxl6Ph2IFib4X9oIn+ltEB+CCCxIYBBDU V3wUxj40ztLO/YoA5UnWd5kQEGeF4lLvbgc6gKpmBaACyver0ceDDNL1F301Svs/4Xsi ZTXw== 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 j191-20020a6380c8000000b004774a855375si10195723pgd.351.2022.11.22.14.06.24; Tue, 22 Nov 2022 14:06:38 -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 S234767AbiKVV4a (ORCPT + 99 others); Tue, 22 Nov 2022 16:56:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231174AbiKVV42 (ORCPT ); Tue, 22 Nov 2022 16:56:28 -0500 Received: from smtp.smtpout.orange.fr (smtp-19.smtpout.orange.fr [80.12.242.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 270E2C6BC3 for ; Tue, 22 Nov 2022 13:56:28 -0800 (PST) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id xbFdoaYQDOAzAxbFdon0TP; Tue, 22 Nov 2022 22:56:26 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 22 Nov 2022 22:56:26 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Corentin Labbe , Herbert Xu , "David S. Miller" Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-crypto@vger.kernel.org, linux-amlogic@lists.infradead.org Subject: [PATCH] crypto: amlogic - Save a few bytes of memory Date: Tue, 22 Nov 2022 22:56:19 +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_H2,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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?1750235661606378532?= X-GMAIL-MSGID: =?utf-8?q?1750235661606378532?= There is no real point in allocating dedicated memory for the irqs array. MAXFLOW is only 2, so it is easier to allocated the needed space directly within the 'meson_dev' structure. This saves some memory allocation and avoids an indirection when using the irqs array. Signed-off-by: Christophe JAILLET --- drivers/crypto/amlogic/amlogic-gxl-core.c | 1 - drivers/crypto/amlogic/amlogic-gxl.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/crypto/amlogic/amlogic-gxl-core.c b/drivers/crypto/amlogic/amlogic-gxl-core.c index 6e7ae896717c..937187027ad5 100644 --- a/drivers/crypto/amlogic/amlogic-gxl-core.c +++ b/drivers/crypto/amlogic/amlogic-gxl-core.c @@ -237,7 +237,6 @@ static int meson_crypto_probe(struct platform_device *pdev) return err; } - mc->irqs = devm_kcalloc(mc->dev, MAXFLOW, sizeof(int), GFP_KERNEL); for (i = 0; i < MAXFLOW; i++) { mc->irqs[i] = platform_get_irq(pdev, i); if (mc->irqs[i] < 0) diff --git a/drivers/crypto/amlogic/amlogic-gxl.h b/drivers/crypto/amlogic/amlogic-gxl.h index dc0f142324a3..8c0746a1d6d4 100644 --- a/drivers/crypto/amlogic/amlogic-gxl.h +++ b/drivers/crypto/amlogic/amlogic-gxl.h @@ -95,7 +95,7 @@ struct meson_dev { struct device *dev; struct meson_flow *chanlist; atomic_t flow; - int *irqs; + int irqs[MAXFLOW]; #ifdef CONFIG_CRYPTO_DEV_AMLOGIC_GXL_DEBUG struct dentry *dbgfs_dir; #endif