From patchwork Mon Mar 7 23:09:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 1602613 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=MtNSdphh; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=dfbKY+mn; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KCDhV5zvFz9sGT for ; Tue, 8 Mar 2022 10:10:34 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=dFzOUF6a/TFXka80nZbTTO2QegRQlZhrX/6/5mOseSU=; b=MtNSdphh3L7rca JAL9xRSzMpOZIB0yUv4Es/LCljrtMwij+M3Go/fH2KsX1evcSGM7a+xadcWMtx0gKJ2YKWSnGq26C KIozuYGz5itxkMxWzin4Kqf7XCMguvCsB3JhHrgAutM8L9eBaFpNw3SgbPFHUKNZ8dzrwObuwWUMb Ff0ygGoVz9SWUOq/ZOXnU9QUAGzOIma36sv9wApc2BPVMN1T3d3EdUxH+Xp74a3Jc7JMq/eJgG+8R soupgPInFBkR19vycK01VXfOk5R6djCAEYSQuNLGHTsXSQQ4alWUqHi+XYnNYDlv9rMlo6AQWjm08 o8X/utJvaOGhXqKqtgKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRMU5-001uRW-PN; Mon, 07 Mar 2022 23:09:45 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRMU2-001uPo-Mr for linux-mtd@lists.infradead.org; Mon, 07 Mar 2022 23:09:44 +0000 Received: by mail-wm1-x330.google.com with SMTP id m42-20020a05600c3b2a00b00382ab337e14so352630wms.3 for ; Mon, 07 Mar 2022 15:09:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Irknw6RQZUFdI9aXxc+3L26hKyaP/zkHhWNuLVXeO0o=; b=dfbKY+mnDGP4mJ8Za885HhOBk9DHTkBTNOFC/iNhyD8vE9thA6b2Mw/2+K5Pw5Bn4i qyaFa02sE9zEqane//Kv7zLPm3r5D50IUnPtc9BaBPKTT8nn1a5wlJaAuljWmZHGBBlR 4wIPjzPRcKY3USfEdPZbtbkeFjmHmY13aSLPP8xOOl72d2XaWk4D+YU7co/9214pyqBg VYZ/XwyKJlGuPrYpyaGFXuJQ0rKd/SXI9ILBjHZUQfKCsqLCGBms/OHKOPH+jWuHSMgb WmwQWkIhwO2/NzY5fRpucmVGOdZV+2cndyJVfVJAZqNOn52a0lT6sDvzEhNOT7C59s6G /VQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Irknw6RQZUFdI9aXxc+3L26hKyaP/zkHhWNuLVXeO0o=; b=if5LGTyvvCCe4AcSA9LSVWXkAYVoiTn592NcJmx2bHVvI/6s/djRaE7TEpwtYplCL6 2yiZextTa1HlPJMOKtCsZC0NsAD558Zf3NqXP9I5ZBDErHypTT1vIIphodp3jU0D5+ZL cqNzvBWUKNIOE0OvGVR3kOPqH7RZalbZgeDbS80raxZN9ld2zmDFkC7h89A3sr4g7/LQ 6VeGSs6eKEMPThLoGXh3Vps8eQGdTotwSTm73hVpk50be1MjC7yN0OjuwZhFw3BJw5jO LYup0ecjLPuveo6fTEa8udavlLC1cyah0wQjb3FCftb7k+JuTr22thpujzY20BXEx7Na Glyg== X-Gm-Message-State: AOAM531tJlUq7wjps7SFlB50APsv1HT49MGTgwqfn9nr4m+/1WkTOvrR WkmYa+y3tKspDUOer3lbHLo= X-Google-Smtp-Source: ABdhPJyUVoSvxkCc+Dedh2m8q/S7kd59ABqP8cYxYRUUL2GD9oC3GwI2gz1/0P2Mqn1+Cwj2/nC1+Q== X-Received: by 2002:a1c:35c9:0:b0:37b:edec:4d88 with SMTP id c192-20020a1c35c9000000b0037bedec4d88mr1015533wma.159.1646694581283; Mon, 07 Mar 2022 15:09:41 -0800 (PST) Received: from localhost (cpc154979-craw9-2-0-cust193.16-3.cable.virginm.net. [80.193.200.194]) by smtp.gmail.com with ESMTPSA id a14-20020a05600c348e00b00389ab74c033sm566569wmq.4.2022.03.07.15.09.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 15:09:40 -0800 (PST) From: Colin Ian King To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] mtd: nand: mxic-ecc: make two read-only arrays static const Date: Mon, 7 Mar 2022 23:09:40 +0000 Message-Id: <20220307230940.169235-1-colin.i.king@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220307_150942_798239_FDEB2A44 X-CRM114-Status: GOOD ( 11.50 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Don't populate the read-only arrays possible_strength and spare_size on the stack but instead make them static const. Also makes the object code a little smaller. Signed-off-by: Colin Ian King --- drivers/mtd/nand/ecc-mxic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:330 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [colin.i.king[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Don't populate the read-only arrays possible_strength and spare_size on the stack but instead make them static const. Also makes the object code a little smaller. Signed-off-by: Colin Ian King --- drivers/mtd/nand/ecc-mxic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/ecc-mxic.c b/drivers/mtd/nand/ecc-mxic.c index c122139255e5..8afdca731b87 100644 --- a/drivers/mtd/nand/ecc-mxic.c +++ b/drivers/mtd/nand/ecc-mxic.c @@ -224,8 +224,8 @@ static int mxic_ecc_init_ctx(struct nand_device *nand, struct device *dev) struct nand_ecc_props *user = &nand->ecc.user_conf; struct mtd_info *mtd = nanddev_to_mtd(nand); int step_size = 0, strength = 0, desired_correction = 0, steps, idx; - int possible_strength[] = {4, 8, 40, 48}; - int spare_size[] = {32, 32, 96, 96}; + static const int possible_strength[] = {4, 8, 40, 48}; + static const int spare_size[] = {32, 32, 96, 96}; struct mxic_ecc_ctx *ctx; u32 spare_reg; int ret;