]> git.baikalelectronics.ru Git - kernel.git/commit
clocksource: nps: avoid maybe-uninitialized warning
authorArnd Bergmann <arnd@arndb.de>
Tue, 22 Nov 2016 14:33:44 +0000 (15:33 +0100)
committerVineet Gupta <vgupta@synopsys.com>
Wed, 30 Nov 2016 19:54:25 +0000 (11:54 -0800)
commit64272721c9b3e258f4c9778d2e2b9710733c2998
treea20bdb7696eac194d005226eae15fd505258d522
parent8421d945910d33c5c51e9d40c7c855f4fc1b7938
clocksource: nps: avoid maybe-uninitialized warning

We get a harmless false-positive warning with the newly added nps
clocksource driver:

drivers/clocksource/timer-nps.c: In function 'nps_setup_clocksource':
drivers/clocksource/timer-nps.c:102:6: error: 'nps_timer1_freq' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Gcc here fails to identify that IS_ERR() is only true if PTR_ERR()
has a nonzero value. Using PTR_ERR_OR_ZERO() to convert the result
first makes this obvious and shuts up the warning.

Fixes: 0ee4d9922df5 ("clocksource: Add clockevent support to NPS400 driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
drivers/clocksource/timer-nps.c