Skip to contentSkip to conversation

usbdev.c: Fix GCC 4.6 build warnings

PATCH New Stefan Roese 4 participants 6 messages Nov 15, 2011 – Dec 9, 2011 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 2/19 usbdev.c: Fix GCC 4.6 build warnings

Fix:
usbdev.c: In function 'process_endpoints':
usbdev.c:29:12: warning: variable 'temp1' set but not used [-Wunused-but-set-variable] usbdev.c:29:6: warning: variable 'temp' set but not used [-Wunused-but-set-variable]

---
 arch/powerpc/cpu/ppc4xx/usbdev.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
arch/powerpc/cpu/ppc4xx/usbdev.c +0 -3
index fe398af..fc7da89 100644
@@ -26,7 +26,6 @@ void process_endpoints(unsigned short usb2d0_intrin)
 	struct devrequest setup_packet;
 	unsigned int *setup_packet_pt;
 	unsigned char *packet_pt = NULL;
-	int temp, temp1;
 
 	int i;
 
@@ -44,8 +43,6 @@ void process_endpoints(unsigned short usb2d0_intrin)
 		/*copy packet */
 		setup_packet_pt[0] = *(unsigned int *)USB2D0_FIFO_0;
 		setup_packet_pt[1] = *(unsigned int *)USB2D0_FIFO_0;
-		temp = *(unsigned int *)USB2D0_FIFO_0;
-		temp1 = *(unsigned int *)USB2D0_FIFO_0;
 
 		/*do some swapping */
 		setup_packet.value = swap_16(setup_packet.value);
Signature · 1 line
1.7.7.3
#1 lore raw

PATCH 2/19 usbdev.c: Fix GCC 4.6 build warnings

arch/powerpc/cpu/ppc4xx/usbdev.c void process_endpoints(unsigned short usb2d0_intrin) · line 48

Quoted 10 lines · On Tuesday 15 November 2011 13:01:52 Stefan Roese wrote:
arch/powerpc/cpu/ppc4xx/usbdev.c +0 -3
 
-	int temp, temp1;
...
 		/*copy packet */
 		setup_packet_pt[0] = *(unsigned int *)USB2D0_FIFO_0;
 		setup_packet_pt[1] = *(unsigned int *)USB2D0_FIFO_0;
-		temp = *(unsigned int *)USB2D0_FIFO_0;
-		temp1 = *(unsigned int *)USB2D0_FIFO_0;

this seems to be treading into possible ugly volatile area ... perhaps best if this was acked/tested by someone with actual hardware first ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20111115/d4832240/attachment.pgp

#2 lore raw

PATCH 2/19 usbdev.c: Fix GCC 4.6 build warnings

Quoted 11 lines · On Tuesday 15 November 2011 13:01:52 Stefan Roese wrote:
Quoted 10 lines
arch/powerpc/cpu/ppc4xx/usbdev.c +0 -1
 
-	int temp, temp1;
...
 
 		/*copy packet */
 		setup_packet_pt[0] = *(unsigned int *)USB2D0_FIFO_0;
 		setup_packet_pt[1] = *(unsigned int *)USB2D0_FIFO_0;
Quoted 6 lines

arch/powerpc/cpu/ppc4xx/usbdev.c void process_endpoints(unsigned short usb2d0_intrin) · line 48

Quoted 2 lines
arch/powerpc/cpu/ppc4xx/usbdev.c +0 -2
-		temp = *(unsigned int *)USB2D0_FIFO_0;
-		temp1 = *(unsigned int *)USB2D0_FIFO_0;

this seems to be treading into possible ugly volatile area ... perhaps best if this was acked/tested by someone with actual hardware first ... -mike

My words definitelly ... maybe replace with in_be32() ? It seems very suspicious, as if there was a reason for this access. Like you need to do more accesses to the fifo to clean up some trailing crud.

M

#3 lore raw

PATCH 2/19 usbdev.c: Fix GCC 4.6 build warnings

In reply to Stefan Roese

Dear Stefan Roese,

Quoted 6 lines · In message <[email protected]> you wrote:

Fix:
usbdev.c: In function 'process_endpoints':
usbdev.c:29:12: warning: variable 'temp1' set but not used [-Wunused-but-set-variable] usbdev.c:29:6: warning: variable 'temp' set but not used [-Wunused-but-set-variable]

...

arch/powerpc/cpu/ppc4xx/usbdev.c void process_endpoints(unsigned short usb2d0_intrin) · line 48

Quoted 6 lines
arch/powerpc/cpu/ppc4xx/usbdev.c +0 -2
@@ -44,8 +43,6 @@ void process_endpoints(unsigned short usb2d0_intrin)
 		/*copy packet */
 		setup_packet_pt[0] = *(unsigned int *)USB2D0_FIFO_0;
 		setup_packet_pt[1] = *(unsigned int *)USB2D0_FIFO_0;
-		temp = *(unsigned int *)USB2D0_FIFO_0;
-		temp1 = *(unsigned int *)USB2D0_FIFO_0;

It seems we agree that these reads from the FIFO registers may actually be important for proper operation. Are you planning to submit an updated, improved patch?

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Is truth not truth for all?
	-- Natira, "For the World is Hollow and I have Touched
		   the Sky", stardate 5476.4.
#4 lore raw

PATCH 2/19 usbdev.c: Fix GCC 4.6 build warnings

Hi Wolfgang,

Quoted 17 lines · On Friday 09 December 2011 10:31:01 Wolfgang Denk wrote:
Quoted 7 lines · In message <[email protected]> you wrote:

Fix:
usbdev.c: In function 'process_endpoints':
usbdev.c:29:12: warning: variable 'temp1' set but not used [-Wunused-but-set-variable] usbdev.c:29:6: warning: variable 'temp' set but not used [-Wunused-but-set-variable]

...

Quoted 6 lines
arch/powerpc/cpu/ppc4xx/usbdev.c +0 -0
@@ -44,8 +43,6 @@ void process_endpoints(unsigned short usb2d0_intrin)
 
 		/*copy packet */
 		setup_packet_pt[0] = *(unsigned int *)USB2D0_FIFO_0;
 		setup_packet_pt[1] = *(unsigned int *)USB2D0_FIFO_0;
 
Quoted 6 lines

arch/powerpc/cpu/ppc4xx/usbdev.c void process_endpoints(unsigned short usb2d0_intrin) · line 48

Quoted 2 lines
arch/powerpc/cpu/ppc4xx/usbdev.c +0 -2
-		temp = *(unsigned int *)USB2D0_FIFO_0;
-		temp1 = *(unsigned int *)USB2D0_FIFO_0;

It seems we agree that these reads from the FIFO registers may actually be important for proper operation. Are you planning to submit an updated, improved patch?

This file has been removed with patch ce2acd371c4eee36e55d706a181361c25ebfe160 already in mainline.

Best regards,
Stefan

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

#5 lore raw

PATCH 2/19 usbdev.c: Fix GCC 4.6 build warnings

Dear Stefan Roese,

Quoted 3 lines · In message <[email protected]> you wrote:

This file has been removed with patch ce2acd371c4eee36e55d706a181361c25ebfe160 already in mainline.

Ah, right. Even better :-)

Thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Never underestimate the power of human stupidity  when  it  comes  to
using technology they don't understand.