aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/core/device.c')
-rw-r--r--drivers/infiniband/core/device.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index 63d2a39fb82c..7fabb425b033 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -36,6 +36,7 @@
36#include <linux/module.h> 36#include <linux/module.h>
37#include <linux/string.h> 37#include <linux/string.h>
38#include <linux/errno.h> 38#include <linux/errno.h>
39#include <linux/kernel.h>
39#include <linux/slab.h> 40#include <linux/slab.h>
40#include <linux/init.h> 41#include <linux/init.h>
41#include <linux/mutex.h> 42#include <linux/mutex.h>
@@ -93,7 +94,7 @@ static int ib_device_check_mandatory(struct ib_device *device)
93 }; 94 };
94 int i; 95 int i;
95 96
96 for (i = 0; i < sizeof mandatory_table / sizeof mandatory_table[0]; ++i) { 97 for (i = 0; i < ARRAY_SIZE(mandatory_table); ++i) {
97 if (!*(void **) ((void *) device + mandatory_table[i].offset)) { 98 if (!*(void **) ((void *) device + mandatory_table[i].offset)) {
98 printk(KERN_WARNING "Device %s is missing mandatory function %s\n", 99 printk(KERN_WARNING "Device %s is missing mandatory function %s\n",
99 device->name, mandatory_table[i].name); 100 device->name, mandatory_table[i].name);