All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/ptp/ptp_ocp.c:1236:18: warning: Boolean result is used in bitwise operation. Clarify expression with parentheses. [clarifyCondition]
@ 2022-05-07 13:21 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2022-05-07 13:21 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3479 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Jonathan Lemon <jonathan.lemon@gmail.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   4b97bac0756a81cda5afd45417a99b5bccdcff67
commit: a62a56d04e63cf0ececb5dd339811f0a14b7e77c ptp: ocp: Enable 4th timestamper / PPS generator
date:   8 months ago
:::::: branch date: 16 hours ago
:::::: commit date: 8 months ago
compiler: aarch64-linux-gcc (GCC) 11.3.0
reproduce (cppcheck warning):
        # apt-get install cppcheck
        git checkout a62a56d04e63cf0ececb5dd339811f0a14b7e77c
        cppcheck --quiet --enable=style,performance,portability --template=gcc FILE

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> drivers/ptp/ptp_ocp.c:1236:18: warning: Boolean result is used in bitwise operation. Clarify expression with parentheses. [clarifyCondition]
     if ((!!old_map ^ !!bp->pps_req_map) == 0)
                    ^

vim +1236 drivers/ptp/ptp_ocp.c

773bda96492153e Jonathan Lemon 2021-08-03  1219  
773bda96492153e Jonathan Lemon 2021-08-03  1220  static int
a62a56d04e63cf0 Jonathan Lemon 2021-09-14  1221  ptp_ocp_ts_enable(void *priv, u32 req, bool enable)
773bda96492153e Jonathan Lemon 2021-08-03  1222  {
773bda96492153e Jonathan Lemon 2021-08-03  1223  	struct ptp_ocp_ext_src *ext = priv;
773bda96492153e Jonathan Lemon 2021-08-03  1224  	struct ts_reg __iomem *reg = ext->mem;
a62a56d04e63cf0 Jonathan Lemon 2021-09-14  1225  	struct ptp_ocp *bp = ext->bp;
a62a56d04e63cf0 Jonathan Lemon 2021-09-14  1226  
a62a56d04e63cf0 Jonathan Lemon 2021-09-14  1227  	if (ext == bp->pps) {
a62a56d04e63cf0 Jonathan Lemon 2021-09-14  1228  		u32 old_map = bp->pps_req_map;
a62a56d04e63cf0 Jonathan Lemon 2021-09-14  1229  
a62a56d04e63cf0 Jonathan Lemon 2021-09-14  1230  		if (enable)
a62a56d04e63cf0 Jonathan Lemon 2021-09-14  1231  			bp->pps_req_map |= req;
a62a56d04e63cf0 Jonathan Lemon 2021-09-14  1232  		else
a62a56d04e63cf0 Jonathan Lemon 2021-09-14  1233  			bp->pps_req_map &= ~req;
a62a56d04e63cf0 Jonathan Lemon 2021-09-14  1234  
a62a56d04e63cf0 Jonathan Lemon 2021-09-14  1235  		/* if no state change, just return */
a62a56d04e63cf0 Jonathan Lemon 2021-09-14 @1236  		if ((!!old_map ^ !!bp->pps_req_map) == 0)
a62a56d04e63cf0 Jonathan Lemon 2021-09-14  1237  			return 0;
a62a56d04e63cf0 Jonathan Lemon 2021-09-14  1238  	}
773bda96492153e Jonathan Lemon 2021-08-03  1239  
773bda96492153e Jonathan Lemon 2021-08-03  1240  	if (enable) {
773bda96492153e Jonathan Lemon 2021-08-03  1241  		iowrite32(1, &reg->enable);
773bda96492153e Jonathan Lemon 2021-08-03  1242  		iowrite32(1, &reg->intr_mask);
773bda96492153e Jonathan Lemon 2021-08-03  1243  		iowrite32(1, &reg->intr);
773bda96492153e Jonathan Lemon 2021-08-03  1244  	} else {
773bda96492153e Jonathan Lemon 2021-08-03  1245  		iowrite32(0, &reg->intr_mask);
773bda96492153e Jonathan Lemon 2021-08-03  1246  		iowrite32(0, &reg->enable);
773bda96492153e Jonathan Lemon 2021-08-03  1247  	}
773bda96492153e Jonathan Lemon 2021-08-03  1248  
773bda96492153e Jonathan Lemon 2021-08-03  1249  	return 0;
773bda96492153e Jonathan Lemon 2021-08-03  1250  }
773bda96492153e Jonathan Lemon 2021-08-03  1251  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] 2+ messages in thread

* drivers/ptp/ptp_ocp.c:1236:18: warning: Boolean result is used in bitwise operation. Clarify expression with parentheses. [clarifyCondition]
@ 2022-06-14  6:28 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2022-06-14  6:28 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3917 bytes --]

