Atsushi Nemoto 7dbfb315b2 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 <newten82@gmail.com>
Tested-by: James Nute <newten82@gmail.com>
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-08-21 16:45:03 -07:00
..
2012-08-12 21:34:09 +03:00
2012-08-20 13:13:47 -07:00
2012-08-02 13:51:46 -04:00
2012-08-13 10:15:22 +05:30
2012-07-29 21:11:05 -03:00
2012-07-30 09:32:39 -07:00
2012-08-20 13:14:22 -07:00
2012-08-16 20:24:38 +01:00
2012-08-13 14:34:02 +08:00
2012-08-20 13:14:22 -07:00
2012-08-12 21:31:44 +03:00
2012-08-20 13:14:22 -07:00
2012-07-09 16:42:24 -04:00
2012-07-24 14:07:22 -07:00
2012-08-20 13:05:27 -07:00
2012-08-20 13:14:22 -07:00
2012-08-20 13:14:22 -07:00
2012-07-31 08:16:24 -06:00
2012-07-24 16:17:07 -07:00
2012-07-31 08:16:22 -06:00
2012-07-31 08:16:22 -06:00