Skip to contentSkip to conversation

usb: musb: tweak musb_read_fifo() to avoid unused warnings

PATCH In review Bryan Wu 5 participants 10 messages Feb 6, 2009 – Feb 12, 2009

Subsystems (2)
lore
Share & tools
lore

Bryan Wu

author
#0 lore raw

PATCH 1/1 usb: musb: tweak musb_read_fifo() to avoid unused warnings

From: Mike Frysinger <[email protected]>

---
 drivers/usb/musb/blackfin.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
drivers/usb/musb/blackfin.c +5 -4
index 7861348..0ebb19d 100644
@@ -54,13 +54,11 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src)
 void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
 {
 	void __iomem *fifo = hw_ep->fifo;
+
+#ifdef CONFIG_BF52x
 	u8 epnum = hw_ep->epnum;
 	u16 dma_reg = 0;
 
-	DBG(4, "%cX ep%d fifo %p count %d buf %p\n",
-			'R', hw_ep->epnum, fifo, len, dst);
-
-#ifdef CONFIG_BF52x
 	invalidate_dcache_range((unsigned int)dst,
 		(unsigned int)(dst + len));
 
@@ -103,6 +101,9 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
 			len & 0x01 ? (len >> 1) + 1 : len >> 1);
 #endif
 
+	DBG(4, "%cX ep%d fifo %p count %d buf %p\n",
+			'R', hw_ep->epnum, fifo, len, dst);
+
 	dump_fifo_data(dst, len);
 }
 
Signature · 1 line
1.5.6.3
#1 lore raw
Quoted 1 line · Bryan Wu

From: Mike Frysinger <[email protected]>

I'd like to get a patch body here.

Quoted 11 lines
---
 drivers/usb/musb/blackfin.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
drivers/usb/musb/blackfin.c +0 -0
index 7861348..0ebb19d 100644

drivers/usb/musb/blackfin.c void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src) · line 60

Quoted 7 lines
drivers/usb/musb/blackfin.c +2 -0
@@ -54,13 +54,11 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src)
 void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
 {
 	void __iomem *fifo = hw_ep->fifo;
+
+#ifdef CONFIG_BF52x
 	u8 epnum = hw_ep->epnum;
 	u16 dma_reg = 0;

Is this patch avoiding a warning about these variables being unused ?

Would be nice to get this info to the patch body ;-)

otherwise, looks fine.

Signature · 1 line
balbi
#2 lore raw
Quoted 26 lines · Felipe Balbi
Quoted 1 line · Bryan Wu

From: Mike Frysinger <[email protected]>

I'd like to get a patch body here.

Quoted 11 lines
---
 drivers/usb/musb/blackfin.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
drivers/usb/musb/blackfin.c +0 -0
index 7861348..0ebb19d 100644

drivers/usb/musb/blackfin.c void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src) · line 60

Quoted 7 lines
drivers/usb/musb/blackfin.c +2 -0
@@ -54,13 +54,11 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src)
 void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
 {
      void __iomem *fifo = hw_ep->fifo;
+
+#ifdef CONFIG_BF52x
      u8 epnum = hw_ep->epnum;
      u16 dma_reg = 0;

Is this patch avoiding a warning about these variables being unused ?

Quoted 1 line

Would be nice to get this info to the patch body ;-)

the subject already says that
-mike

#3 lore raw
Quoted 27 lines · Mike Frysinger
Quoted 26 lines · Felipe Balbi
Quoted 1 line · Bryan Wu

From: Mike Frysinger <[email protected]>

I'd like to get a patch body here.

Quoted 11 lines
---
 drivers/usb/musb/blackfin.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
drivers/usb/musb/blackfin.c +0 -0
index 7861348..0ebb19d 100644

drivers/usb/musb/blackfin.c void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src) · line 60

Quoted 7 lines
drivers/usb/musb/blackfin.c +2 -0
@@ -54,13 +54,11 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src)
 void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
 {
      void __iomem *fifo = hw_ep->fifo;
+
+#ifdef CONFIG_BF52x
      u8 epnum = hw_ep->epnum;
      u16 dma_reg = 0;

Is this patch avoiding a warning about these variables being unused ?

Quoted 3 lines
Quoted 1 line

Would be nice to get this info to the patch body ;-)

the subject already says that

the subject says:

"tweak musb_read_fifo() to avoid unused warnings"

it doesn't specify where are the warnings.

Signature · 1 line
balbi
#4 lore raw
Quoted 30 lines · Felipe Balbi
Quoted 29 lines · Mike Frysinger
Quoted 27 lines · Felipe Balbi
Quoted 1 line · Bryan Wu

