PCI: Only declare struct pci_filp_private when HAVE_PCI_MMAP is set
PATCH 1/1 PCI: Only declare struct pci_filp_private when HAVE_PCI_MMAP is set
At the moment, the struct pci_filp_private does not have any other users outside of the drivers/pci/proc.c file, and additionally its also only ever used (alongside all of its users) when the macro HAVE_PCI_MMAP is set.
Thus, enclose struct pci_filp_private in an preprocessor condition so that it's only declared when the HAVE_PCI_MMAP macro is set, which otherwise would be unused should the macro hasn't been set.
--- drivers/pci/proc.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/pci/proc.c +2 -0
@@ -187,10 +187,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)
Signature · 1 line
2.32.0
Bjorn Helgaas
AppliedQuoted 10 lines · Krzysztof Wilczyński
At the moment, the struct
pci_filp_privatedoes not have any other users outside of thedrivers/pci/proc.cfile, and additionally its also only ever used (alongside all of its users) when the macroHAVE_PCI_MMAPis set.Thus, enclose struct
pci_filp_privatein an preprocessor condition so that it's only declared when theHAVE_PCI_MMAPmacro is set, which otherwise would be unused should the macro hasn't been set.Signed-off-by Krzysztof Wilczyński <[email protected]>
Applied to pci/misc for v5.18, thanks!
Quoted 24 lines
--- drivers/pci/proc.c | 2 ++ 1 file changed, 2 insertions(+)drivers/pci/proc.c +2
-0@@ -187,10 +187,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)Signature · 1 line
2.32.0