All of lore.kernel.org
 help / color / mirror / Atom feed
From: "O.Sezer" <sezeroz@ttnet.net.tr>
To: linux-kernel@vger.kernel.org
Cc: marcelo.tosatti@cyclades.com
Subject: [PATCH 2.4] comparison warning fixes
Date: Fri, 13 Aug 2004 23:25:25 +0300	[thread overview]
Message-ID: <411D23B5.7000105@ttnet.net.tr> (raw)

[-- 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);
 

                 reply	other threads:[~2004-08-13 20:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=411D23B5.7000105@ttnet.net.tr \
    --to=sezeroz@ttnet.net.tr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.