Re: [PATCH 03/10] net/fec: add mac field into platform data and consolidate fec_get_mac

Previous thread: Re: [PATCH 03/10] net/fec: add mac field into platform data and consolidate fec_get_mac by Uwe Kleine-König on Wednesday, December 29, 2010 - 3:37 am. (4 messages)

Next thread: [PATCH v3] Gemini: Gigabit ethernet driver by =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= on Wednesday, December 29, 2010 - 6:02 am. (1 message)
From: Shawn Guo
Date: Wednesday, December 29, 2010 - 4:58 am

Hi Uwe,

Will change the comment and fec_mac_default name to address
No. dev->dev_addr points to netdev_hw_addr->addr, which is a 32 bytes array.

-- 
Regards,
Shawn

--

From: Uwe Kleine-König
Date: Wednesday, December 29, 2010 - 5:42 am

Hello Shawn,

I didn't mean an out-of-bound access, but what is if
fec_mac_default[ETH_ALEN-1] is 0xff and you add 1?  Does that result in
0x100 or 0?  What if id is <0?  For big ids you might even handle a
carry to indixes <ETH_ALEN-2.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--

From: Shawn Guo
Date: Wednesday, December 29, 2010 - 7:12 pm

Hi Uwe,

First of all, all my patch did is changing fep->index to,
fep->pdev->id, which should not bring any problem you are concerned.

Secondly, I do not understand how the overflow on 
fec_mac_default[ETH_ALEN-1] can result in a carry on the next array
element. Here is what I'm seeing with fec_mac=00:04:9f:01:30:ff.

eth0      Link encap:Ethernet  HWaddr 00:04:9F:01:30:FF
eth1      Link encap:Ethernet  HWaddr 00:04:9F:01:30:00

-- 
Regards,
Shawn

--

From: Uwe Kleine-König
Date: Thursday, December 30, 2010 - 1:04 am

Hello Shawn,

There is no automatic carry to the next array element.  I just wondered
If this is intended, it's totally OK for me.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--

Previous thread: Re: [PATCH 03/10] net/fec: add mac field into platform data and consolidate fec_get_mac by Uwe Kleine-König on Wednesday, December 29, 2010 - 3:37 am. (4 messages)

Next thread: [PATCH v3] Gemini: Gigabit ethernet driver by =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= on Wednesday, December 29, 2010 - 6:02 am. (1 message)