lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200718080145.GA55766@adfac4dc55cb>
Date:   Sat, 18 Jul 2020 16:01:45 +0800
From:   kernel test robot <lkp@...el.com>
To:     sathyanarayanan.kuppuswamy@...ux.intel.com, bhelgaas@...gle.com
Cc:     kbuild-all@...ts.01.org, linux-pci@...r.kernel.org,
        linux-kernel@...r.kernel.org, ashok.raj@...el.com,
        sathyanarayanan.kuppuswamy@...ux.intel.com
Subject: [PATCH] ACPI/PCI: fix array_size.cocci warnings

From: kernel test robot <lkp@...el.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@...ux.intel.com>
Signed-off-by: kernel test robot <lkp@...el.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++)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