:::::: 
:::::: Manual check reason: "low confidence static check warning: drivers/ptp/ptp_ocp.c:1236:18: warning: Boolean result is used in bitwise operation. Clarify expression with parentheses. [clarifyCondition]"
:::::: 

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Jonathan Lemon <jonathan.lemon@gmail.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b13baccc3850ca8b8cccbf8ed9912dbaa0fdf7f3
commit: a62a56d04e63cf0ececb5dd339811f0a14b7e77c ptp: ocp: Enable 4th timestamper / PPS generator
date:   9 months ago
:::::: branch date: 31 hours ago
:::::: commit date: 9 months ago
compiler: hppa-linux-gcc (GCC) 11.3.0
reproduce (cppcheck warning):
        # apt-get install cppcheck
        git checkout a62a56d04e63cf0ececb5dd339811f0a14b7e77c
        cppcheck --quiet --enable=style,performance,portability --template=gcc FILE

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> drivers/ptp/ptp_ocp.c:1236:18: warning: Boolean result is used in bitwise operation. Clarify expression with parentheses. [clarifyCondition]
     if ((!!old_map ^ !!bp->pps_req_map) == 0)
                    ^
>> net/bridge/br_netlink.c:1066:60: warning: Parameter 'data' can be declared with const [constParameter]
   static int br_validate(struct nlattr *tb[], struct nlattr *data[],
                                                              ^

vim +1236 drivers/ptp/ptp_ocp.c

773bda96492153 Jonathan Lemon 2021-08-03  1219  
773bda96492153 Jonathan Lemon 2021-08-03  1220  static int
a62a56d04e63cf Jonathan Lemon 2021-09-14  1221  ptp_ocp_ts_enable(void *priv, u32 req, bool enable)
773bda96492153 Jonathan Lemon 2021-08-03  1222  {
773bda96492153 Jonathan Lemon 2021-08-03  1223  	struct ptp_ocp_ext_src *ext = priv;
773bda96492153 Jonathan Lemon 2021-08-03  1224  	struct ts_reg __iomem *reg = ext->mem;
a62a56d04e63cf Jonathan Lemon 2021-09-14  1225  	struct ptp_ocp *bp = ext->bp;
a62a56d04e63cf Jonathan Lemon 2021-09-14  1226  
a62a56d04e63cf Jonathan Lemon 2021-09-14  1227  	if (ext == bp->pps) {
a62a56d04e63cf Jonathan Lemon 2021-09-14  1228  		u32 old_map = bp->pps_req_map;
a62a56d04e63cf Jonathan Lemon 2021-09-14  1229  
a62a56d04e63cf Jonathan Lemon 2021-09-14  1230  		if (enable)
a62a56d04e63cf Jonathan Lemon 2021-09-14  1231  			bp->pps_req_map |= req;
a62a56d04e63cf Jonathan Lemon 2021-09-14  1232  		else
a62a56d04e63cf Jonathan Lemon 2021-09-14  1233  			bp->pps_req_map &= ~req;
a62a56d04e63cf Jonathan Lemon 2021-09-14  1234  
a62a56d04e63cf Jonathan Lemon 2021-09-14  1235  		/* if no state change, just return */
a62a56d04e63cf Jonathan Lemon 2021-09-14 @1236  		if ((!!old_map ^ !!bp->pps_req_map) == 0)
a62a56d04e63cf Jonathan Lemon 2021-09-14  1237  			return 0;
a62a56d04e63cf Jonathan Lemon 2021-09-14  1238  	}
773bda96492153 Jonathan Lemon 2021-08-03  1239  
773bda96492153 Jonathan Lemon 2021-08-03  1240  	if (enable) {
773bda96492153 Jonathan Lemon 2021-08-03  1241  		iowrite32(1, &reg->enable);
773bda96492153 Jonathan Lemon 2021-08-03  1242  		iowrite32(1, &reg->intr_mask);
773bda96492153 Jonathan Lemon 2021-08-03  1243  		iowrite32(1, &reg->intr);
773bda96492153 Jonathan Lemon 2021-08-03  1244  	} else {
773bda96492153 Jonathan Lemon 2021-08-03  1245  		iowrite32(0, &reg->intr_mask);
773bda96492153 Jonathan Lemon 2021-08-03  1246  		iowrite32(0, &reg->enable);
773bda96492153 Jonathan Lemon 2021-08-03  1247  	}
773bda96492153 Jonathan Lemon 2021-08-03  1248  
773bda96492153 Jonathan Lemon 2021-08-03  1249  	return 0;
773bda96492153 Jonathan Lemon 2021-08-03  1250  }
773bda96492153 Jonathan Lemon 2021-08-03  1251  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-14  6:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-07 13:21 drivers/ptp/ptp_ocp.c:1236:18: warning: Boolean result is used in bitwise operation. Clarify expression with parentheses. [clarifyCondition] kernel test robot
2022-06-14  6:28 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.