Browse Source

ipmi: use ARRAY_SIZE for poweroff_functions array sizing calculation

Use the ARRAY_SIZE macro on a array poweroff_functions to determine
size of the array. Improvement suggested by Coccinelle.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Colin Ian King 7 years ago
parent
commit
e8824babad
1 changed files with 1 additions and 2 deletions
  1. 1 2
      drivers/char/ipmi/ipmi_poweroff.c

+ 1 - 2
drivers/char/ipmi/ipmi_poweroff.c

@@ -519,8 +519,7 @@ static struct poweroff_function poweroff_functions[] = {
 	  .detect		= ipmi_chassis_detect,
 	  .poweroff_func	= ipmi_poweroff_chassis },
 };
-#define NUM_PO_FUNCS (sizeof(poweroff_functions) \
-		      / sizeof(struct poweroff_function))
+#define NUM_PO_FUNCS ARRAY_SIZE(poweroff_functions)
 
 
 /* Called on a powerdown request. */