Linux Media Controller development
 help / color / mirror / Atom feed
* re: [media] af9035: add Avermedia Volar HD (A867R) support
@ 2012-10-02  8:30 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2012-10-02  8:30 UTC (permalink / raw)
  To: hfvogt; +Cc: linux-media

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-10-02  8:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-02  8:30 [media] af9035: add Avermedia Volar HD (A867R) support Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox