lkml.org 
[lkml]   [2018]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ipmi: use ARRAY_SIZE for poweroff_functions array sizing calculation
Date
From: Colin Ian King <colin.king@canonical.com>

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>
---
drivers/char/ipmi/ipmi_poweroff.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/char/ipmi/ipmi_poweroff.c b/drivers/char/ipmi/ipmi_poweroff.c
index 07fa366bc8f0..fccb1e9fd3b7 100644
--- a/drivers/char/ipmi/ipmi_poweroff.c
+++ b/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. */
--
2.15.1
\
 
 \ /
  Last update: 2018-03-02 15:15    [W:0.050 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site