PCI: Declare pci_filp_private only when HAVE_PCI_MMAP

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2068174
Upstream Status: cb2d0f846139b620ff2d11da15daa0eeb581d1a6

commit cb2d0f846139b620ff2d11da15daa0eeb581d1a6
Author: Krzysztof Wilczyński <kw@linux.com>
Date:   Tue Jul 6 00:31:45 2021 +0000

    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>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
This commit is contained in:
Myron Stowe 2022-05-03 19:40:05 -06:00
parent 31993e2bc1
commit 34cfcb4d7f
1 changed files with 2 additions and 0 deletions

View File

@ -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)