Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Change PCI_VENDOR_MASK and PCI_PRODUCT_MASK to u...



details:   https://anonhg.NetBSD.org/src/rev/ef10ae897a3a
branches:  trunk
changeset: 379158:ef10ae897a3a
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Sat May 15 13:00:45 2021 +0000

description:
Change PCI_VENDOR_MASK and PCI_PRODUCT_MASK to unsigned values, to prevent
sign extension of product ID when shifted up into place in PCI_ID_CODE()

Should fix PR 56176.

diffstat:

 sys/dev/pci/pcireg.h |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (24 lines):

diff -r 2ed8053d007e -r ef10ae897a3a sys/dev/pci/pcireg.h
--- a/sys/dev/pci/pcireg.h      Sat May 15 11:39:20 2021 +0000
+++ b/sys/dev/pci/pcireg.h      Sat May 15 13:00:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pcireg.h,v 1.153 2020/12/28 13:12:24 skrll Exp $       */
+/*     $NetBSD: pcireg.h,v 1.154 2021/05/15 13:00:45 jakllsch Exp $    */
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -54,12 +54,12 @@ typedef u_int16_t pci_vendor_id_t;
 typedef u_int16_t pci_product_id_t;
 
 #define        PCI_VENDOR_SHIFT                0
-#define        PCI_VENDOR_MASK                 0xffff
+#define        PCI_VENDOR_MASK                 0xffffU
 #define        PCI_VENDOR(id) \
            (((id) >> PCI_VENDOR_SHIFT) & PCI_VENDOR_MASK)
 
 #define        PCI_PRODUCT_SHIFT               16
-#define        PCI_PRODUCT_MASK                0xffff
+#define        PCI_PRODUCT_MASK                0xffffU
 #define        PCI_PRODUCT(id) \
            (((id) >> PCI_PRODUCT_SHIFT) & PCI_PRODUCT_MASK)
 



Home | Main Index | Thread Index | Old Index