[U-Boot] [PATCH] net: sh_eth: Fix build warnings and whitespace for sh_eth

Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj at renesas.com
Wed Feb 15 08:51:40 CET 2012


Hi,

2012/2/3 Mike Frysinger <vapier at gentoo.org>:
> On Friday 03 February 2012 02:30:48 Nobuhiro Iwamatsu wrote:
>> @@ -564,8 +569,10 @@ static int sh_eth_bb_init(struct bb_miiphy_bus *bus)
>>
>>  static int sh_eth_bb_mdio_active(struct bb_miiphy_bus *bus)
>>  {
>> +     int port;
>>       struct sh_eth_dev *eth = bus->priv;
>> -     int port = eth->port;
>> +
>> +     port = eth->port;
>>
>>       outl(inl(PIR(port)) | PIR_MMD, PIR(port));
>>
>> @@ -574,8 +581,10 @@ static int sh_eth_bb_mdio_active(struct bb_miiphy_bus
>> *bus)
>>
>>  static int sh_eth_bb_mdio_tristate(struct bb_miiphy_bus *bus)
>>  {
>> +     int port;
>>       struct sh_eth_dev *eth = bus->priv;
>> -     int port = eth->port;
>> +
>> +     port = eth->port;
>>
>>       outl(inl(PIR(port)) & ~PIR_MMD, PIR(port));
>>
>> @@ -584,8 +593,10 @@ static int sh_eth_bb_mdio_tristate(struct
>> bb_miiphy_bus *bus)
>>
>>  static int sh_eth_bb_set_mdio(struct bb_miiphy_bus *bus, int v)
>>  {
>> +     int port;
>>       struct sh_eth_dev *eth = bus->priv;
>> -     int port = eth->port;
>> +
>> +     port = eth->port;
>>
>>       if (v)
>>               outl(inl(PIR(port)) | PIR_MDO, PIR(port));
>> @@ -597,8 +608,10 @@ static int sh_eth_bb_set_mdio(struct bb_miiphy_bus
>> *bus, int v)
>>
>>  static int sh_eth_bb_get_mdio(struct bb_miiphy_bus *bus, int *v)
>>  {
>> +     int port;
>>       struct sh_eth_dev *eth = bus->priv;
>> -     int port = eth->port;
>> +
>> +     port = eth->port;
>>
>>       *v = (inl(PIR(port)) & PIR_MDI) >> 3;
>>
>> @@ -607,8 +620,10 @@ static int sh_eth_bb_get_mdio(struct bb_miiphy_bus
>> *bus, int *v)
>>
>>  static int sh_eth_bb_set_mdc(struct bb_miiphy_bus *bus, int v)
>>  {
>> +     int port;
>>       struct sh_eth_dev *eth = bus->priv;
>> -     int port = eth->port;
>> +
>> +     port = eth->port;
>>
>>       if (v)
>>               outl(inl(PIR(port)) | PIR_MDC, PIR(port));
>
> i don't see why any of these changes are necessary ... the old code looks fine
> to me (from a warning and style pov)
> -mike

I do not seem to have any problem with the former cord, too either.
But when I dont apply this patch, I get the following warning.
-----
sh4-linux-gnu-gcc  -g  -Os   -ffixed-r13 -D__KERNEL__
-DCONFIG_SYS_TEXT_BASE=0x8FFC0000
-I/home/iwamatsu/work/u-boot/u-boot-sh/include -fno-builtin
-ffreestanding -nostdinc -isystem
/usr/lib/gcc/sh4-linux-gnu/4.4.6/include -pipe  -DCONFIG_SH -D__SH__
-m4-nofpu -Wall -Wstrict-prototypes -fno-stack-protector
-Wno-format-nonliteral -Wno-format-security     -o sh_eth.o sh_eth.c
-c
sh_eth.c: In function ‘sh_eth_reset’:
sh_eth.c:140: warning: unused variable ‘port’
sh_eth.c: In function ‘sh_eth_bb_mdio_active’:
sh_eth.c:568: warning: unused variable ‘port’
sh_eth.c: In function ‘sh_eth_bb_mdio_tristate’:
sh_eth.c:578: warning: unused variable ‘port’
sh_eth.c: In function ‘sh_eth_bb_set_mdio’:
sh_eth.c:588: warning: unused variable ‘port’
sh_eth.c: In function ‘sh_eth_bb_get_mdio’:
sh_eth.c:601: warning: unused variable ‘port’
sh_eth.c: In function ‘sh_eth_bb_set_mdc’:
sh_eth.c:611: warning: unused variable ‘port’
sh4-linux-gnu-ld  -e 0x8FFC0000 --defsym reloc_dst=0x8FFC0000 -r -o
libnet.o  sh_eth.o
-----

Best regards,
  Nobuhiro

-- 
Nobuhiro Iwamatsu


More information about the U-Boot mailing list