Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/dev/pci Pull up following revision(s) (requested by m...



details:   https://anonhg.NetBSD.org/src/rev/7b20d7e47340
branches:  netbsd-8
changeset: 453744:7b20d7e47340
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Aug 04 10:59:19 2019 +0000

description:
Pull up following revision(s) (requested by msaitoh in ticket #1317):

        sys/dev/pci/if_wm.c: revision 1.646
        sys/dev/pci/if_wm.c: revision 1.612

Accept IFM_NONE.

 -

Use unsigned to avoid undefined behavior in wm_i82543_mii_sendbits().
Found by kUBSan.

diffstat:

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

diffs (37 lines):

diff -r 250f57625c2c -r 7b20d7e47340 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Thu Aug 01 15:48:15 2019 +0000
+++ b/sys/dev/pci/if_wm.c       Sun Aug 04 10:59:19 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.508.4.34 2019/08/01 13:50:13 martin Exp $  */
+/*     $NetBSD: if_wm.c,v 1.508.4.35 2019/08/04 10:59:19 martin 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.508.4.34 2019/08/01 13:50:13 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.35 2019/08/04 10:59:19 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -10176,6 +10176,9 @@
                case IFM_1000_T:
                        sc->sc_ctrl |= CTRL_SPEED_1000;
                        break;
+               case IFM_NONE:
+                       /* There is no specific setting for IFM_NONE */
+                       break;
                default:
                        panic("wm_gmii_mediachange: bad media 0x%x",
                            ife->ifm_media);
@@ -10219,7 +10222,7 @@
        v &= ~(MDI_IO | MDI_CLK | (CTRL_SWDPIO_MASK << CTRL_SWDPIO_SHIFT));
        v |= MDI_DIR | CTRL_SWDPIO(3);
 
-       for (i = 1 << (nbits - 1); i != 0; i >>= 1) {
+       for (i = __BIT(nbits - 1); i != 0; i >>= 1) {
                if (data & i)
                        v |= MDI_IO;
                else



Home | Main Index | Thread Index | Old Index