Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/dev Pull up following revision(s) (requested by msait...



details:   https://anonhg.NetBSD.org/src/rev/55f79984c4fe
branches:  netbsd-9
changeset: 843831:55f79984c4fe
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Jan 31 11:14:50 2020 +0000

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

        sys/dev/pci/if_bce.c: revision 1.53
        sys/dev/pci/pccbbreg.h: revision 1.16
        sys/dev/ic/rt2860.c: revision 1.34
        sys/dev/pci/if_alc.c: revision 1.45
        sys/dev/pci/if_mcx.c: revision 1.5
        sys/dev/pci/if_pcn.c: revision 1.72
        sys/dev/pci/if_ale.c: revision 1.37
        sys/dev/pci/if_age.c: revision 1.65
        sys/dev/ieee1394/fwohcireg.h: revision 1.20
        sys/dev/ieee1394/fwohci.c: revision 1.143
        sys/dev/ieee1394/firewire.c: revision 1.49
        sys/dev/ic/am79900reg.h: revision 1.10

 Use unsigned to avoid undefined behavior. Found by kUBSan.

diffstat:

 sys/dev/ic/am79900reg.h      |   6 +++---
 sys/dev/ic/rt2860.c          |   8 ++++----
 sys/dev/ieee1394/firewire.c  |   8 ++++----
 sys/dev/ieee1394/fwohci.c    |  14 +++++++-------
 sys/dev/ieee1394/fwohcireg.h |   8 ++++----
 sys/dev/pci/if_age.c         |   6 +++---
 sys/dev/pci/if_alc.c         |   4 ++--
 sys/dev/pci/if_ale.c         |   6 +++---
 sys/dev/pci/if_bce.c         |   6 +++---
 sys/dev/pci/if_mcx.c         |  12 ++++++------
 sys/dev/pci/if_pcn.c         |   9 +++++----
 sys/dev/pci/pccbbreg.h       |   4 ++--
 12 files changed, 46 insertions(+), 45 deletions(-)

diffs (truncated from 398 to 300 lines):

diff -r 19783533394e -r 55f79984c4fe sys/dev/ic/am79900reg.h
--- a/sys/dev/ic/am79900reg.h   Fri Jan 31 11:07:43 2020 +0000
+++ b/sys/dev/ic/am79900reg.h   Fri Jan 31 11:14:50 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: am79900reg.h,v 1.9 2008/04/28 20:23:49 martin Exp $    */
+/*     $NetBSD: am79900reg.h,v 1.9.94.1 2020/01/31 11:14:51 martin Exp $       */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -96,7 +96,7 @@
 };
 
 /* Receive message descriptor 1 (rmd1_bits) */
-#define        LE_R1_OWN       (1<<31)         /* LANCE owns the packet */
+#define        LE_R1_OWN       (1U<<31)        /* LANCE owns the packet */
 #define        LE_R1_ERR       (1<<30)         /* error summary */
 #define        LE_R1_FRAM      (1<<29)         /* framing error */
 #define        LE_R1_OFLO      (1<<28)         /* overflow error */
@@ -111,7 +111,7 @@
     "\20\40OWN\37ERR\36FRAM\35OFLO\34CRC\33BUFF\32STP\31ENP"
 
 /* Transmit message descriptor 1 (tmd1_bits) */
-#define        LE_T1_OWN       (1<<31)         /* LANCE owns the packet */
+#define        LE_T1_OWN       (1U<<31)        /* LANCE owns the packet */
 #define        LE_T1_ERR       (1<<30)         /* error summary */
 #define        LE_T1_ADD_FCS   (1<<29)         /* add FCS (PCnet-PCI) */
 #define        LE_T1_NO_FCS    (1<<29)         /* no FCS (ILACC) */
