Commit 9a6b090c authored by Ahmed S. Darwish's avatar Ahmed S. Darwish Committed by Roland Dreier

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: default avatarAhmed S. Darwish <darwish.07@gmail.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 99d4f22e
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment