Skip to contentSkip to conversation

dm: usb.h: Always declare usb func. prototypes when CONFIG_DM_USB=y

PATCH New Hans de Goede 2 participants 6 messages Jun 6, 2015 – Jun 9, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm: usb.h: Always declare usb func. prototypes when CONFIG_DM_USB=y

When CONFIG_DM_USB=y the various usb functions are available regardless of any controller drivers being enabled, so always the usb function prototypes when CONFIG_DM_USB=y.

This fixes compile warnings due to missing prototypes on ARCHs where the ARCH Kconfig always enables CONFIG_DM_USB and various usb drivers.

One could argue that in the case of no controllers CONFIG_DM_USB should not be set, but this problem is typically seen during bringup of boards which do actually have usb controllers.

---
 include/usb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/usb.h +1 -1
index c709ce2..54ad33a 100644
@@ -180,7 +180,7 @@ enum usb_init_type {
 	defined(CONFIG_USB_MUSB_DSPS) || defined(CONFIG_USB_MUSB_AM35X) || \
 	defined(CONFIG_USB_MUSB_OMAP2PLUS) || defined(CONFIG_USB_MUSB_SUNXI) || \
 	defined(CONFIG_USB_XHCI) || defined(CONFIG_USB_DWC2) || \
-	defined(CONFIG_USB_EMUL)
+	defined(CONFIG_USB_EMUL) || defined(CONFIG_DM_USB)
 
 int usb_lowlevel_init(int index, enum usb_init_type init, void **controller);
 int usb_lowlevel_stop(int index);
Signature · 1 line
2.4.2
#1 lore raw

PATCH 1/1 dm: usb.h: Always declare usb func. prototypes when CONFIG_DM_USB=y

Quoted 21 lines · Hans de Goede

When CONFIG_DM_USB=y the various usb functions are available regardless of any controller drivers being enabled, so always the usb function prototypes when CONFIG_DM_USB=y.

This fixes compile warnings due to missing prototypes on ARCHs where the ARCH Kconfig always enables CONFIG_DM_USB and various usb drivers.

One could argue that in the case of no controllers CONFIG_DM_USB should not be set, but this problem is typically seen during bringup of boards which do actually have usb controllers.

---
 include/usb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/usb.h +0 -0
index c709ce2..54ad33a 100644

include/usb.h enum usb_init_type { · line 181

Quoted 2 lines
include/usb.h +0 -0
@@ -180,7 +180,7 @@ enum usb_init_type {
 	defined(CONFIG_USB_MUSB_DSPS) || defined(CONFIG_USB_MUSB_AM35X) || \
 	defined(CONFIG_USB_MUSB_OMAP2PLUS) || defined(CONFIG_USB_MUSB_SUNXI) || 

\

include/usb.h enum usb_init_type { · line 183

Quoted 3 lines
include/usb.h +1 -1
 	defined(CONFIG_USB_XHCI) || defined(CONFIG_USB_DWC2) || \
-	defined(CONFIG_USB_EMUL)
+	defined(CONFIG_USB_EMUL) || defined(CONFIG_DM_USB)

What would happen in case we instead dropped this horrible ifdef altogether, do you think it'd break anything ?

include/usb.h enum usb_init_type { · line 185

Quoted 2 lines
include/usb.h +0 -0
 int usb_lowlevel_init(int index, enum usb_init_type init, void
 **controller); int usb_lowlevel_stop(int index);

Best regards,
Marek Vasut

#2 lore raw

PATCH 1/1 dm: usb.h: Always declare usb func. prototypes when CONFIG_DM_USB=y

Hi,

Quoted 25 lines · Marek Vasut
Quoted 21 lines · Hans de Goede

When CONFIG_DM_USB=y the various usb functions are available regardless of any controller drivers being enabled, so always the usb function prototypes when CONFIG_DM_USB=y.

This fixes compile warnings due to missing prototypes on ARCHs where the ARCH Kconfig always enables CONFIG_DM_USB and various usb drivers.

One could argue that in the case of no controllers CONFIG_DM_USB should not be set, but this problem is typically seen during bringup of boards which do actually have usb controllers.

---
  include/usb.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/usb.h +0 -0
index c709ce2..54ad33a 100644

include/usb.h enum usb_init_type { · line 181

Quoted 2 lines
include/usb.h +0 -0
@@ -180,7 +180,7 @@ enum usb_init_type {
  	defined(CONFIG_USB_MUSB_DSPS) || defined(CONFIG_USB_MUSB_AM35X) || \
  	defined(CONFIG_USB_MUSB_OMAP2PLUS) || defined(CONFIG_USB_MUSB_SUNXI) ||

\

Quoted 6 lines

include/usb.h enum usb_init_type { · line 183

Quoted 3 lines
include/usb.h +1 -1
  	defined(CONFIG_USB_XHCI) || defined(CONFIG_USB_DWC2) || \
-	defined(CONFIG_USB_EMUL)
+	defined(CONFIG_USB_EMUL) || defined(CONFIG_DM_USB)

What would happen in case we instead dropped this horrible ifdef altogether, do you think it'd break anything ?

I've not audited the code, but I believe that it only declares a bunch of function prototypes, so I think that dropping the entire #ifdef is fine.

Regards,

Hans

#3 lore raw

PATCH 1/1 dm: usb.h: Always declare usb func. prototypes when CONFIG_DM_USB=y

Quoted 41 lines · Hans de Goede

Hi,

Quoted 30 lines · Marek Vasut
Quoted 22 lines · Hans de Goede

When CONFIG_DM_USB=y the various usb functions are available regardless of any controller drivers being enabled, so always the usb function prototypes when CONFIG_DM_USB=y.

This fixes compile warnings due to missing prototypes on ARCHs where the ARCH Kconfig always enables CONFIG_DM_USB and various usb drivers.

One could argue that in the case of no controllers CONFIG_DM_USB should not be set, but this problem is typically seen during bringup of boards which do actually have usb controllers.

---

  include/usb.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/usb.h +0 -0
index c709ce2..54ad33a 100644

include/usb.h enum usb_init_type { · line 183

Quoted 4 lines
include/usb.h +0 -0
@@ -180,7 +180,7 @@ enum usb_init_type {
 
  	defined(CONFIG_USB_MUSB_DSPS) || defined(CONFIG_USB_MUSB_AM35X) || \
  	defined(CONFIG_USB_MUSB_OMAP2PLUS) || defined(CONFIG_USB_MUSB_SUNXI)
  	||

\

Quoted 7 lines

include/usb.h enum usb_init_type { · line 183

Quoted 4 lines
include/usb.h +1 -1
  	defined(CONFIG_USB_XHCI) || defined(CONFIG_USB_DWC2) || \
 
-	defined(CONFIG_USB_EMUL)
+	defined(CONFIG_USB_EMUL) || defined(CONFIG_DM_USB)

What would happen in case we instead dropped this horrible ifdef altogether, do you think it'd break anything ?

Quoted 3 lines

I've not audited the code, but I believe that it only declares a bunch of function prototypes, so I think that dropping the entire #ifdef is fine.

So do I :)

Best regards,
Marek Vasut

#4 lore raw

PATCH 1/1 dm: usb.h: Always declare usb func. prototypes when CONFIG_DM_USB=y

Hi,

Quoted 42 lines · Marek Vasut
Quoted 41 lines · Hans de Goede

Hi,

Quoted 37 lines · Marek Vasut
Quoted 22 lines · Hans de Goede

When CONFIG_DM_USB=y the various usb functions are available regardless of any controller drivers being enabled, so always the usb function prototypes when CONFIG_DM_USB=y.

This fixes compile warnings due to missing prototypes on ARCHs where the ARCH Kconfig always enables CONFIG_DM_USB and various usb drivers.

One could argue that in the case of no controllers CONFIG_DM_USB should not be set, but this problem is typically seen during bringup of boards which do actually have usb controllers.

---

   include/usb.h | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
include/usb.h +0 -0
index c709ce2..54ad33a 100644

include/usb.h enum usb_init_type { · line 183

Quoted 4 lines
include/usb.h +0 -0
@@ -180,7 +180,7 @@ enum usb_init_type {
 
   	defined(CONFIG_USB_MUSB_DSPS) || defined(CONFIG_USB_MUSB_AM35X) || \
   	defined(CONFIG_USB_MUSB_OMAP2PLUS) || defined(CONFIG_USB_MUSB_SUNXI)
   	||

\

include/usb.h enum usb_init_type { · line 183

Quoted 4 lines
include/usb.h +1 -1
   	defined(CONFIG_USB_XHCI) || defined(CONFIG_USB_DWC2) || \
 
-	defined(CONFIG_USB_EMUL)
+	defined(CONFIG_USB_EMUL) || defined(CONFIG_DM_USB)

What would happen in case we instead dropped this horrible ifdef altogether, do you think it'd break anything ?

Quoted 5 lines
Quoted 3 lines

I've not audited the code, but I believe that it only declares a bunch of function prototypes, so I think that dropping the entire #ifdef is fine.

So do I :)

I was actually hoping that you would do it :)

Regards,

Hans

#5 lore raw

PATCH 1/1 dm: usb.h: Always declare usb func. prototypes when CONFIG_DM_USB=y

Quoted 25 lines · Hans de Goede

Hi,

Quoted 22 lines · Marek Vasut
Quoted 21 lines · Hans de Goede

Hi,

Quoted 18 lines · Marek Vasut
Quoted 17 lines · Hans de Goede

When CONFIG_DM_USB=y the various usb functions are available regardless of any controller drivers being enabled, so always the usb function prototypes when CONFIG_DM_USB=y.

This fixes compile warnings due to missing prototypes on ARCHs where the ARCH Kconfig always enables CONFIG_DM_USB and various usb drivers.

One could argue that in the case of no controllers CONFIG_DM_USB should not be set, but this problem is typically seen during bringup of boards which do actually have usb controllers.

---

   include/usb.h | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

include/usb.h enum usb_init_type { · line 181

Quoted 7 lines
include/usb.h +0 -0
index c709ce2..54ad33a 100644
@@ -180,7 +180,7 @@ enum usb_init_type {
 
   	defined(CONFIG_USB_MUSB_DSPS) || defined(CONFIG_USB_MUSB_AM35X) 
||
> >>>>    	\ defined(CONFIG_USB_MUSB_OMAP2PLUS) ||
> >>>>    	defined(CONFIG_USB_MUSB_SUNXI)
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines

\

include/usb.h enum usb_init_type { · line 183

Quoted 4 lines
include/usb.h +1 -1
   	defined(CONFIG_USB_XHCI) || defined(CONFIG_USB_DWC2) || \
 
-	defined(CONFIG_USB_EMUL)
+	defined(CONFIG_USB_EMUL) || defined(CONFIG_DM_USB)

What would happen in case we instead dropped this horrible ifdef altogether, do you think it'd break anything ?

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

I've not audited the code, but I believe that it only declares a bunch of function prototypes, so I think that dropping the entire #ifdef is fine.

So do I :)

I was actually hoping that you would do it :)

So V2 is coming ? :)

Best regards,
Marek Vasut