diff -r 19783533394e -r 55f79984c4fe sys/dev/ic/rt2860.c
--- a/sys/dev/ic/rt2860.c       Fri Jan 31 11:07:43 2020 +0000
+++ b/sys/dev/ic/rt2860.c       Fri Jan 31 11:14:50 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rt2860.c,v 1.33 2018/09/03 16:29:31 riastradh Exp $    */
+/*     $NetBSD: rt2860.c,v 1.33.4.1 2020/01/31 11:14:51 martin Exp $   */
 /*     $OpenBSD: rt2860.c,v 1.90 2016/04/13 10:49:26 mpi Exp $ */
 /*     $FreeBSD: head/sys/dev/ral/rt2860.c 306591 2016-10-02 20:35:55Z avos $ */
 
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rt2860.c,v 1.33 2018/09/03 16:29:31 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rt2860.c,v 1.33.4.1 2020/01/31 11:14:51 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/sockio.h>
@@ -2233,7 +2233,7 @@
 rt2860_enable_mrr(struct rt2860_softc *sc)
 {
 #define CCK(mcs)       (mcs)
-#define OFDM(mcs)      (1 << 3 | (mcs))
+#define OFDM(mcs)      (1U << 3 | (mcs))
        RAL_WRITE(sc, RT2860_LG_FBK_CFG0,
            OFDM(6) << 28 |     /* 54->48 */
            OFDM(5) << 24 |     /* 48->36 */
@@ -3294,7 +3294,7 @@
                        b4 = 0;
                else if (b4 > 0xf)
                        b4 = 0xf;
-               b32 = b32 >> 4 | b4 << 28;
+               b32 = b32 >> 4 | (uint32_t)b4 << 28;
        }
        return b32;
 }
diff -r 19783533394e -r 55f79984c4fe sys/dev/ieee1394/firewire.c
--- a/sys/dev/ieee1394/firewire.c       Fri Jan 31 11:07:43 2020 +0000
+++ b/sys/dev/ieee1394/firewire.c       Fri Jan 31 11:14:50 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: firewire.c,v 1.48 2018/09/03 16:29:31 riastradh Exp $  */
+/*     $NetBSD: firewire.c,v 1.48.4.1 2020/01/31 11:14:51 martin Exp $ */
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: firewire.c,v 1.48 2018/09/03 16:29:31 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: firewire.c,v 1.48.4.1 2020/01/31 11:14:51 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -1407,12 +1407,12 @@
        CSRARC(fc, BANDWIDTH_AV) = 4915;
        CSRARC(fc, CHANNELS_AV_HI) = 0xffffffff;
        CSRARC(fc, CHANNELS_AV_LO) = 0xffffffff;
-       CSRARC(fc, IP_CHANNELS) = (1 << 31);
+       CSRARC(fc, IP_CHANNELS) = (1U << 31);
 
        CSRARC(fc, CONF_ROM) = 0x04 << 24;
        CSRARC(fc, CONF_ROM + 4) = 0x31333934; /* means strings 1394 */
        CSRARC(fc, CONF_ROM + 8) =
-           1 << 31 | 1 << 30 | 1 << 29 | 1 << 28 | 0xff << 16 | 0x09 << 8;
+           1U << 31 | 1 << 30 | 1 << 29 | 1 << 28 | 0xff << 16 | 0x09 << 8;
        CSRARC(fc, CONF_ROM + 0xc) = 0;
 
 /* DV depend CSRs see blue book */
diff -r 19783533394e -r 55f79984c4fe sys/dev/ieee1394/fwohci.c
--- a/sys/dev/ieee1394/fwohci.c Fri Jan 31 11:07:43 2020 +0000
+++ b/sys/dev/ieee1394/fwohci.c Fri Jan 31 11:14:50 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fwohci.c,v 1.142.2.1 2019/11/27 14:03:14 martin Exp $  */
+/*     $NetBSD: fwohci.c,v 1.142.2.2 2020/01/31 11:14:51 martin Exp $  */
 
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  *
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fwohci.c,v 1.142.2.1 2019/11/27 14:03:14 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fwohci.c,v 1.142.2.2 2020/01/31 11:14:51 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -224,7 +224,7 @@
 #define        OHCI_ATRETRY            0x008
 #define        OHCI_CROMHDR            0x018
 #define        OHCI_BUS_OPT            0x020
-#define        OHCI_BUSIRMC            (1 << 31)
+#define        OHCI_BUSIRMC            (1U << 31)
 #define        OHCI_BUSCMC             (1 << 30)
 #define        OHCI_BUSISC             (1 << 29)
 #define        OHCI_BUSBMC             (1 << 28)
@@ -250,7 +250,7 @@
 
 #define        OHCI_SID_BUF            0x064
 #define        OHCI_SID_CNT            0x068
-#define OHCI_SID_ERR           (1 << 31)
+#define OHCI_SID_ERR           (1U << 31)
 #define OHCI_SID_CNT_MASK      0xffc
 
 #define        OHCI_IT_STAT            0x090
@@ -752,7 +752,7 @@
        OWRITE(sc, OHCI_CSR_DATA, node);
        OWRITE(sc, OHCI_CSR_COMP, 0x3f);
        OWRITE(sc, OHCI_CSR_CONT, OHCI_BUS_MANAGER_ID);
