:::::: 
:::::: 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: [email protected]
BCC: [email protected]
CC: [email protected]
TO: Jonathan Lemon <[email protected]>

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 <[email protected]>


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
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to