thermal: rockchip: add driver for thermal

Dan Carpenter dan.carpenter at oracle.com
Wed Nov 18 02:33:01 PST 2015


Hello Caesar Wang,

The patch cbac8f639437: "thermal: rockchip: add driver for thermal"
from Nov 24, 2014, leads to the following static checker warning:

	drivers/thermal/rockchip_thermal.c:551 rockchip_configure_from_dt()
	warn: impossible condition '(thermal->tshut_temp > ((~0 >> 1))) => (s32min-s32max > s32max)'

drivers/thermal/rockchip_thermal.c
   542          if (of_property_read_u32(np, "rockchip,hw-tshut-temp", &shut_temp)) {
   543                  dev_warn(dev,
   544                           "Missing tshut temp property, using default %d\n",
   545                           thermal->chip->tshut_temp);
   546                  thermal->tshut_temp = thermal->chip->tshut_temp;
   547          } else {
   548                  thermal->tshut_temp = shut_temp;
   549          }
   550  
   551          if (thermal->tshut_temp > INT_MAX) {

->tshut_temp is an int so comparing it with INT_MAX is probably not
intended.

   552                  dev_err(dev, "Invalid tshut temperature specified: %d\n",
   553                          thermal->tshut_temp);
   554                  return -ERANGE;
   555          }
   556  


regards,
dan carpenter



More information about the Linux-rockchip mailing list