-       for (i = 0; !(OREAD(sc, OHCI_CSR_CONT) & (1<<31)) && (i < 1000); i++)
+       for (i = 0; !(OREAD(sc, OHCI_CSR_CONT) & (1U <<31)) && (i < 1000); i++)
                DELAY(10);
        bm = OREAD(sc, OHCI_CSR_DATA);
        if ((bm & 0x3f) == 0x3f)
@@ -1296,7 +1296,7 @@
        /* AT Retries */
        OWRITE(sc, FWOHCI_RETRY,
            /* CycleLimit   PhyRespRetries ATRespRetries ATReqRetries */
-           (0xffff << 16) | (0x0f << 8) | (0x0f << 4) | 0x0f);
+           (0xffffU << 16) | (0x0f << 8) | (0x0f << 4) | 0x0f);
 
        sc->atrq.top = STAILQ_FIRST(&sc->atrq.db_trq);
        sc->atrs.top = STAILQ_FIRST(&sc->atrs.db_trq);
@@ -2013,7 +2013,7 @@
                OWRITE(sc, FWOHCI_INTMASK, OHCI_INT_PHY_BUS_R);
 
                /* Allow async. request to us */
-               OWRITE(sc, OHCI_AREQHI, 1 << 31);
+               OWRITE(sc, OHCI_AREQHI, 1U << 31);
                if (firewire_phydma_enable) {
                        /* allow from all nodes */
                        OWRITE(sc, OHCI_PREQHI, 0x7fffffff);
diff -r 19783533394e -r 55f79984c4fe sys/dev/ieee1394/fwohcireg.h
--- a/sys/dev/ieee1394/fwohcireg.h      Fri Jan 31 11:07:43 2020 +0000
+++ b/sys/dev/ieee1394/fwohcireg.h      Fri Jan 31 11:14:50 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fwohcireg.h,v 1.19 2018/03/31 14:50:45 sevan Exp $     */
+/*     $NetBSD: fwohcireg.h,v 1.19.8.1 2020/01/31 11:14:51 martin Exp $        */
 
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
@@ -285,13 +285,13 @@
        fwohcireg_t     link_cntl_clr;  /* Chip control clear 0xe4*/
 #define FWOHCI_NODEID  0xe8
        fwohcireg_t     node;           /* Node ID 0xe8 */
-#define        OHCI_NODE_VALID (1 << 31)
+#define        OHCI_NODE_VALID (1U << 31)
 #define        OHCI_NODE_ROOT  (1 << 30)
 
 #define        OHCI_ASYSRCBUS  1
 
        fwohcireg_t     phy_access;     /* PHY cntl 0xec */
-#define        PHYDEV_RDDONE           (1<<31)
+#define        PHYDEV_RDDONE           (1U<<31)
 #define        PHYDEV_RDCMD            (1<<15)
 #define        PHYDEV_WRCMD            (1<<14)
 #define        PHYDEV_REGADDR          8
@@ -442,7 +442,7 @@
 #define OHCI_INT_ERR           (0x1 << 24)
 #define OHCI_INT_CYC_LONG      (0x1 << 25)
 #define OHCI_INT_PHY_REG       (0x1 << 26)
-#define OHCI_INT_EN            (0x1 << 31)
+#define OHCI_INT_EN            (0x1U << 31)
 
 #define IP_CHANNELS            0x0234
 #define FWOHCI_MAXREC          2048
diff -r 19783533394e -r 55f79984c4fe sys/dev/pci/if_age.c
--- a/sys/dev/pci/if_age.c      Fri Jan 31 11:07:43 2020 +0000
+++ b/sys/dev/pci/if_age.c      Fri Jan 31 11:14:50 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_age.c,v 1.60.2.4 2019/11/26 08:20:47 martin Exp $ */
+/*     $NetBSD: if_age.c,v 1.60.2.5 2020/01/31 11:14:50 martin Exp $ */
 /*     $OpenBSD: if_age.c,v 1.1 2009/01/16 05:00:34 kevlo Exp $        */
 
 /*-
@@ -31,7 +31,7 @@
 /* Driver for Attansic Technology Corp. L1 Gigabit Ethernet. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.60.2.4 2019/11/26 08:20:47 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.60.2.5 2020/01/31 11:14:50 martin Exp $");
 
 #include "vlan.h"
 
@@ -2291,7 +2291,7 @@
                        goto update;
                }
                crc = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN);
-               mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
+               mchash[crc >> 31] |= 1U << ((crc >> 26) & 0x1f);
                ETHER_NEXT_MULTI(step, enm);
        }
        ETHER_UNLOCK(ec);
diff -r 19783533394e -r 55f79984c4fe sys/dev/pci/if_alc.c
--- a/sys/dev/pci/if_alc.c      Fri Jan 31 11:07:43 2020 +0000
+++ b/sys/dev/pci/if_alc.c      Fri Jan 31 11:14:50 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_alc.c,v 1.38.2.3 2019/11/26 08:20:47 martin Exp $   */
+/*     $NetBSD: if_alc.c,v 1.38.2.4 2020/01/31 11:14:50 martin Exp $   */
 /*     $OpenBSD: if_alc.c,v 1.1 2009/08/08 09:31:13 kevlo Exp $        */
 /*-
  * Copyright (c) 2009, Pyun YongHyeon <yongari%FreeBSD.org@localhost>
@@ -3459,7 +3459,7 @@
                        goto update;
                }
                crc = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN);
-               mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
+               mchash[crc >> 31] |= 1U << ((crc >> 26) & 0x1f);
                ETHER_NEXT_MULTI(step, enm);
        }
        ETHER_UNLOCK(ec);
diff -r 19783533394e -r 55f79984c4fe sys/dev/pci/if_ale.c
--- a/sys/dev/pci/if_ale.c      Fri Jan 31 11:07:43 2020 +0000
+++ b/sys/dev/pci/if_ale.c      Fri Jan 31 11:14:50 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ale.c,v 1.33.2.2 2019/11/26 08:20:47 martin Exp $   */
+/*     $NetBSD: if_ale.c,v 1.33.2.3 2020/01/31 11:14:50 martin Exp $   */
 
 /*-
  * Copyright (c) 2008, Pyun YongHyeon <yongari%FreeBSD.org@localhost>
@@ -32,7 +32,7 @@
 /* Driver for Atheros AR8121/AR8113/AR8114 PCIe Ethernet. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.33.2.2 2019/11/26 08:20:47 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.33.2.3 2020/01/31 11:14:50 martin Exp $");
 
 #include "vlan.h"
 
@@ -2012,7 +2012,7 @@
                        goto update;
                }
                crc = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN);
-               mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
+               mchash[crc >> 31] |= 1U << ((crc >> 26) & 0x1f);
                ETHER_NEXT_MULTI(step, enm);
        }
        ETHER_UNLOCK(ec);
diff -r 19783533394e -r 55f79984c4fe sys/dev/pci/if_bce.c
--- a/sys/dev/pci/if_bce.c      Fri Jan 31 11:07:43 2020 +0000
+++ b/sys/dev/pci/if_bce.c      Fri Jan 31 11:14:50 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bce.c,v 1.52.2.1 2019/10/23 19:38:52 martin Exp $        */
+/* $NetBSD: if_bce.c,v 1.52.2.2 2020/01/31 11:14:50 martin Exp $        */
 
 /*
  * Copyright (c) 2003 Clifford Wright. All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.52.2.1 2019/10/23 19:38:52 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.52.2.2 2020/01/31 11:14:50 martin Exp $");
 
 #include "vlan.h"
 
@@ -1015,7 +1015,7 @@
        uint32_t        rval;
 
        bus_space_write_4(sc->bce_btag, sc->bce_bhandle, BCE_FILT_LOW,
-           mac[2] << 24 | mac[3] << 16 | mac[4] << 8 | mac[5]);
+           (uint32_t)mac[2] << 24 | mac[3] << 16 | mac[4] << 8 | mac[5]);
        bus_space_write_4(sc->bce_btag, sc->bce_bhandle, BCE_FILT_HI,
            mac[0] << 8 | mac[1] | 0x10000);    /* MAGIC */
        bus_space_write_4(sc->bce_btag, sc->bce_bhandle, BCE_FILT_CTL,
diff -r 19783533394e -r 55f79984c4fe sys/dev/pci/if_mcx.c
--- a/sys/dev/pci/if_mcx.c      Fri Jan 31 11:07:43 2020 +0000
+++ b/sys/dev/pci/if_mcx.c      Fri Jan 31 11:14:50 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_mcx.c,v 1.1.2.7 2020/01/26 11:17:11 martin Exp $ */
+/*     $NetBSD: if_mcx.c,v 1.1.2.8 2020/01/31 11:14:50 martin Exp $ */
 /*     $OpenBSD: if_mcx.c,v 1.33 2019/09/12 04:23:59 jmatthew Exp $ */
 



Home | Main Index | Thread Index | Old Index