Module Name:    src
Committed By:   msaitoh
Date:           Fri Jun 14 03:15:04 UTC 2024

Modified Files:
        src/sys/dev/pci: pcireg.h

Log Message:
PCI_CLASS_MASK: Use unsigned to avoid undefined behavior. Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.170 -r1.171 src/sys/dev/pci/pcireg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcireg.h
diff -u src/sys/dev/pci/pcireg.h:1.170 src/sys/dev/pci/pcireg.h:1.171
--- src/sys/dev/pci/pcireg.h:1.170	Fri Apr 19 21:24:00 2024
+++ src/sys/dev/pci/pcireg.h	Fri Jun 14 03:15:04 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcireg.h,v 1.170 2024/04/19 21:24:00 andvar Exp $	*/
+/*	$NetBSD: pcireg.h,v 1.171 2024/06/14 03:15:04 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -135,7 +135,7 @@ typedef u_int8_t pci_interface_t;
 typedef u_int8_t pci_revision_t;
 
 #define	PCI_CLASS_SHIFT			24
-#define	PCI_CLASS_MASK			0xff
+#define	PCI_CLASS_MASK			0xffU
 #define	PCI_CLASS(cr) \
 	    (((cr) >> PCI_CLASS_SHIFT) & PCI_CLASS_MASK)
 

Reply via email to