drivers/staging/comedi/drivers/addi-data/hwdrv_apci3200.c: drop incorrect checks
authorAndrey Utkin <andrey.krieger.utkin@gmail.com>
Thu, 17 Jul 2014 16:28:21 +0000 (19:28 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Jul 2014 01:08:31 +0000 (18:08 -0700)
Dropped some "< 0" and ">= 0" checks on unsigned int values.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=80501
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/addi-data/hwdrv_apci3200.c

index a3026a229e85e3e885c3e4cc05707b70c0daec8e..3a215ac68b6fb725b79102fd2601d68a4d5e3c01 100644 (file)
@@ -1750,34 +1750,34 @@ static int apci3200_ai_config(struct comedi_device *dev,
        /* END JK 06.07.04: Management of sevrals boards */
 
        if (data[5] == 0) {
-               if (ui_ChannelNo < 0 || ui_ChannelNo > 15) {
+               if (ui_ChannelNo > 15) {
                        printk("\nThe Selection of the channel is in error\n");
                        i_err++;
-               }               /*  if(ui_ChannelNo<0 || ui_ChannelNo>15) */
+               }               /*  if(ui_ChannelNo>15) */
        }                       /* if(data[5]==0) */
        else {
                if (data[14] == 2) {
-                       if (ui_ChannelNo < 0 || ui_ChannelNo > 3) {
+                       if (ui_ChannelNo > 3) {
                                printk("\nThe Selection of the channel is in error\n");
                                i_err++;
-                       }       /*  if(ui_ChannelNo<0 || ui_ChannelNo>3) */
+                       }       /*  if(ui_ChannelNo>3) */
                }               /* if(data[14]==2) */
                else {
-                       if (ui_ChannelNo < 0 || ui_ChannelNo > 7) {
+                       if (ui_ChannelNo > 7) {
                                printk("\nThe Selection of the channel is in error\n");
                                i_err++;
-                       }       /*  if(ui_ChannelNo<0 || ui_ChannelNo>7) */
+                       }       /*  if(ui_ChannelNo>7) */
                }               /* elseif(data[14]==2) */
        }                       /* elseif(data[5]==0) */
        if (data[12] == 0 || data[12] == 1) {
                switch (data[5]) {
                case 0:
-                       if (ui_ChannelNo >= 0 && ui_ChannelNo <= 3) {
+                       if (ui_ChannelNo <= 3) {
                                /* BEGIN JK 06.07.04: Management of sevrals boards */
                                /* i_Offset=0; */
                                s_BoardInfos[dev->minor].i_Offset = 0;
                                /* END JK 06.07.04: Management of sevrals boards */
-                       }       /* if(ui_ChannelNo >=0 && ui_ChannelNo <=3) */
+                       }       /* if(ui_ChannelNo <=3) */
                        if (ui_ChannelNo >= 4 && ui_ChannelNo <= 7) {
                                /* BEGIN JK 06.07.04: Management of sevrals boards */
                                /* i_Offset=64; */
@@ -1831,12 +1831,12 @@ static int apci3200_ai_config(struct comedi_device *dev,
                                ui_ChannelNo = 0;
                                break;
                        }       /* if(data[14]==2) */
-                       if (ui_ChannelNo >= 0 && ui_ChannelNo <= 1) {
+                       if (ui_ChannelNo <= 1) {
                                /* BEGIN JK 06.07.04: Management of sevrals boards */
                                /* i_Offset=0; */
                                s_BoardInfos[dev->minor].i_Offset = 0;
                                /* END JK 06.07.04: Management of sevrals boards */
-                       }       /* if(ui_ChannelNo >=0 && ui_ChannelNo <=1) */
+                       }       /* if(ui_ChannelNo <=1) */
                        if (ui_ChannelNo >= 2 && ui_ChannelNo <= 3) {
                                /* BEGIN JK 06.07.04: Management of sevrals boards */
                                /* i_ChannelNo=i_ChannelNo-2; */