diff options
author | Colin Ian King <colin.king@canonical.com> | 2018-03-02 09:14:51 -0500 |
---|---|---|
committer | Corey Minyard <cminyard@mvista.com> | 2018-03-06 20:47:51 -0500 |
commit | e8824babad2d81fcff43e02f028cc437a3f99ce5 (patch) | |
tree | 72433b1429cc9a86cdcb2b82a43558ab13461daf | |
parent | 71404a2f75c1456d82eda47c3a9699770dc766c9 (diff) |
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>
-rw-r--r-- | drivers/char/ipmi/ipmi_poweroff.c | 3 |
1 files changed, 1 insertions, 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[] = { | |||
519 | .detect = ipmi_chassis_detect, | 519 | .detect = ipmi_chassis_detect, |
520 | .poweroff_func = ipmi_poweroff_chassis }, | 520 | .poweroff_func = ipmi_poweroff_chassis }, |
521 | }; | 521 | }; |
522 | #define NUM_PO_FUNCS (sizeof(poweroff_functions) \ | 522 | #define NUM_PO_FUNCS ARRAY_SIZE(poweroff_functions) |
523 | / sizeof(struct poweroff_function)) | ||
524 | 523 | ||
525 | 524 | ||
526 | /* Called on a powerdown request. */ | 525 | /* Called on a powerdown request. */ |