Commit 7a873f48 authored by zhong jiang's avatar zhong jiang Committed by Khalid Elmously

s390: qeth_core_mpc: Use ARRAY_SIZE instead of reimplementing its function

BugLink: https://bugs.launchpad.net/bugs/1800641

Use the common code ARRAY_SIZE macro instead of a private implementation.
Reviewed-by: default avatarJean Delvare <jdelvare@suse.de>
Signed-off-by: default avatarzhong jiang <zhongjiang@huawei.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
(cherry picked from commit 065a2cdc)
Signed-off-by: default avatarJoseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: default avatarKleber Souza <kleber.souza@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 568586af
...@@ -215,8 +215,7 @@ static struct ipa_rc_msg qeth_ipa_rc_msg[] = { ...@@ -215,8 +215,7 @@ static struct ipa_rc_msg qeth_ipa_rc_msg[] = {
char *qeth_get_ipa_msg(enum qeth_ipa_return_codes rc) char *qeth_get_ipa_msg(enum qeth_ipa_return_codes rc)
{ {
int x = 0; int x = 0;
qeth_ipa_rc_msg[sizeof(qeth_ipa_rc_msg) / qeth_ipa_rc_msg[ARRAY_SIZE(qeth_ipa_rc_msg) - 1].rc = rc;
sizeof(struct ipa_rc_msg) - 1].rc = rc;
while (qeth_ipa_rc_msg[x].rc != rc) while (qeth_ipa_rc_msg[x].rc != rc)
x++; x++;
return qeth_ipa_rc_msg[x].msg; return qeth_ipa_rc_msg[x].msg;
...@@ -262,9 +261,7 @@ static struct ipa_cmd_names qeth_ipa_cmd_names[] = { ...@@ -262,9 +261,7 @@ static struct ipa_cmd_names qeth_ipa_cmd_names[] = {
char *qeth_get_ipa_cmd_name(enum qeth_ipa_cmds cmd) char *qeth_get_ipa_cmd_name(enum qeth_ipa_cmds cmd)
{ {
int x = 0; int x = 0;
qeth_ipa_cmd_names[ qeth_ipa_cmd_names[ARRAY_SIZE(qeth_ipa_cmd_names) - 1].cmd = cmd;
sizeof(qeth_ipa_cmd_names) /
sizeof(struct ipa_cmd_names)-1].cmd = cmd;
while (qeth_ipa_cmd_names[x].cmd != cmd) while (qeth_ipa_cmd_names[x].cmd != cmd)
x++; x++;
return qeth_ipa_cmd_names[x].name; return qeth_ipa_cmd_names[x].name;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment