diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2013-07-02 19:27:16 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2013-07-02 19:27:16 +0000 |
commit | a90bb7eb2ab33e50c4c75c107619956f810746e3 (patch) | |
tree | 7c620a894eaebff89e84855780f40723c706404e /sys/dev/usb | |
parent | c833dd7dd152140795451c8f530613e8f22006a6 (diff) |
Rearrange the inequalities.
Pointed out by LLVM.
if_axe.c:1059:29: error: comparison of unsigned expression < 0 is always false
if_smsc.c:1250:28: error: comparison of unsigned expression < 0 is always false
ok jsg@ mikeb@
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/if_axe.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/if_smsc.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c index 839c1f3ed46..50a5a96599f 100644 --- a/sys/dev/usb/if_axe.c +++ b/sys/dev/usb/if_axe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_axe.c,v 1.120 2013/06/03 22:36:15 yuo Exp $ */ +/* $OpenBSD: if_axe.c,v 1.121 2013/07/02 19:27:15 brad Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Jonathan Gray <jsg@openbsd.org> @@ -1056,7 +1056,7 @@ axe_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status) if ((pktlen % 2) != 0) pktlen++; - if ((total_len - pktlen) < 0) + if (total_len < pktlen) total_len = 0; else total_len -= pktlen; diff --git a/sys/dev/usb/if_smsc.c b/sys/dev/usb/if_smsc.c index 5f6ae133ff2..6318b049751 100644 --- a/sys/dev/usb/if_smsc.c +++ b/sys/dev/usb/if_smsc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_smsc.c,v 1.7 2013/04/15 09:23:01 mglocker Exp $ */ +/* $OpenBSD: if_smsc.c,v 1.8 2013/07/02 19:27:15 brad Exp $ */ /* $FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */ /*- * Copyright (c) 2012 @@ -1247,7 +1247,7 @@ smsc_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status) buf += sizeof(rxhdr); - if ((total_len - pktlen) < 0) + if (total_len < pktlen) total_len = 0; else total_len -= pktlen; |