* [PATCH] pci: add pci_clear_master() stub for !CONFIG_PCI
@ 2016-03-08 22:34 Michael Auchter
2016-03-08 23:10 ` Bjorn Helgaas
0 siblings, 1 reply; 4+ messages in thread
From: Michael Auchter @ 2016-03-08 22:34 UTC (permalink / raw)
To: bhelgaas; +Cc: linux-pci, linux-kernel, Michael Auchter
Add a stub for pci_clear_master() for when CONFIG_PCI is not set,
similar to what's done for pci_set_master().
Signed-off-by: Michael Auchter <michael.auchter@ni.com>
---
include/linux/pci.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 2771625..5f684d0 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1425,6 +1425,7 @@ static inline struct pci_dev *pci_get_class(unsigned int class,
#define pci_dev_put(dev) do { } while (0)
static inline void pci_set_master(struct pci_dev *dev) { }
+static inline void pci_clear_master(struct pci_dev *dev) { }
static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; }
static inline void pci_disable_device(struct pci_dev *dev) { }
static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask)
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] pci: add pci_clear_master() stub for !CONFIG_PCI
2016-03-08 22:34 [PATCH] pci: add pci_clear_master() stub for !CONFIG_PCI Michael Auchter
@ 2016-03-08 23:10 ` Bjorn Helgaas
2016-03-09 0:39 ` Michael Auchter
0 siblings, 1 reply; 4+ messages in thread
From: Bjorn Helgaas @ 2016-03-08 23:10 UTC (permalink / raw)
To: Michael Auchter; +Cc: bhelgaas, linux-pci, linux-kernel
Hi Michael,
On Tue, Mar 08, 2016 at 04:34:41PM -0600, Michael Auchter wrote:
> Add a stub for pci_clear_master() for when CONFIG_PCI is not set,
> similar to what's done for pci_set_master().
Does this fix a problem? If so, what is it? Some driver that doesn't
build when CONFIG_PCI is not set?
> Signed-off-by: Michael Auchter <michael.auchter@ni.com>
> ---
> include/linux/pci.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 2771625..5f684d0 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1425,6 +1425,7 @@ static inline struct pci_dev *pci_get_class(unsigned int class,
> #define pci_dev_put(dev) do { } while (0)
>
> static inline void pci_set_master(struct pci_dev *dev) { }
> +static inline void pci_clear_master(struct pci_dev *dev) { }
> static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; }
> static inline void pci_disable_device(struct pci_dev *dev) { }
> static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask)
> --
> 2.1.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pci: add pci_clear_master() stub for !CONFIG_PCI
2016-03-08 23:10 ` Bjorn Helgaas
@ 2016-03-09 0:39 ` Michael Auchter
2016-03-09 16:56 ` Bjorn Helgaas
0 siblings, 1 reply; 4+ messages in thread
From: Michael Auchter @ 2016-03-09 0:39 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: bhelgaas, linux-pci, linux-kernel
On Tue, Mar 08, 2016 at 05:10:17PM -0600, Bjorn Helgaas wrote:
> Hi Michael,
>
> On Tue, Mar 08, 2016 at 04:34:41PM -0600, Michael Auchter wrote:
> > Add a stub for pci_clear_master() for when CONFIG_PCI is not set,
> > similar to what's done for pci_set_master().
>
> Does this fix a problem? If so, what is it? Some driver that doesn't
> build when CONFIG_PCI is not set?
I ran into a build failure caused by this not being defined while
compile testing an out-of-tree driver with various configs. It seemed to
me that the lack of a stub may have just been an oversight from when
pci_clear_master() was added.
It looks like all in-tree users of pci_clear_master() correctly declare
a dependency on PCI via Kconfig, so this doesn't really fix a problem,
just makes pci_clear_master more symmetric with pci_set_master.
Cheers,
Michael
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pci: add pci_clear_master() stub for !CONFIG_PCI
2016-03-09 0:39 ` Michael Auchter
@ 2016-03-09 16:56 ` Bjorn Helgaas
0 siblings, 0 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2016-03-09 16:56 UTC (permalink / raw)
To: Michael Auchter; +Cc: bhelgaas, linux-pci, linux-kernel
On Tue, Mar 08, 2016 at 06:39:56PM -0600, Michael Auchter wrote:
> On Tue, Mar 08, 2016 at 05:10:17PM -0600, Bjorn Helgaas wrote:
> > Hi Michael,
> >
> > On Tue, Mar 08, 2016 at 04:34:41PM -0600, Michael Auchter wrote:
> > > Add a stub for pci_clear_master() for when CONFIG_PCI is not set,
> > > similar to what's done for pci_set_master().
> >
> > Does this fix a problem? If so, what is it? Some driver that doesn't
> > build when CONFIG_PCI is not set?
>
> I ran into a build failure caused by this not being defined while
> compile testing an out-of-tree driver with various configs. It seemed to
> me that the lack of a stub may have just been an oversight from when
> pci_clear_master() was added.
>
> It looks like all in-tree users of pci_clear_master() correctly declare
> a dependency on PCI via Kconfig, so this doesn't really fix a problem,
> just makes pci_clear_master more symmetric with pci_set_master.
We define a lot of empty stubs when CONFIG_PCI is not set. I'm not
sure all of them make sense, so I'm a little hesitant to add more.
If I had time, I think it would be really interesting to turn off
CONFIG_PCI, remove some of the existing stubs, and see what breaks.
Then we could look at the actual code and figure out whether the best
solution is to keep the stubs or to add CONFIG_PCI dependencies, add
CONFIG_PCI #ifdefs, etc.
Bjorn
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-03-09 16:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-08 22:34 [PATCH] pci: add pci_clear_master() stub for !CONFIG_PCI Michael Auchter
2016-03-08 23:10 ` Bjorn Helgaas
2016-03-09 0:39 ` Michael Auchter
2016-03-09 16:56 ` 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).