[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202007301329.vj66ufFB%lkp@intel.com>
Date: Thu, 30 Jul 2020 13:30:34 +0800
From: kernel test robot <lkp@...el.com>
To: Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: drivers/rtc/rtc-pcf85063.c:292:40: warning: Clarify calculation
precedence for '&' and
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d3590ebf6f91350192737dd1d1b219c05277f067
commit: f86dc5bde18e540743eaef20529d9f2b67283abd rtc: pcf85063: return meaningful value for RTC_VL_READ
date: 8 months ago
compiler: or1k-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
cppcheck warnings: (new ones prefixed by >>)
>> 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;
^
vim +292 drivers/rtc/rtc-pcf85063.c
279
280 static int pcf85063_ioctl(struct device *dev, unsigned int cmd,
281 unsigned long arg)
282 {
283 struct pcf85063 *pcf85063 = dev_get_drvdata(dev);
284 int status, ret = 0;
285
286 switch (cmd) {
287 case RTC_VL_READ:
288 ret = regmap_read(pcf85063->regmap, PCF85063_REG_SC, &status);
289 if (ret < 0)
290 return ret;
291
> 292 status = status & PCF85063_REG_SC_OS ? RTC_VL_DATA_INVALID : 0;
293
294 return put_user(status, (unsigned int __user *)arg);
295
296 default:
297 return -ENOIOCTLCMD;
298 }
299 }
300
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Powered by blists - more mailing lists