mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 13:14:02 +02:00
powerpc/powernv: Avoid strlen() in pnv_restart()
Check only the first byte instead of scanning the entire string with strlen(). Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Reviewed-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20260721155346.121975-3-thorsten.blum@linux.dev
This commit is contained in:
parent
a2144b13a6
commit
86bb4d74da
|
|
@ -312,7 +312,7 @@ static void __noreturn pnv_restart(char *cmd)
|
|||
pnv_prepare_going_down();
|
||||
|
||||
do {
|
||||
if (!cmd || !strlen(cmd))
|
||||
if (!cmd || *cmd == '\0')
|
||||
rc = opal_cec_reboot();
|
||||
else if (strcmp(cmd, "full") == 0)
|
||||
rc = opal_cec_reboot2(OPAL_REBOOT_FULL_IPL, NULL);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user