From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A253C433E0 for ; Sat, 18 Jul 2020 08:02:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4509B20717 for ; Sat, 18 Jul 2020 08:02:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729088AbgGRICa (ORCPT ); Sat, 18 Jul 2020 04:02:30 -0400 Received: from mga07.intel.com ([134.134.136.100]:39396 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728936AbgGRICa (ORCPT ); Sat, 18 Jul 2020 04:02:30 -0400 IronPort-SDR: 1MnRAX8ARDb9P3+/NCdFzIWLLqXFLSR/OJxFptkTcXheOngIE9jriw8wtWj1Hy8KQ0N091tb3o J3mRQ0oc7uPA== X-IronPort-AV: E=McAfee;i="6000,8403,9685"; a="214422212" X-IronPort-AV: E=Sophos;i="5.75,366,1589266800"; d="scan'208";a="214422212" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2020 01:02:29 -0700 IronPort-SDR: MXXqIORaX5UGpnUKXYIV8m/sFA0ZMkXIGFoEOttqIncTMN6NCseomwxr6oe+O7dfUng0ZfSzYA b7qaXNexa7Vw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,366,1589266800"; d="scan'208";a="300787745" Received: from lkp-server02.sh.intel.com (HELO 50058c6ee6fc) ([10.239.97.151]) by orsmga002.jf.intel.com with ESMTP; 18 Jul 2020 01:02:27 -0700 Received: from kbuild by 50058c6ee6fc with local (Exim 4.92) (envelope-from ) id 1jwhnf-0000gg-8J; Sat, 18 Jul 2020 08:02:27 +0000 Date: Sat, 18 Jul 2020 16:01:45 +0800 From: kernel test robot To: sathyanarayanan.kuppuswamy@linux.intel.com, bhelgaas@google.com Cc: kbuild-all@lists.01.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, ashok.raj@intel.com, sathyanarayanan.kuppuswamy@linux.intel.com Subject: [PATCH] ACPI/PCI: fix array_size.cocci warnings Message-ID: <20200718080145.GA55766@adfac4dc55cb> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Patchwork-Hint: ignore User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: kernel test robot drivers/acpi/pci_root.c:150:37-38: WARNING: Use ARRAY_SIZE Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element Semantic patch information: This makes an effort to find cases where ARRAY_SIZE can be used such as where there is a division of sizeof the array by the sizeof its first element or by any indexed element or the element type. It replaces the division of the two sizeofs by ARRAY_SIZE. Generated by: scripts/coccinelle/misc/array_size.cocci CC: Kuppuswamy Sathyanarayanan Signed-off-by: kernel test robot --- url: https://github.com/0day-ci/linux/commits/sathyanarayanan-kuppuswamy-linux-intel-com/Simplify-PCIe-native-ownership-detection-logic/20200718-012614 base: https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next pci_root.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -147,7 +147,7 @@ static struct pci_osc_bit_struct pci_osc static char *get_osc_desc(u32 bit) { - int len = sizeof(pci_osc_control_bit) / sizeof(pci_osc_control_bit[0]); + int len = ARRAY_SIZE(pci_osc_control_bit); int i = 0; for (i = 0; i