printk: Clean up do_syslog() error handling

The error variable in do_syslog() is preemptively set to the error code
before the error condition is checked, and then set to 0 if the error
condition is not encountered. This is not necessary, as it is likely
simpler to return immediately upon encountering the error condition. A
redundant set of the error variable to 0 is also removed.

This patch has been build-tested on x86_64, but not tested for

Cc: Steven Rostedt <>
Signed-off-by: Nikitas Angelinas <>
Reviewed-by: Sergey Senozhatsky <>
Signed-off-by: Petr Mladek <>
1 file changed