Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Krzysztof Wilczyński and committed by
Bjorn Helgaas
cb2d0f84 602a4eda

+2
+2
drivers/pci/proc.c
··· 188 188 return nbytes; 189 189 } 190 190 191 + #ifdef HAVE_PCI_MMAP 191 192 struct pci_filp_private { 192 193 enum pci_mmap_state mmap_state; 193 194 int write_combine; 194 195 }; 196 + #endif /* HAVE_PCI_MMAP */ 195 197 196 198 static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd, 197 199 unsigned long arg)