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.
This commit is contained in:
jakllsch 2021-05-15 13:00:45 +00:00
parent eff5a2aac8
commit 40cc624231
1 changed files with 3 additions and 3 deletions

View File

@ -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)