Hello Hans-Frieder Vogt,

The patch 540fd4ba0533: "[media] af9035: add Avermedia Volar HD
(A867R) support" from Apr 2, 2012, leads to the following Clang warning:
        drivers/media/dvb-frontends/af9033.c:467:20: warning: comparison
        of unsigned expression >= 0 is always true
        [-Wtautological-compare]

drivers/media/dvb-frontends/af9033.c
   464                  while (if_frequency > (adc_freq / 2))
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
if_frequency is unsigned.  I worry that this loop doesn't handle integer
underflow properly.

   465                          if_frequency -= adc_freq;
   466  
   467                  if (if_frequency >= 0)
                            ^^^^^^^^^^^^^^^^^
This is always true.

   468                          spec_inv *= -1;
   469                  else
   470                          if_frequency *= -1;

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to