From: Mike Frysinger <[email protected]>

I'd like to get a patch body here.

Quoted 11 lines
---
 drivers/usb/musb/blackfin.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
drivers/usb/musb/blackfin.c +0 -0
index 7861348..0ebb19d 100644

drivers/usb/musb/blackfin.c void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src) · line 60

Quoted 7 lines
drivers/usb/musb/blackfin.c +2 -0
@@ -54,13 +54,11 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src)
 void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
 {
      void __iomem *fifo = hw_ep->fifo;
+
+#ifdef CONFIG_BF52x
      u8 epnum = hw_ep->epnum;
      u16 dma_reg = 0;

Is this patch avoiding a warning about these variables being unused ?

Would be nice to get this info to the patch body ;-)

Quoted 7 lines
Quoted 1 line

the subject already says that

the subject says:

"tweak musb_read_fifo() to avoid unused warnings"

it doesn't specify where are the warnings.

i dont think it really adds anything to explicitly mention every variable that triggers an unused warning. but if we look at the code that changed, it's easy to see that it's epnum and dma_reg. -mike

#5 lore raw
Quoted 11 lines · Mike Frysinger
Quoted 7 lines
Quoted 1 line

the subject already says that

the subject says:

"tweak musb_read_fifo() to avoid unused warnings"

it doesn't specify where are the warnings.

i dont think it really adds anything to explicitly mention every variable that triggers an unused warning. but if we look at the code that changed, it's easy to see that it's epnum and dma_reg.

Still I like to see patch bodies otherwise git log will look awkward.

Signature · 1 line
balbi
#7 lore raw
In reply to Bryan Wu
Quoted 13 lines · Bryan Wu

From: Mike Frysinger <[email protected]>

---
 drivers/usb/musb/blackfin.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
drivers/usb/musb/blackfin.c +0 -0
index 7861348..0ebb19d 100644

drivers/usb/musb/blackfin.c void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src) · line 58

Quoted 5 lines
drivers/usb/musb/blackfin.c +2 -0
@@ -54,13 +54,11 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src)
 void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
 {
 	void __iomem *fifo = hw_ep->fifo;
+
+#ifdef CONFIG_BF52x

Any way we can just not have ifdefs in .c files alltogether?

thanks,

greg k-h

#8 lore raw
Quoted 9 lines · Greg KH
Quoted 8 lines · Bryan Wu

From: Mike Frysinger <[email protected]>

---
 drivers/usb/musb/blackfin.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
Quoted 12 lines

drivers/usb/musb/blackfin.c void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src) · line 58

Quoted 10 lines
drivers/usb/musb/blackfin.c +2 -0
index 7861348..0ebb19d 100644
@@ -54,13 +54,11 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src)
 void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
 {
      void __iomem *fifo = hw_ep->fifo;
+
+#ifdef CONFIG_BF52x

Any way we can just not have ifdefs in .c files alltogether?

the sub arch.c files for musb are pretty much header files. the alternative (splitting up the funcs into their own header files) would be much more bothersome for us to maintain atm i think since there's so very little different.
-mike

#9 lore raw
Quoted 23 lines · Mike Frysinger
Quoted 9 lines · Greg KH
Quoted 8 lines · Bryan Wu

From: Mike Frysinger <[email protected]>

---
 drivers/usb/musb/blackfin.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
Quoted 12 lines

drivers/usb/musb/blackfin.c void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src) · line 58

Quoted 10 lines
drivers/usb/musb/blackfin.c +2 -0
index 7861348..0ebb19d 100644
@@ -54,13 +54,11 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src)
 void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
 {
      void __iomem *fifo = hw_ep->fifo;
+
+#ifdef CONFIG_BF52x

Any way we can just not have ifdefs in .c files alltogether?

Quoted 4 lines

the sub arch.c files for musb are pretty much header files. the alternative (splitting up the funcs into their own header files) would be much more bothersome for us to maintain atm i think since there's so very little different.

Ick. Oh well, any cleanup that people can think of would be good in this area...

thanks,

greg k-h

#6 lore raw
In reply to Mike Frysinger
Quoted 5 lines · Mike Frysinger
Quoted 3 lines

Is this patch avoiding a warning about these variables being unused ?

Would be nice to get this info to the patch body ;-)

the subject already says that

Not enough.

Mike, why is it that patches from ADI generally don't include
patch descriptions? It's not like folk haven't asked for them...

In the case of "avoid a warning" patches, the convention is to have the patch summary include the warnings being avoided. (Or at least a few, if they're too numerous.)