:::::: :::::: Manual check reason: "low confidence static check warning: drivers/ptp/ptp_ocp.c:915:3: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]" ::::::
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: 1aa66a3a135a25bd8ce25165b4e550159a3dc849 ptp: ocp: Program the signal generators via PTP_CLK_REQ_PEROUT date: 3 months ago :::::: branch date: 2 days ago :::::: commit date: 3 months ago compiler: hppa-linux-gcc (GCC) 11.3.0 reproduce (cppcheck warning): # apt-get install cppcheck git checkout 1aa66a3a135a25bd8ce25165b4e550159a3dc849 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:1618:18: warning: Boolean result is used in bitwise operation. Clarify expression with parentheses. [clarifyCondition] if ((!!old_map ^ !!bp->pps_req_map) == 0) ^ >> drivers/ptp/ptp_ocp.c:915:3: warning: %d in format string (no. 1) requires >> 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] sprintf(buf, "OUT: GEN%d", chan); ^ drivers/ptp/ptp_ocp.c:2103:16: warning: Signed integer overflow for expression '0xffff<<(16-shift)'. [integerOverflow] mask = 0xffff << (16 - shift); ^ drivers/ptp/ptp_ocp.c:2101:21: note: Assignment 'shift=sma_nr&1?0:16', assigned value is 0 shift = sma_nr & 1 ? 0 : 16; ^ drivers/ptp/ptp_ocp.c:2103:16: note: Integer overflow mask = 0xffff << (16 - shift); ^ drivers/ptp/ptp_ocp.c:2127:16: warning: Signed integer overflow for expression '0xffff<<(16-shift)'. [integerOverflow] mask = 0xffff << (16 - shift); ^ drivers/ptp/ptp_ocp.c:2125:21: note: Assignment 'shift=sma_nr&1?0:16', assigned value is 0 shift = sma_nr & 1 ? 0 : 16; ^ drivers/ptp/ptp_ocp.c:2127:16: note: Integer overflow mask = 0xffff << (16 - shift); ^ vim +915 drivers/ptp/ptp_ocp.c 773bda96492153 Jonathan Lemon 2021-08-03 903 1aa66a3a135a25 Jonathan Lemon 2022-03-10 904 static int 1aa66a3a135a25 Jonathan Lemon 2022-03-10 905 ptp_ocp_verify(struct ptp_clock_info *ptp_info, unsigned pin, 1aa66a3a135a25 Jonathan Lemon 2022-03-10 906 enum ptp_pin_function func, unsigned chan) 1aa66a3a135a25 Jonathan Lemon 2022-03-10 907 { 1aa66a3a135a25 Jonathan Lemon 2022-03-10 908 struct ptp_ocp *bp = container_of(ptp_info, struct ptp_ocp, ptp_info); 1aa66a3a135a25 Jonathan Lemon 2022-03-10 909 char buf[16]; 1aa66a3a135a25 Jonathan Lemon 2022-03-10 910 1aa66a3a135a25 Jonathan Lemon 2022-03-10 911 if (func != PTP_PF_PEROUT) 1aa66a3a135a25 Jonathan Lemon 2022-03-10 912 return -EOPNOTSUPP; 1aa66a3a135a25 Jonathan Lemon 2022-03-10 913 1aa66a3a135a25 Jonathan Lemon 2022-03-10 914 if (chan) 1aa66a3a135a25 Jonathan Lemon 2022-03-10 @915 sprintf(buf, "OUT: GEN%d", chan); 1aa66a3a135a25 Jonathan Lemon 2022-03-10 916 else 1aa66a3a135a25 Jonathan Lemon 2022-03-10 917 sprintf(buf, "OUT: PHC"); 1aa66a3a135a25 Jonathan Lemon 2022-03-10 918 1aa66a3a135a25 Jonathan Lemon 2022-03-10 919 return ptp_ocp_sma_store(bp, buf, pin + 1); 1aa66a3a135a25 Jonathan Lemon 2022-03-10 920 } 1aa66a3a135a25 Jonathan Lemon 2022-03-10 921 -- 0-DAY CI Kernel Test Service https://01.org/lkp _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
