+ cciss-use-array_size-without-intermediates.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     CCISS: use ARRAY_SIZE without intermediates

has been added to the -mm tree.  Its filename is

     cciss-use-array_size-without-intermediates.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: CCISS: use ARRAY_SIZE without intermediates
From: Bjorn Helgaas <bjorn.helgaas@xxxxxx>


It's easier to verify loop bounds if the array name is mentioned the for()
statement that steps through the array.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@xxxxxx>
Acked-by: Jeff Garzik <jeff@xxxxxxxxxx>
Acked-by: Mike Miller <mike.miller@xxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/block/cciss.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff -puN drivers/block/cciss.c~cciss-use-array_size-without-intermediates drivers/block/cciss.c
--- 25/drivers/block/cciss.c~cciss-use-array_size-without-intermediates	Mon Jun 19 16:46:06 2006
+++ 25-akpm/drivers/block/cciss.c	Mon Jun 19 16:46:06 2006
@@ -104,8 +104,6 @@ static const struct pci_device_id cciss_
 };
 MODULE_DEVICE_TABLE(pci, cciss_pci_device_id);
 
-#define NR_PRODUCTS ARRAY_SIZE(products)
-
 /*  board_id = Subsystem Device ID & Vendor ID
  *  product = Marketing Name for the board
  *  access = Address of the struct of function pointers 
@@ -2831,14 +2829,14 @@ static int cciss_pci_init(ctlr_info_t *c
 	print_cfg_table(c->cfgtable);
 #endif /* CCISS_DEBUG */
 
-	for(i=0; i<NR_PRODUCTS; i++) {
+	for(i=0; i<ARRAY_SIZE(products); i++) {
 		if (board_id == products[i].board_id) {
 			c->product_name = products[i].product_name;
 			c->access = *(products[i].access);
 			break;
 		}
 	}
-	if (i == NR_PRODUCTS) {
+	if (i == ARRAY_SIZE(products)) {
 		printk(KERN_WARNING "cciss: Sorry, I don't know how"
 			" to access the Smart Array controller %08lx\n", 
 				(unsigned long)board_id);
_

Patches currently in -mm which might be from bjorn.helgaas@xxxxxx are

git-acpi.patch
acpi-update-asus_acpi-driver-registration-fix.patch
pnpacpi-reject-acpi_producer-resources.patch
2.6-sony_acpi4.patch
git-ia64.patch
git-klibc.patch
e100-disable-interrupts-at-boot.patch
vgacon-make-vga_map_mem-take-size-remove-extra-use.patch
cciss-disable-device-when-returning-failure.patch
cciss-request-all-pci-resources.patch
cciss-announce-cciss%d-devices-with-pci-address-irq-dac-info.patch
cciss-use-array_size-without-intermediates.patch
cciss-fix-a-few-spelling-errors.patch
cciss-remove-parens-around-return-values.patch
cciss-run-through-lindent.patch
cciss-tidy-up-product-table-indentation.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux