]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
rtc: mc13xxx: fix obfuscated and wrong format string
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Fri, 20 Feb 2015 13:47:30 +0000 (14:47 +0100)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Wed, 24 Jun 2015 23:13:35 +0000 (01:13 +0200)
commit99c14e4df6144bca12dcac657266a7b8216aaa16
treecf213921916517a012e4bfe0375c7a5dbafc7fc2
parent607b8fc90d3bd8121ab00ac824e6bd2e1a6a2e6e
rtc: mc13xxx: fix obfuscated and wrong format string

According to C99, %2.s means 'print two spaces' (a precision of
. without following digits or * means 0). The kernel's printf
implementation, however, treats that case as if no precision was
given, but relying on that quirk is rather silly. Also, since no -
(aka left-justify) flag is given, the field with of 2 would then cause
the alarm->enabled case to come out as "o n". Deobfuscate it.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-mc13xxx.c