Skip to contentSkip to conversation

rtc: pcf85063: silence cppcheck warning

PATCH New Alexandre Belloni 1 participant 1 message Nov 7, 2021 Real time clock (RTC)

lore
Share & tools
lore

Alexandre Belloni

author maintainer
#0 lore raw

PATCH 1/1 rtc: pcf85063: silence cppcheck warning

cppcheck warnings: (new ones prefixed by >>)

Quoted 1 line
Quoted 1 line

drivers/rtc/rtc-pcf85063.c:292:40: warning: Clarify calculation precedence for '&' and '?'. [clarifyCalculation]

     status = status & PCF85063_REG_SC_OS ? RTC_VL_DATA_INVALID : 0;
---
 drivers/rtc/rtc-pcf85063.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-pcf85063.c +1 -1
index 4a70d6bae859..15e50bb10cf0 100644
@@ -299,7 +299,7 @@ static int pcf85063_ioctl(struct device *dev, unsigned int cmd,
 		if (ret < 0)
 			return ret;
 
-		status = status & PCF85063_REG_SC_OS ? RTC_VL_DATA_INVALID : 0;
+		status = (status & PCF85063_REG_SC_OS) ? RTC_VL_DATA_INVALID : 0;
 
 		return put_user(status, (unsigned int __user *)arg);
 
Signature · 1 line
2.31.1