mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 14:04:27 -04:00
s390/ipl: Use ARRAY_SIZE macro
Use ARRAY_SIZE macro instead of reimplementing it. Signed-off-by: Mete Durlu <meted@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
This commit is contained in:
committed by
Vasily Gorbik
parent
e1eb7cffd3
commit
654e97c9d7
@@ -2044,7 +2044,6 @@ static struct shutdown_action stop_action = {SHUTDOWN_ACTION_STOP_STR,
|
||||
static struct shutdown_action *shutdown_actions_list[] = {
|
||||
&ipl_action, &reipl_action, &dump_reipl_action, &dump_action,
|
||||
&vmcmd_action, &stop_action};
|
||||
#define SHUTDOWN_ACTIONS_COUNT (sizeof(shutdown_actions_list) / sizeof(void *))
|
||||
|
||||
/*
|
||||
* Trigger section
|
||||
@@ -2057,7 +2056,7 @@ static int set_trigger(const char *buf, struct shutdown_trigger *trigger,
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < SHUTDOWN_ACTIONS_COUNT; i++) {
|
||||
for (i = 0; i < ARRAY_SIZE(shutdown_actions_list); i++) {
|
||||
if (sysfs_streq(buf, shutdown_actions_list[i]->name)) {
|
||||
if (shutdown_actions_list[i]->init_rc) {
|
||||
return shutdown_actions_list[i]->init_rc;
|
||||
@@ -2242,7 +2241,7 @@ static void __init shutdown_actions_init(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < SHUTDOWN_ACTIONS_COUNT; i++) {
|
||||
for (i = 0; i < ARRAY_SIZE(shutdown_actions_list); i++) {
|
||||
if (!shutdown_actions_list[i]->init)
|
||||
continue;
|
||||
shutdown_actions_list[i]->init_rc =
|
||||
|
||||
Reference in New Issue
Block a user