printk: drop redundant devkmsg_log_str memsets
We copy in null terminated strings "on" and "off", no need to zero out devkmsg_log_str in control_devkmsg(). Link: http://lkml.kernel.org/r/20180119043901.1728-1-sergey.senozhatsky@gmail.com Cc: linux-kernel@vger.kernel.org Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Petr Mladek <pmladek@suse.com>
This commit is contained in:
parent
cca10d58d2
commit
6fd78a1a99
|
@ -131,13 +131,10 @@ static int __init control_devkmsg(char *str)
|
|||
/*
|
||||
* Set sysctl string accordingly:
|
||||
*/
|
||||
if (devkmsg_log == DEVKMSG_LOG_MASK_ON) {
|
||||
memset(devkmsg_log_str, 0, DEVKMSG_STR_MAX_SIZE);
|
||||
strncpy(devkmsg_log_str, "on", 2);
|
||||
} else if (devkmsg_log == DEVKMSG_LOG_MASK_OFF) {
|
||||
memset(devkmsg_log_str, 0, DEVKMSG_STR_MAX_SIZE);
|
||||
strncpy(devkmsg_log_str, "off", 3);
|
||||
}
|
||||
if (devkmsg_log == DEVKMSG_LOG_MASK_ON)
|
||||
strcpy(devkmsg_log_str, "on");
|
||||
else if (devkmsg_log == DEVKMSG_LOG_MASK_OFF)
|
||||
strcpy(devkmsg_log_str, "off");
|
||||
/* else "ratelimit" which is set by default. */
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue