public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
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
Date: Sat, 18 Jul 2020 16:01:45 +0800	[thread overview]
Message-ID: <20200718080145.GA55766@adfac4dc55cb> (raw)
In-Reply-To: <a5da506cb5cd5d590d88da8537ad01c0167840da.1595006564.git.sathyanarayanan.kuppuswamy@linux.intel.com>

From: kernel test robot <lkp@intel.com>

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 <sathyanarayanan.kuppuswamy@linux.intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

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 <len; i++)

  parent reply	other threads:[~2020-07-18  8:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17 17:23 [PATCH v7 0/5] Simplify PCIe native ownership detection logic sathyanarayanan.kuppuswamy
2020-07-17 17:23 ` [PATCH v7 1/5] PCI: Conditionally initialize host bridge native_* members sathyanarayanan.kuppuswamy
2020-07-17 17:23 ` [PATCH v7 2/5] ACPI/PCI: Ignore _OSC negotiation result if pcie_ports_native is set sathyanarayanan.kuppuswamy
2020-07-18  8:01   ` kernel test robot
2020-07-18  8:01   ` kernel test robot [this message]
2020-07-18 14:27     ` [PATCH] ACPI/PCI: fix array_size.cocci warnings Joe Perches
2020-07-17 17:23 ` [PATCH v7 3/5] ACPI/PCI: Ignore _OSC DPC negotiation result if pcie_ports_dpc_native is set sathyanarayanan.kuppuswamy
2020-07-17 17:23 ` [PATCH v7 4/5] PCI/portdrv: Remove redundant pci_aer_available() check in DPC enable logic sathyanarayanan.kuppuswamy
2020-07-17 17:23 ` [PATCH v7 5/5] PCI/DPC: Move AER/DPC dependency checks out of DPC driver sathyanarayanan.kuppuswamy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200718080145.GA55766@adfac4dc55cb \
    --to=lkp@intel.com \
    --cc=ashok.raj@intel.com \
    --cc=bhelgaas@google.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox