From cb2d0f846139b620ff2d11da15daa0eeb581d1a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= Date: Tue, 6 Jul 2021 00:31:45 +0000 Subject: [PATCH] PCI: Declare pci_filp_private only when HAVE_PCI_MMAP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Bjorn Helgaas --- drivers/pci/proc.c | 2 ++ 1 file changed, 2 insertions(+) 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)