Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/stand/lib/netif PR/50668: David Binderman: Don...



details:   https://anonhg.NetBSD.org/src/rev/61de0539475e
branches:  trunk
changeset: 342991:61de0539475e
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jan 17 14:57:18 2016 +0000

description:
PR/50668: David Binderman: Don't compare unsigned to -1

diffstat:

 sys/arch/i386/stand/lib/netif/3c90xb.c   |  6 +++---
 sys/arch/i386/stand/lib/netif/etherdrv.h |  3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diffs (44 lines):

diff -r e80f6b904c11 -r 61de0539475e sys/arch/i386/stand/lib/netif/3c90xb.c
--- a/sys/arch/i386/stand/lib/netif/3c90xb.c    Sun Jan 17 14:50:31 2016 +0000
+++ b/sys/arch/i386/stand/lib/netif/3c90xb.c    Sun Jan 17 14:57:18 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: 3c90xb.c,v 1.14 2008/12/14 18:46:33 christos Exp $ */
+/* $NetBSD: 3c90xb.c,v 1.15 2016/01/17 14:57:18 christos Exp $ */
 
 /*
  * Copyright (c) 1999
@@ -291,7 +291,7 @@
        }
        printf("unknown connector\n");
 bad:
-       ether_medium = -1;
+       ether_medium = ETHERMEDIUM_BAD;
 }
 
 int
@@ -346,7 +346,7 @@
                ether_medium = ETHERMEDIUM_MII;
        else {
                ex_probemedia();
-               if (ether_medium < 0)
+               if (ether_medium == ETHERMEDIUM_BAD)
                        return 0;
        }
 
diff -r e80f6b904c11 -r 61de0539475e sys/arch/i386/stand/lib/netif/etherdrv.h
--- a/sys/arch/i386/stand/lib/netif/etherdrv.h  Sun Jan 17 14:50:31 2016 +0000
+++ b/sys/arch/i386/stand/lib/netif/etherdrv.h  Sun Jan 17 14:57:18 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: etherdrv.h,v 1.9 2008/12/14 18:46:33 christos Exp $    */
+/*     $NetBSD: etherdrv.h,v 1.10 2016/01/17 14:57:18 christos Exp $   */
 
 /*
  * Copyright (c) 1996
@@ -32,6 +32,7 @@
 void EtherStop(void);
 
 extern unsigned ether_medium;
+#define ETHERMEDIUM_BAD ((unsigned)-1)
 #define ETHERMEDIUM_BNC 0
 #define ETHERMEDIUM_UTP 1
 #define ETHERMEDIUM_AUI 2



Home | Main Index | Thread Index | Old Index