lkml.org 
[lkml]   [2003]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2.4.22-pre5] another cpia.c warning fix
Date
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi.

This patch fixes these warnings:
cpia.c:1686: Warnung: comparison is always false due to limited range of data type
cpia.c:1688: Warnung: comparison is always false due to limited range of data type
cpia.c:1690: Warnung: comparison is always false due to limited range of data type
cpia.c:1692: Warnung: comparison is always false due to limited range of data type

The warnings are thrown, because an u8 is tested against >255.
As far as I can see, these tests are completely useless,
because u8 will never be >255.
struct cam_params {
[SNIP]
struct {
u8 gainMode;
u8 expMode;
u8 compMode;
u8 centreWeight;
u8 gain;
u8 fineExp;
u8 coarseExpLo;
u8 coarseExpHi;
u8 redComp;
u8 green1Comp;
u8 green2Comp;
u8 blueComp;
} exposure;
[SNIP]
};



- --- drivers/media/video/cpia.c.orig 2003-06-13 20:52:37.000000000 +0200
+++ drivers/media/video/cpia.c 2003-07-14 21:12:45.000000000 +0200
@@ -1683,13 +1683,9 @@
* values. - rich@annexia.org
*/
if (cam->params.exposure.redComp < 220 ||
- - cam->params.exposure.redComp > 255 ||
cam->params.exposure.green1Comp < 214 ||
- - cam->params.exposure.green1Comp > 255 ||
cam->params.exposure.green2Comp < 214 ||
- - cam->params.exposure.green2Comp > 255 ||
- - cam->params.exposure.blueComp < 230 ||
- - cam->params.exposure.blueComp > 255)
+ cam->params.exposure.blueComp < 230)
{
printk (KERN_WARNING "*_comp parameters have gone AWOL (%d/%d/%d/%d) - reseting them\n",
cam->params.exposure.redComp,
- --
Regards Michael Buesch
http://www.8ung.at/tuxsoft
21:12:56 up 2:23, 3 users, load average: 1.20, 1.06, 1.13

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE/EwGgoxoigfggmSgRAgOyAJ42TUVPCMuuFhlhQne351LQAayyrACfY5gn
LdtWXgKauUanjuwOn6cfM/c=
=ZwVh
-----END PGP SIGNATURE-----
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:46    [W:0.182 / U:1.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site