From: Bill Nottingham <notting@redhat.com>
To: netdev@vger.kernel.org
Cc: jgarzik@pobox.com, linux-kernel@vger.kernel.org
Subject: [PATCH] drivers/net: fix comparisons of unsigned < 0
Date: Wed, 30 May 2007 03:59:02 -0400 [thread overview]
Message-ID: <20070530075902.GA29118@nostromo.devel.redhat.com> (raw)
Recent gcc versions emit warnings when unsigned variables are compared < 0 or >= 0.
Signed-off-by: Bill Nottingham <notting@redhat.com>
---
mlx4/qp.c | 3 +--
netxen/netxen_nic_niu.c | 6 +++---
tulip/de2104x.c | 1 -
3 files changed, 4 insertions(+), 6 deletions(-)
diff -ru linux-2.6.21-old/drivers/net/mlx4/qp.c linux-2.6.21/drivers/net/mlx4/qp.c
--- linux-2.6.21-old/drivers/net/mlx4/qp.c 2007-05-30 02:52:53.000000000 -0400
+++ linux-2.6.21/drivers/net/mlx4/qp.c 2007-05-30 02:18:33.000000000 -0400
@@ -113,8 +113,7 @@
struct mlx4_cmd_mailbox *mailbox;
int ret = 0;
- if (cur_state < 0 || cur_state >= MLX4_QP_NUM_STATE ||
- new_state < 0 || cur_state >= MLX4_QP_NUM_STATE ||
+ if (cur_state >= MLX4_QP_NUM_STATE || cur_state >= MLX4_QP_NUM_STATE ||
!op[cur_state][new_state])
return -EINVAL;
diff -ru linux-2.6.21-old/drivers/net/netxen/netxen_nic_niu.c linux-2.6.21/drivers/net/netxen/netxen_nic_niu.c
--- linux-2.6.21-old/drivers/net/netxen/netxen_nic_niu.c 2007-05-30 02:52:53.000000000 -0400
+++ linux-2.6.21/drivers/net/netxen/netxen_nic_niu.c 2007-05-30 02:20:02.000000000 -0400
@@ -728,7 +728,7 @@
__u32 mac_cfg0;
u32 port = physical_port[adapter->portnum];
- if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS))
+ if (port > NETXEN_NIU_MAX_GBE_PORTS)
return -EINVAL;
mac_cfg0 = 0;
netxen_gb_soft_reset(mac_cfg0);
@@ -761,7 +761,7 @@
__u32 reg;
u32 port = physical_port[adapter->portnum];
- if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS))
+ if (port > NETXEN_NIU_MAX_GBE_PORTS)
return -EINVAL;
/* save previous contents */
@@ -898,7 +898,7 @@
__u32 reg;
u32 port = physical_port[adapter->portnum];
- if ((port < 0) || (port > NETXEN_NIU_MAX_XG_PORTS))
+ if (port > NETXEN_NIU_MAX_XG_PORTS)
return -EINVAL;
if (netxen_nic_hw_read_wx(adapter,
diff -ru linux-2.6.21-old/drivers/net/tulip/de2104x.c linux-2.6.21/drivers/net/tulip/de2104x.c
--- linux-2.6.21-old/drivers/net/tulip/de2104x.c 2007-05-30 02:52:53.000000000 -0400
+++ linux-2.6.21/drivers/net/tulip/de2104x.c 2007-05-30 02:20:44.000000000 -0400
@@ -785,7 +785,6 @@
de->tx_head = NEXT_TX(entry);
- BUG_ON(TX_BUFFS_AVAIL(de) < 0);
if (TX_BUFFS_AVAIL(de) == 0)
netif_stop_queue(dev);
next reply other threads:[~2007-05-30 8:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-30 7:59 Bill Nottingham [this message]
2007-06-13 19:45 ` Jeff Garzik
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=20070530075902.GA29118@nostromo.devel.redhat.com \
--to=notting@redhat.com \
--cc=jgarzik@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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 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®