diff options
author | Atsushi Nemoto <[email protected]> | 2012-08-21 16:16:10 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2012-08-21 16:45:03 -0700 |
commit | 7dbfb315b2aaef0a115765946bf3026d074c33a7 (patch) | |
tree | c3fe42971fbd713a1bc7bc263410a4eaec8521fc /tools/perf/util/trace-event-scripting.c | |
parent | b121186ab1b12e2a96a945d88eae0735b4542158 (diff) |
drivers/rtc/rtc-rs5c348.c: fix hour decoding in 12-hour mode
Correct the offset by subtracting 20 from tm_hour before taking the
modulo 12.
[ "Why 20?" I hear you ask. Or at least I did.
Here's the reason why: RS5C348_BIT_PM is 32, and is - stupidly -
included in the RS5C348_HOURS_MASK define. So it's really subtracting
out that bit to get "hour+12". But then because it does things modulo
12, it needs to add the 12 in again afterwards anyway.
This code is confused. It would be much clearer if RS5C348_HOURS_MASK
just didn't include the RS5C348_BIT_PM bit at all, then it wouldn't
need to do the silly subtract either.
Whatever. It's all just math, the end result is the same. - Linus ]
Reported-by: James Nute <[email protected]>
Tested-by: James Nute <[email protected]>
Signed-off-by: Atsushi Nemoto <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/util/trace-event-scripting.c')
0 files changed, 0 insertions, 0 deletions