提交 cb2d0f84 编写于 作者: K Krzysztof Wilczyński 提交者: Bjorn Helgaas

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.comSigned-off-by: NKrzysztof Wilczyński <kw@linux.com>
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
上级 602a4eda
...@@ -188,10 +188,12 @@ static ssize_t proc_bus_pci_write(struct file *file, const char __user *buf, ...@@ -188,10 +188,12 @@ static ssize_t proc_bus_pci_write(struct file *file, const char __user *buf,
return nbytes; return nbytes;
} }
#ifdef HAVE_PCI_MMAP
struct pci_filp_private { struct pci_filp_private {
enum pci_mmap_state mmap_state; enum pci_mmap_state mmap_state;
int write_combine; int write_combine;
}; };
#endif /* HAVE_PCI_MMAP */
static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd, static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd,
unsigned long arg) unsigned long arg)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册