Module Name: src
Committed By: riastradh
Date: Wed Aug 13 20:56:21 UTC 2014
Modified Files:
src/sys/external/bsd/drm2/include/linux: pci.h
Log Message:
Fix shifts & masks in Linux pci_read_config_{word,byte}.
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/drm2/include/linux/pci.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/external/bsd/drm2/include/linux/pci.h
diff -u src/sys/external/bsd/drm2/include/linux/pci.h:1.7 src/sys/external/bsd/drm2/include/linux/pci.h:1.8
--- src/sys/external/bsd/drm2/include/linux/pci.h:1.7 Wed Aug 6 13:52:06 2014
+++ src/sys/external/bsd/drm2/include/linux/pci.h Wed Aug 13 20:56:21 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: pci.h,v 1.7 2014/08/06 13:52:06 riastradh Exp $ */
+/* $NetBSD: pci.h,v 1.8 2014/08/13 20:56:21 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -200,7 +200,7 @@ pci_read_config_word(struct pci_dev *pde
{
KASSERT(!ISSET(reg, 1));
*valuep = pci_conf_read(pdev->pd_pa.pa_pc, pdev->pd_pa.pa_tag,
- (reg &~ 3)) >> (8 * (reg & 3));
+ (reg &~ 2)) >> (8 * (reg & 2));
return 0;
}
@@ -208,7 +208,7 @@ static inline int
pci_read_config_byte(struct pci_dev *pdev, int reg, uint8_t *valuep)
{
*valuep = pci_conf_read(pdev->pd_pa.pa_pc, pdev->pd_pa.pa_tag,
- (reg &~ 1)) >> (8 * (reg & 1));
+ (reg &~ 3)) >> (8 * (reg & 3));
return 0;
}