Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9a6b090c0d1cd5c90f21db772dbe2fbcf14366de
Commit:     9a6b090c0d1cd5c90f21db772dbe2fbcf14366de
Parent:     99d4f22e91d26e0f8b113bf7fde65a335d36ad6b
Author:     Ahmed S. Darwish <[EMAIL PROTECTED]>
AuthorDate: Tue Feb 6 18:07:25 2007 +0200
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Sat Feb 10 08:00:47 2007 -0800

    IB/core: Use ARRAY_SIZE macro for mandatory_table
    
    Use ARRAY_SIZE() macro already defined in kernel.h instead of open
    coding equivalent code.
    
    Signed-off-by: Ahmed S. Darwish <[EMAIL PROTECTED]>
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/core/device.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index 63d2a39..7fabb42 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -36,6 +36,7 @@
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/errno.h>
+#include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/mutex.h>
@@ -93,7 +94,7 @@ static int ib_device_check_mandatory(struct ib_device *device)
        };
        int i;
 
-       for (i = 0; i < sizeof mandatory_table / sizeof mandatory_table[0]; 
++i) {
+       for (i = 0; i < ARRAY_SIZE(mandatory_table); ++i) {
                if (!*(void **) ((void *) device + mandatory_table[i].offset)) {
                        printk(KERN_WARNING "Device %s is missing mandatory 
function %s\n",
                               device->name, mandatory_table[i].name);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to