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/2dac53245409
branches:  trunk
changeset: 449119:2dac53245409
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 6e31718034e5 -r 2dac53245409 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