* [PATCH 2.4.22-pre5] another cpia.c warning fix
@ 2003-07-14 19:16 Michael Buesch
0 siblings, 0 replies; only message in thread
From: Michael Buesch @ 2003-07-14 19:16 UTC (permalink / raw)
To: Alan Cox; +Cc: linux kernel mailing list, Marcelo Tosatti
-----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-----
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-07-14 19:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-14 19:16 [PATCH 2.4.22-pre5] another cpia.c warning fix Michael Buesch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).