Commit 54fb07d0 authored by Vasily Gorbik's avatar Vasily Gorbik

s390/sclp: avoid using strncmp with hardcoded length

"earlyprintk" option documentation does not clearly state which
platform supports which additional values (e.g. ",keep"). Preserve old
option behaviour and reuse str_has_prefix instead of strncmp for prefix
testing.
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent b29cd7c4
...@@ -25,7 +25,7 @@ static int __init setup_early_printk(char *buf) ...@@ -25,7 +25,7 @@ static int __init setup_early_printk(char *buf)
if (early_console) if (early_console)
return 0; return 0;
/* Accept only "earlyprintk" and "earlyprintk=sclp" */ /* Accept only "earlyprintk" and "earlyprintk=sclp" */
if (buf && strncmp(buf, "sclp", 4)) if (buf && !str_has_prefix(buf, "sclp"))
return 0; return 0;
if (!sclp.has_linemode && !sclp.has_vt220) if (!sclp.has_linemode && !sclp.has_vt220)
return 0; return 0;
......
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