summaryrefslogtreecommitdiff
path: root/drivers/pci
diff options
context:
space:
mode:
authorKrzysztof Wilczyński <kw@linux.com>2021-07-06 00:31:45 +0000
committerBjorn Helgaas <bhelgaas@google.com>2022-03-22 11:23:51 -0500
commitcb2d0f846139b620ff2d11da15daa0eeb581d1a6 (patch)
tree7c8856612e420df46a83be22310c4e3b954eae96 /drivers/pci
parent602a4eda68839bb33ca35c54d400e0685bac1d71 (diff)
PCI: Declare pci_filp_private only when HAVE_PCI_MMAP
The struct pci_filp_private has no users outside drivers/pci/proc.c and is only used when HAVE_PCI_MMAP is defined. Wrap the struct pci_filp_private definition itself in #ifdef HAVE_PCI_MMAP. Found by cppcheck: $ cppcheck --enable=all --force drivers/pci/proc.c drivers/pci/proc.c:192:6: style: struct member 'pci_filp_private::write_combine' is never used. [unusedStructMember] Link: https://lore.kernel.org/r/20210706003145.3054881-1-kw@linux.com Signed-off-by: Krzysztof Wilczyński <kw@linux.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/proc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c
index 9c7edec64f7e..1a5b75399aa5 100644
--- a/drivers/pci/proc.c
+++ b/drivers/pci/proc.c
@@ -188,10 +188,12 @@ static ssize_t proc_bus_pci_write(struct file *file, const char __user *buf,
return nbytes;
}
+#ifdef HAVE_PCI_MMAP
struct pci_filp_private {
enum pci_mmap_state mmap_state;
int write_combine;
};
+#endif /* HAVE_PCI_MMAP */
static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)