linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: Only declare struct pci_filp_private when HAVE_PCI_MMAP is set
@ 2021-07-06  0:31 Krzysztof Wilczyński
  2022-03-14 18:03 ` Bjorn Helgaas
  0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Wilczyński @ 2021-07-06  0:31 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci

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.

Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
---
 drivers/pci/proc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c
index 9bab07302bbf..3467a8e019f9 100644
--- a/drivers/pci/proc.c
+++ b/drivers/pci/proc.c
@@ -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)
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] PCI: Only declare struct pci_filp_private when HAVE_PCI_MMAP is set
  2021-07-06  0:31 [PATCH] PCI: Only declare struct pci_filp_private when HAVE_PCI_MMAP is set Krzysztof Wilczyński
@ 2022-03-14 18:03 ` Bjorn Helgaas
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2022-03-14 18:03 UTC (permalink / raw)
  To: Krzysztof Wilczyński; +Cc: Bjorn Helgaas, linux-pci

On Tue, Jul 06, 2021 at 12:31:45AM +0000, Krzysztof Wilczyński wrote:
> 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.
> 
> Signed-off-by: Krzysztof Wilczyński <kw@linux.com>

Applied to pci/misc for v5.18, thanks!

> ---
>  drivers/pci/proc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c
> index 9bab07302bbf..3467a8e019f9 100644
> --- a/drivers/pci/proc.c
> +++ b/drivers/pci/proc.c
> @@ -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)
> -- 
> 2.32.0
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-14 18:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-06  0:31 [PATCH] PCI: Only declare struct pci_filp_private when HAVE_PCI_MMAP is set Krzysztof Wilczyński
2022-03-14 18:03 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).