Skip to content

Commit cb2d0f8

Browse files
kwilczynskibjorn-helgaas
authored andcommitted
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>
1 parent 602a4ed commit cb2d0f8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/pci/proc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,12 @@ static ssize_t proc_bus_pci_write(struct file *file, const char __user *buf,
188188
return nbytes;
189189
}
190190

191+
#ifdef HAVE_PCI_MMAP
191192
struct pci_filp_private {
192193
enum pci_mmap_state mmap_state;
193194
int write_combine;
194195
};
196+
#endif /* HAVE_PCI_MMAP */
195197

196198
static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd,
197199
unsigned long arg)

0 commit comments

Comments
 (0)