git: ed5600f5329f - main - LinuxKPI: pci.h make pci_dev argument const for pci_{read,write}_config*()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 25 Oct 2021 20:20:23 UTC
The branch main has been updated by bz:
URL: https://cgit.FreeBSD.org/src/commit/?id=ed5600f5329fad8b167bed0a5ae8a5f60d12258e
commit ed5600f5329fad8b167bed0a5ae8a5f60d12258e
Author: Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2021-10-25 17:06:09 +0000
Commit: Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2021-10-25 20:17:56 +0000
LinuxKPI: pci.h make pci_dev argument const for pci_{read,write}_config*()
Make the struct pci_dev argument to the pci_{read,write}_config*()
functions "const" to match the Linux definition as some drivers
try to pass in a const argument which we currently fail to honor.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D32644
---
sys/compat/linuxkpi/common/include/linux/pci.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h
index 2bac82de2af5..5903a402c52e 100644
--- a/sys/compat/linuxkpi/common/include/linux/pci.h
+++ b/sys/compat/linuxkpi/common/include/linux/pci.h
@@ -692,7 +692,7 @@ pci_disable_link_state(struct pci_dev *pdev, uint32_t flags)
}
static inline int
-pci_read_config_byte(struct pci_dev *pdev, int where, u8 *val)
+pci_read_config_byte(const struct pci_dev *pdev, int where, u8 *val)
{
*val = (u8)pci_read_config(pdev->dev.bsddev, where, 1);
@@ -700,7 +700,7 @@ pci_read_config_byte(struct pci_dev *pdev, int where, u8 *val)
}
static inline int
-pci_read_config_word(struct pci_dev *pdev, int where, u16 *val)
+pci_read_config_word(const struct pci_dev *pdev, int where, u16 *val)
{
*val = (u16)pci_read_config(pdev->dev.bsddev, where, 2);
@@ -708,7 +708,7 @@ pci_read_config_word(struct pci_dev *pdev, int where, u16 *val)
}
static inline int
-pci_read_config_dword(struct pci_dev *pdev, int where, u32 *val)
+pci_read_config_dword(const struct pci_dev *pdev, int where, u32 *val)
{
*val = (u32)pci_read_config(pdev->dev.bsddev, where, 4);
@@ -716,7 +716,7 @@ pci_read_config_dword(struct pci_dev *pdev, int where, u32 *val)
}
static inline int
-pci_write_config_byte(struct pci_dev *pdev, int where, u8 val)
+pci_write_config_byte(const struct pci_dev *pdev, int where, u8 val)
{
pci_write_config(pdev->dev.bsddev, where, val, 1);
@@ -724,7 +724,7 @@ pci_write_config_byte(struct pci_dev *pdev, int where, u8 val)
}
static inline int
-pci_write_config_word(struct pci_dev *pdev, int where, u16 val)
+pci_write_config_word(const struct pci_dev *pdev, int where, u16 val)
{
pci_write_config(pdev->dev.bsddev, where, val, 2);
@@ -732,7 +732,7 @@ pci_write_config_word(struct pci_dev *pdev, int where, u16 val)
}
static inline int
-pci_write_config_dword(struct pci_dev *pdev, int where, u32 val)
+pci_write_config_dword(const struct pci_dev *pdev, int where, u32 val)
{
pci_write_config(pdev->dev.bsddev, where, val, 4);