mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2.4] comparison warning fixes
@ 2004-08-13 20:25 O.Sezer
  0 siblings, 0 replies; only message in thread
From: O.Sezer @ 2004-08-13 20:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: marcelo.tosatti

[-- Attachment #1: Type: text/plain, Size: 120 bytes --]

Various "comparison always true/false" fixes. The coda one is
in 2.6 iirc, AM53C974.c and pcmcia ones may need review.


[-- Attachment #2: coda-comparison.diff --]
[-- Type: text/plain, Size: 488 bytes --]

--- 27rc5~/fs/coda/dir.c	2003-08-25 14:44:43.000000000 +0300
+++ 27rc5/fs/coda/dir.c	2004-08-07 14:09:39.000000000 +0300
@@ -589,8 +589,7 @@
 			break;
 		}
 		/* validate whether the directory file actually makes sense */
-		if (vdir->d_reclen < vdir_size + vdir->d_namlen ||
-		    vdir->d_namlen > CODA_MAXNAMLEN) {
+		if (vdir->d_reclen < vdir_size + vdir->d_namlen) {
 			printk("coda_venus_readdir: Invalid dir: %ld\n",
 			       filp->f_dentry->d_inode->i_ino);
 			ret = -EBADF;

[-- Attachment #3: AM53C974.c-comparison.diff --]
[-- Type: text/plain, Size: 512 bytes --]

--- 27rc5~/drivers/scsi/AM53C974.c	2001-09-30 22:26:07.000000000 +0300
+++ 27rc5/drivers/scsi/AM53C974.c	2004-08-07 14:09:39.000000000 +0300
@@ -1612,7 +1612,7 @@
 		for (i = 0; i < sizeof(hostdata->last_message); i++)
 			hostdata->last_message[i] = hostdata->msgout[i];
 		if ((hostdata->msgout[0] == 0) || INSIDE(hostdata->msgout[0], 0x02, 0x1F) ||
-		    INSIDE(hostdata->msgout[0], 0x80, 0xFF))
+		    (hostdata->msgout[0] >= 0x80))
 			len = 1;
 		else {
 			if (hostdata->msgout[0] == EXTENDED_MESSAGE) {

[-- Attachment #4: pcmcia-comparison.diff --]
[-- Type: text/plain, Size: 1616 bytes --]

--- 27rc5~/drivers/pcmcia/i82092.c	2003-11-28 20:26:20.000000000 +0200
+++ 27rc5/drivers/pcmcia/i82092.c	2004-08-07 14:09:39.000000000 +0300
@@ -788,7 +788,7 @@
 		leave("i82092aa_set_io_map with invalid map");
 		return -EINVAL;
 	}
-	if ((io->start > 0xffff) || (io->stop > 0xffff) || (io->stop < io->start)){
+	if (io->stop < io->start){
 		leave("i82092aa_set_io_map with invalid io");
 		return -EINVAL;
 	}
--- 27rc5~/drivers/pcmcia/i82365.c	2003-11-28 20:26:20.000000000 +0200
+++ 27rc5/drivers/pcmcia/i82365.c	2004-08-07 14:09:39.000000000 +0300
@@ -1225,8 +1225,7 @@
 	  "%#4.4x-%#4.4x)\n", sock, io->map, io->flags,
 	  io->speed, io->start, io->stop);
     map = io->map;
-    if ((map > 1) || (io->start > 0xffff) || (io->stop > 0xffff) ||
-	(io->stop < io->start)) return -EINVAL;
+    if ((map > 1) || (io->stop < io->start)) return -EINVAL;
     /* Turn off the window before changing anything */
     if (i365_get(sock, I365_ADDRWIN) & I365_ENA_IO(map))
 	i365_bclr(sock, I365_ADDRWIN, I365_ENA_IO(map));
--- 27rc5~/drivers/pcmcia/tcic.c	2002-11-29 01:53:14.000000000 +0200
+++ 27rc5/drivers/pcmcia/tcic.c	2004-08-07 14:09:39.000000000 +0300
@@ -844,8 +844,7 @@
     DEBUG(1, "tcic: SetIOMap(%d, %d, %#2.2x, %d ns, "
 	  "%#4.4x-%#4.4x)\n", lsock, io->map, io->flags,
 	  io->speed, io->start, io->stop);
-    if ((io->map > 1) || (io->start > 0xffff) || (io->stop > 0xffff) ||
-	(io->stop < io->start)) return -EINVAL;
+    if ((io->map > 1) || (io->stop < io->start)) return -EINVAL;
     tcic_setw(TCIC_ADDR+2, TCIC_ADR2_INDREG | (psock << TCIC_SS_SHFT));
     addr = TCIC_IWIN(psock, io->map);
 

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

only message in thread, other threads:[~2004-08-13 20:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-13 20:25 [PATCH 2.4] comparison warning fixes O.Sezer

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

all inboxes | Powered by JetHome®