Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp836006rwl; Thu, 10 Aug 2023 02:17:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFEyqVnxRzQEO3wn1wfWvQ0deSyxEF3mSaSa5CAj0TT0VbgntSO7tPoVjEES5+GdCtphiLN X-Received: by 2002:a05:6a20:948c:b0:140:3aa:e2ce with SMTP id hs12-20020a056a20948c00b0014003aae2cemr1655775pzb.42.1691659077864; Thu, 10 Aug 2023 02:17:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691659077; cv=none; d=google.com; s=arc-20160816; b=qfd97iCbMEyNt7VMSIkAmiQ2J1wDZ34Olt0vlkwToAdKbJQQGx3mCaQ53N4u+AFmTE qZEmhM5zFt33wYxgwfNHmafCU0qMAMZisHL2UfEpF9sgdazCWSdGuZ3NJFsSw12OYpYW fO62jozTrZC6aHxiJBWgMuoWd4x8upA7v7YyZM8gHP2sLCZ4XZsN4dSa45F9ogeerFXQ UKO5OiEU1Q/3roecFJQ3+CwWmG4JtVT7plUp+CRYwiIKh6XoftfI4NA7bs9aSOkWCGnN 0SBO6mX/fqssoF4IrXbrm8B2Ehs1sgyv8b0oW4SL5/2jKnas5yDkQwTitjh2vAayGfWj tIUA== 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:dkim-signature; bh=6gTz6hcoAzVZcSGAehaR348Fo/uyOm0OL4hmIYIrZZA=; fh=C3ard5l2Ooqf2n5p/OWZ08MV4Igrh/tDmgZhBL9S77k=; b=UqzeEZ9wWcIjThG78gdxJ9QRIU0VlRN6WgyIeGkNPAMgg2Bs0vG4N8w5IBlS57h6RG HYnIutcbpQhDnwt3j956vsH3ZGTERYEzNbVS1fVEfOpSg+1tf4STGv6WbRwnNv+ooO3H ua778APVDTZfric4citZ7CcxbGOKwyHT3H+tAPrSUrUtzELqdDLaPgcbiwplvW+BiUTQ zOtvqfru/BcWpr4Ql7b5PAmnb8UCJi4b7jpi5yoDoDmPLeWy6fvXbI16I9I2VYo2/4DW WUCVFZmhGG/KjkEeVkh+EGgvBOH3EYnd0aBEeG23zSWLRR5ju9IelMfUb9+xH6cjVS+7 UaHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=h+7tOucT; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j4-20020a170903028400b001bbc138af0dsi1098474plr.163.2023.08.10.02.17.45; Thu, 10 Aug 2023 02:17:57 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20221208 header.b=h+7tOucT; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232819AbjHJHql (ORCPT + 99 others); Thu, 10 Aug 2023 03:46:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232651AbjHJHqj (ORCPT ); Thu, 10 Aug 2023 03:46:39 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F8EC1702; Thu, 10 Aug 2023 00:46:39 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1bc65360648so5969705ad.1; Thu, 10 Aug 2023 00:46:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691653599; x=1692258399; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=6gTz6hcoAzVZcSGAehaR348Fo/uyOm0OL4hmIYIrZZA=; b=h+7tOucTOdOz8TQvOUT0sabcTzCnlSOWbL7VcjubyhRJs+QRtvKFAzzRM9L9nIdS1P nNqSVk11YEy+loiPRdPtrDsxc70BDIN/FdnI/Gv++3cDOqT+dy2jNySYJHJSn74O76VA 8O++XVsIB+8Am+HaqWRxb46ZiM3DX4Xdt92RorosZGzSSzsjbQqETzrV/kziY0D9qqGY Kyi9t12RhX+pLWrsHLReJJRmDedo44LaAn/d07J61w5mgYvc9qqfkOPirZXn1pDuGzJa tcqt0dAzZofras8bhHuFKI6PVblJz64hhuhZUeBblGaP4bd8MYWSPLmkBaLMlnLp96NR yVPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691653599; x=1692258399; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6gTz6hcoAzVZcSGAehaR348Fo/uyOm0OL4hmIYIrZZA=; b=N6DQaY3NnLOpWuW35W/Jgi+jpGGfAHQoiw1Nsu0GPFZVh0xME/Hkwotu1mdthHPvLa SlIf2yn+ZoLakIHMBEG52wZ3CJlzLUyR52AkXxk8R+miiZDKG9r7+v6g9uWR1pFoEta4 1ntRCjsS4kTSt5aUyso/lLnzc+NR44Wa5YFQFTEOP7XhN7ccJ7UDv2P+XlM0qfY8qIlM ZJW7wEryjrx0kOjGM2sjoucN+hhwEA/+YlccIeEnflzcgCu3UGJsGgR8IO0VbeNIxkn6 ysdMXsFw2oDFhi8fXkM4pOkxg3Gr/dGBBgc8EqP2Kf035TDcI5kY4EptDTnMOrNsRFv0 UIwg== X-Gm-Message-State: AOJu0Yz5TXMkxWgdC6ZspCt00zFCcoXnn+gVcFOSAz8Y8FpWo3zkm4Sb 6NtEZ7BFKRQvevctoiUMdDI= X-Received: by 2002:a17:902:ba86:b0:1b9:ebe9:5f01 with SMTP id k6-20020a170902ba8600b001b9ebe95f01mr1637726pls.19.1691653598860; Thu, 10 Aug 2023 00:46:38 -0700 (PDT) Received: from localhost.localdomain ([2409:40c2:103c:968b:4dc8:d063:71b0:bea]) by smtp.gmail.com with ESMTPSA id a15-20020a170902710f00b001bd99fd1114sm948570pll.288.2023.08.10.00.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 00:46:38 -0700 (PDT) From: coolrrsh@gmail.com To: linus.walleij@linaro.org, brgl@bgdev.pl, andy@kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-kernel-mentees@lists.linuxfoundation.org, Rajeshwar R Shinde Subject: [PATCH v2] gpio: gpio-imx-scu: Use ARRAY_SIZE for array length Date: Thu, 10 Aug 2023 13:16:33 +0530 Message-Id: <20230810074633.13111-1-coolrrsh@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,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 From: Rajeshwar R Shinde Use of macro ARRAY_SIZE to calculate array size minimizes the redundant code and improves code reusability. This fixes warnings reported by Coccinelle: drivers/gpio/gpio-imx-scu.c:106:32-33: WARNING: Use ARRAY_SIZE Signed-off-by: Rajeshwar R Shinde --- v1->v2 ARRAY_SIZE calculates array length, so changed gc->ngpio = ARRAY_SIZE(scu_rsrc_arr)/sizeof(unsigned int) to gc->ngpio = ARRAY_SIZE(scu_rsrc_arr) --- drivers/gpio/gpio-imx-scu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-imx-scu.c b/drivers/gpio/gpio-imx-scu.c index e190bde5397d..fb05a53c9712 100644 --- a/drivers/gpio/gpio-imx-scu.c +++ b/drivers/gpio/gpio-imx-scu.c @@ -103,7 +103,7 @@ static int imx_scu_gpio_probe(struct platform_device *pdev) gc = &priv->chip; gc->base = -1; gc->parent = dev; - gc->ngpio = sizeof(scu_rsrc_arr)/sizeof(unsigned int); + gc->ngpio = ARRAY_SIZE(scu_rsrc_arr); gc->label = dev_name(dev); gc->get = imx_scu_gpio_get; gc->set = imx_scu_gpio_set; -- 2.25.1