fpga: zynq: Fix incorrect variable type
Hello Nava kishore Manne,
The patch ada14a023a64: "fpga: zynq: Fix incorrect variable type" from Apr 21, 2022, leads to the following Smatch static checker warning:
drivers/fpga/zynq-fpga.c:245 zynq_fpga_has_sync() warn: impossible condition '(buf[2] == 153) => ((-128)-127 == 153)'
drivers/fpga/zynq-fpga.c
242 static bool zynq_fpga_has_sync(const char *buf, size_t count)
243 {
244 for (; count >= 4; buf += 4, count -= 4)
--> 245 if (buf[0] == 0x66 && buf[1] == 0x55 && buf[2] == 0x99 &&
^^^^^^^^^^^^^^The patch changed the u8 to char.
The kbuild bot sent an email about this bug on Apr 4 but only Nava was on the CC and the warning was ignored. This kind of a dangerous thing, because I tend to only send warnings once.
https://lists.01.org/hyperkitty/list/[email protected]/thread/4RFIS5FM43D2U26PX7ZL44AFA5RYBWX2/
There is a process issue somewhere. Why was the [email protected] not CC'd on the original report? Did you deliberately ask to be left off automated bug reports?
246 buf[3] == 0xaa)
247 return true;
248 return false;
249 }regards,
dan carpenter
Xu Yilun
maintainerQuoted 21 lines · Dan Carpenter
Hello Nava kishore Manne,
The patch
ada14a023a64: "fpga: zynq: Fix incorrect variable type" from Apr 21, 2022, leads to the following Smatch static checker warning:drivers/fpga/zynq-fpga.c:245 zynq_fpga_has_sync() warn: impossible condition '(buf[2] == 153) => ((-128)-127 == 153)'
drivers/fpga/zynq-fpga.c242 static bool zynq_fpga_has_sync(const char *buf, size_t count) 243 { 244 for (; count >= 4; buf += 4, count -= 4) --> 245 if (buf[0] == 0x66 && buf[1] == 0x55 && buf[2] == 0x99 && ^^^^^^^^^^^^^^The patch changed the u8 to char.
The kbuild bot sent an email about this bug on Apr 4 but only Nava was on the CC and the warning was ignored. This kind of a dangerous thing, because I tend to only send warnings once.
Quoted 5 lines
https://lists.01.org/hyperkitty/list/[email protected]/thread/4RFIS5FM43D2U26PX7ZL44AFA5RYBWX2/
There is a process issue somewhere. Why was the [email protected] not CC'd on the original report? Did you deliberately ask to be left off automated bug reports?
Thanks for the notification. I did't realize that [email protected] is out of lkp report, it should not be our intent.
Anything I should do to get back in?
Thanks,
Yilun
Quoted 8 lines
246 buf[3] == 0xaa) 247 return true; 248 return false; 249 }regards,
dan carpenter