diff mbox series

usb: host: fix implicit declaration error

Message ID 20200118235828.14131-1-ansuelsmth@gmail.com (mailing list archive)
State New, archived
Headers show
Series usb: host: fix implicit declaration error | expand

Commit Message

Christian Marangi Jan. 18, 2020, 11:58 p.m. UTC
If USB_PCI is not enabled, this error is triggered.
drivers/usb/host/ehci-pci.c:152:7:
error: implicit declaration of function 'usb_amd_quirk_pll_check';
  152 |   if (usb_amd_quirk_pll_check())
      |       ^~~~~~~~~~~~~~~~~~~~~~~
      |       usb_amd_quirk_pll_enable

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
---
 drivers/usb/host/pci-quirks.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Greg KH Jan. 19, 2020, 12:53 p.m. UTC | #1
On Sun, Jan 19, 2020 at 12:58:28AM +0100, Ansuel Smith wrote:
> If USB_PCI is not enabled, this error is triggered.
> drivers/usb/host/ehci-pci.c:152:7:
> error: implicit declaration of function 'usb_amd_quirk_pll_check';
>   152 |   if (usb_amd_quirk_pll_check())
>       |       ^~~~~~~~~~~~~~~~~~~~~~~
>       |       usb_amd_quirk_pll_enable
> 
> Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>

Is this a new issue?  What commit caused this problem?

thanks,

greg k-h
Christian Marangi Jan. 19, 2020, 1:19 p.m. UTC | #2
> On Sun, Jan 19, 2020 at 12:58:28AM +0100, Ansuel Smith wrote:
> > If USB_PCI is not enabled, this error is triggered.
> > drivers/usb/host/ehci-pci.c:152:7:
> > error: implicit declaration of function 'usb_amd_quirk_pll_check';
> >   152 |   if (usb_amd_quirk_pll_check())
> >       |       ^~~~~~~~~~~~~~~~~~~~~~~
> >       |       usb_amd_quirk_pll_enable
> >
> > Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
> 
> Is this a new issue?  What commit caused this problem?
> 
> thanks,
> 
> greg k-h

Looks like this is caused by 4fbb8aa75836c3361987f431d9451aecc1830bdd
and ad93562bdeecdded7d02eaaaf1aa5705ab57b1b7.
Looks like it was never added to the header file else condition.
Alan Stern Jan. 19, 2020, 3:45 p.m. UTC | #3
On Sun, 19 Jan 2020, Ansuel Smith wrote:

> If USB_PCI is not enabled, this error is triggered.
> drivers/usb/host/ehci-pci.c:152:7:
> error: implicit declaration of function 'usb_amd_quirk_pll_check';
>   152 |   if (usb_amd_quirk_pll_check())
>       |       ^~~~~~~~~~~~~~~~~~~~~~~
>       |       usb_amd_quirk_pll_enable
> 
> Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>

I'm a little confused by this.  ehci-pci.c doesn't get compiled 
unless CONFIG_USB_EHCI_PCI is set, and that symbol depends on 
CONFIG_USB_PCI.  So how can this situation ever occur?

Alan Stern
Greg KH Jan. 22, 2020, 7:01 a.m. UTC | #4
On Sun, Jan 19, 2020 at 02:19:45PM +0100, ansuelsmth@gmail.com wrote:
> > On Sun, Jan 19, 2020 at 12:58:28AM +0100, Ansuel Smith wrote:
> > > If USB_PCI is not enabled, this error is triggered.
> > > drivers/usb/host/ehci-pci.c:152:7:
> > > error: implicit declaration of function 'usb_amd_quirk_pll_check';
> > >   152 |   if (usb_amd_quirk_pll_check())
> > >       |       ^~~~~~~~~~~~~~~~~~~~~~~
> > >       |       usb_amd_quirk_pll_enable
> > >
> > > Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
> > 
> > Is this a new issue?  What commit caused this problem?
> > 
> > thanks,
> > 
> > greg k-h
> 
> Looks like this is caused by 4fbb8aa75836c3361987f431d9451aecc1830bdd
> and ad93562bdeecdded7d02eaaaf1aa5705ab57b1b7.
> Looks like it was never added to the header file else condition.
> 

So this has been a problem since 2011?  What config actually causes this
build problem to occur?

thanks,

greg k-h
diff mbox series

Patch

diff --git a/drivers/usb/host/pci-quirks.h b/drivers/usb/host/pci-quirks.h
index e729de21f..78dd0fce2 100644
--- a/drivers/usb/host/pci-quirks.h
+++ b/drivers/usb/host/pci-quirks.h
@@ -29,6 +29,10 @@  static inline bool usb_amd_pt_check_port(struct device *device, int port)
 {
 	return false;
 }
+static inline bool usb_amd_quirk_pll_check(void)
+{
+	return false;
+}
 #endif  /* CONFIG_USB_PCI */
 
 #endif  /*  __LINUX_USB_PCI_QUIRKS_H  */