[U-Boot] [PATCH] MIPS: Fix compile warning in au1x00_eth.c

Stefan Roese
2009-01-28T16:37:36Z

On Wednesday 28 January 2009, Shinya Kuribayashi wrote:
> Stefan Roese wrote:
> > This patch fixes this compilation warning:
> >
> > ./MAKEALL dbau1000
> > Configuring for dbau1x00 board...
> > au1x00_eth.c: In function 'au1x00_send':
> > au1x00_eth.c:158: warning: passing argument 1 of 'virt_to_phys' discards
> > qualifiers from pointer target type
> > ...
> >
> > Seens with ELDK 4.2 (GCC 4.2.2).
> >
> > Signed-off-by: Stefan Roese <sr@denx.de>
>
> The number of warnings decreases by half, but we're still warned.
> Comments? I've not took a look of the patch itself, yet. Just let you
> know.

Hmmm, strange. I only see 3 warnings which are resolved with my patch:

[stefan at kubuntu u-boot (master)]$ ./MAKEALL dbau1000
Configuring for dbau1x00 board...
au1x00_eth.c: In function 'au1x00_send':
au1x00_eth.c:158: warning: passing argument 1 of 'virt_to_phys' discards qualifiers from pointer target type
au1x00_eth.c: In function 'au1x00_recv':
au1x00_eth.c:211: warning: passing argument 1 of 'virt_to_phys' discards qualifiers from pointer target type
au1x00_eth.c: In function 'au1x00_init':
au1x00_eth.c:252: warning: passing argument 1 of 'virt_to_phys' discards qualifiers from pointer target type
text data bss dec hex filename
120028 5408 20648 146084 23aa4 ./u-boot
[stefan at kubuntu u-boot (master)]$ git am patches_stefan/0001-MIPS-Fix-compile-warning-in-au1x00_eth.c.patch
Applying: MIPS: Fix compile warning in au1x00_eth.c
[stefan at kubuntu u-boot (master)]$ ./MAKEALL dbau1000
Configuring for dbau1x00 board...
text data bss dec hex filename
120028 5408 20648 146084 23aa4 ./u-boot

This is on TOT (git ID 2b6fd5c77db9c6ed3cea9799c86ff922cf0107b2).

Ah, there's something I noticed in your test. Please see below.

> skuribay at ubuntu:u-boot.git$ mips-linux-gnu-gcc --version
> mips-linux-gnu-gcc (Sourcery G++ Lite 4.2-177) 4.2.3
> Copyright (C) 2007 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> skuribay at ubuntu:u-boot.git$
> skuribay at ubuntu:u-boot.git$ CROSS_COMPILE=mips-linux-gnu- ./MAKEALL
> dbau1000 Configuring for dbau1x00 board...
> au1x00_eth.c: In function 'au1x00_send':
> au1x00_eth.c:158: warning: passing argument 1 of 'virt_to_phys' discards
> qualifiers from pointer target type au1x00_eth.c: In function
> 'au1x00_recv':
> au1x00_eth.c:211: warning: passing argument 1 of 'virt_to_phys' discards
> qualifiers from pointer target type au1x00_eth.c: In function
> 'au1x00_init':
> au1x00_eth.c:252: warning: passing argument 1 of 'virt_to_phys' discards
> qualifiers from pointer target type au1x00_eth.c: In function
> 'au1x00_recv':
> au1x00_eth.c:211: warning: passing argument 1 of 'virt_to_phys' discards
> qualifiers from pointer target type au1x00_eth.c: In function
> 'au1x00_init':
> au1x00_eth.c:252: warning: passing argument 1 of 'virt_to_phys' discards
> qualifiers from pointer target type au1x00_eth.c: In function
> 'au1x00_send':
> au1x00_eth.c:158: warning: passing argument 1 of 'virt_to_phys' discards
> qualifiers from pointer target type text data bss dec hex
> filename
> 118780 5264 20648 144692 23534 ./u-boot

Those errors occur twice. Seems that you are compiling this file twice.
Any idea why?

> skuribay at ubuntu:u-boot.git$
> skuribay at ubuntu:u-boot.git$
> skuribay at ubuntu:u-boot.git$ stg push
> Checking for changes in the working directory ... done
> Fast-forwarded patch "mips-fix-dbau1000-warning.patch"
> Now at patch "mips-fix-dbau1000-warning.patch"
> skuribay at ubuntu:u-boot.git$
> skuribay at ubuntu:u-boot.git$ CROSS_COMPILE=mips-linux-gnu- ./MAKEALL
> dbau1000 Configuring for dbau1x00 board...
> au1x00_eth.c: In function 'au1x00_recv':
> au1x00_eth.c:211: warning: passing argument 1 of 'virt_to_phys' discards
> qualifiers from pointer target type au1x00_eth.c: In function
> 'au1x00_init':
> au1x00_eth.c:253: warning: passing argument 1 of 'virt_to_phys' discards
> qualifiers from pointer target type au1x00_eth.c: In function
> 'au1x00_send':
> au1x00_eth.c:158: warning: passing argument 1 of 'virt_to_phys' discards
> qualifiers from pointer target type text data bss dec hex
> filename
> 118780 5264 20648 144692 23534 ./u-boot
> skuribay at ubuntu:u-boot.git$

And now one version of the errors are solved, only one is remaining. Perhaps
you are compiling a 2nd version of this driver again. Just guessing...

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
=====================================================================