]> git.baikalelectronics.ru Git - kernel.git/commit
rtc/nuc900: fix checking of args during time-setting
authorWan ZongShun <mcuos.com@gmail.com>
Wed, 11 Aug 2010 01:02:07 +0000 (18:02 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Aug 2010 15:59:06 +0000 (08:59 -0700)
commit6ac3a11e51d17b68f55117a384b3c02175e392e4
tree01c89101b519340ff6252eb2de5024d016c20789
parent83560b350606d16acfcf7a3ad2148b604a084d52
rtc/nuc900: fix checking of args during time-setting

When a user application wants to set the rtc time, the RTC subsystem takes
advantage of 'rtc_valid_tm(tm)' to check 'rtc_time *tm' value validity, it
make sure the 'tm->tm_year' is larger than 70,so if '70< tm_year < 100',
the '(settm->tm_year - 100)' will be negative.  ' Setting the negative
value to hardware register will be invalid, so I add the 'if' condition to
make sure set a valid value to register.

Signed-off-by: Wan ZongShun <mcuos.com@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/rtc/rtc-nuc900.c