Hi,

I've found that "temp" variable is used as a storage for the result of
tv_channel().  It may be -1, but "temp" is unsigned, so the check temp < 0
makes no sence.  The same with two calls to tv_freq().  Changing "temp"
type to int solves the problem.


A sematic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

@@
type T;
unsigned T x;
@@

* (x < 0)

@@
type T;
unsigned T x;
@@

* (x <= 0)

@@
type T;
unsigned T x;
@@

* (x >= 0)


--- ./sys/dev/pci/bktr/bktr_core.c.orig 2009-11-10 16:30:28.000000000 +0000
+++ ./sys/dev/pci/bktr/bktr_core.c      2010-10-29 16:47:12.000000000 +0000
@@ -1701,7 +1701,8 @@ int
 tuner_ioctl( bktr_ptr_t bktr, int unit, ioctl_cmd_t cmd, caddr_t arg, struct 
proc* pr )
 {
        int             tmp_int;
-       unsigned int    temp, temp1;
+       unsigned int    temp1;
+       int             temp;
        int             offset;
        int             count;
        u_char          *buf;
--

Thanks,

-- 
Vasiliy

Reply via email to