Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Fix GCC7 "avoid ambiguous 'else'" build error in...



details:   https://anonhg.NetBSD.org/src/rev/89790d045089
branches:  trunk
changeset: 839499:89790d045089
user:      kamil <kamil%NetBSD.org@localhost>
date:      Sat Feb 23 11:41:08 2019 +0000

description:
Fix GCC7 "avoid ambiguous 'else'" build error in if_wm.c

Detected with kUBSan NetBSD/i386 build.

diffstat:

 sys/dev/pci/if_wm.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (52 lines):

diff -r 9286dd35ac85 -r 89790d045089 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Sat Feb 23 11:33:31 2019 +0000
+++ b/sys/dev/pci/if_wm.c       Sat Feb 23 11:41:08 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.627 2019/02/21 08:10:22 knakahara Exp $    */
+/*     $NetBSD: if_wm.c,v 1.628 2019/02/23 11:41:08 kamil Exp $        */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.627 2019/02/21 08:10:22 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.628 2019/02/23 11:41:08 kamil Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -8988,13 +8988,14 @@
        /* Link status changed */
        status = CSR_READ(sc, WMREG_STATUS);
        link = status & STATUS_LU;
-       if (link)
+       if (link) {
                DPRINTF(WM_DEBUG_LINK, ("%s: LINK: LSC -> up %s\n",
                        device_xname(dev),
                        (status & STATUS_FD) ? "FDX" : "HDX"));
-       else
+       } else {
                DPRINTF(WM_DEBUG_LINK, ("%s: LINK: LSC -> down\n",
                        device_xname(dev)));
+       }
        if ((sc->sc_type == WM_T_ICH8) && (link == false))
                wm_gig_downshift_workaround_ich8lan(sc);
 
@@ -12010,13 +12011,14 @@
                        __func__));
                CSR_WRITE(sc, WMREG_TXCW, sc->sc_txcw);
                CSR_WRITE(sc, WMREG_CTRL, (ctrl & ~CTRL_SLU));
-       } else if (signal && ((rxcw & RXCW_C) != 0))
+       } else if (signal && ((rxcw & RXCW_C) != 0)) {
                DPRINTF(WM_DEBUG_LINK, ("%s: %s: /C/",
                        device_xname(sc->sc_dev), __func__));
-       else
+       } else {
                DPRINTF(WM_DEBUG_LINK, ("%s: %s: linkup %08x,%08x,%08x\n",
                        device_xname(sc->sc_dev), __func__, rxcw, ctrl,
                        status));
+       }
 
        return 0;
 }



Home | Main Index | Thread Index | Old Index