* [U-Boot] [PATCH] macb: fix compile warning
@ 2011-06-09 11:33 Andreas Bießmann
2011-06-09 12:08 ` [U-Boot] [PATCH v2] " Andreas Bießmann
2011-07-27 21:48 ` [U-Boot] [PATCH] " Wolfgang Denk
0 siblings, 2 replies; 6+ messages in thread
From: Andreas Bießmann @ 2011-06-09 11:33 UTC (permalink / raw)
To: u-boot
This patch fixes following compile warning:
---8<---
macb.c: In function 'macb_write_hwaddr':
macb.c:525:2: warning: dereferencing type-punned pointer will break strict-aliasing rules
--->8---
Signed-off-by: Andreas Bie?mann <andreas.devel@gmail.com>
---
BEWARE! this patch is only copile tested!
drivers/net/macb.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 72ea1fc..da41054 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -522,9 +522,10 @@ static int macb_write_hwaddr(struct eth_device *dev)
u16 hwaddr_top;
/* set hardware address */
- hwaddr_bottom = cpu_to_le32(*((u32 *)dev->enetaddr));
+ hwaddr_bottom = netdev->enetaddr[0] | netdev->enetaddr[1] << 8 |
+ netdev->enetaddr[2] << 16 | netdev->enetaddr[3] << 24;
macb_writel(macb, SA1B, hwaddr_bottom);
- hwaddr_top = cpu_to_le16(*((u16 *)(dev->enetaddr + 4)));
+ hwaddr_top = netdev->enetaddr[4] | netdev->enetaddr[5] << 8;
macb_writel(macb, SA1T, hwaddr_top);
return 0;
}
--
1.7.2.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH v2] macb: fix compile warning
2011-06-09 11:33 [U-Boot] [PATCH] macb: fix compile warning Andreas Bießmann
@ 2011-06-09 12:08 ` Andreas Bießmann
2011-06-09 19:02 ` Reinhard Meyer
2011-07-27 21:48 ` [U-Boot] [PATCH] " Wolfgang Denk
1 sibling, 1 reply; 6+ messages in thread
From: Andreas Bießmann @ 2011-06-09 12:08 UTC (permalink / raw)
To: u-boot
This patch fixes following compile warning:
---8<---
macb.c: In function 'macb_write_hwaddr':
macb.c:525:2: warning: dereferencing type-punned pointer will break strict-aliasing rules
--->8---
Signed-off-by: Andreas Bie?mann <andreas.devel@gmail.com>
---
BEWARE! this patch is only compile tested!
changes since v1:
- use correct eth_device
drivers/net/macb.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 72ea1fc..c63eea9 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -522,9 +522,10 @@ static int macb_write_hwaddr(struct eth_device *dev)
u16 hwaddr_top;
/* set hardware address */
- hwaddr_bottom = cpu_to_le32(*((u32 *)dev->enetaddr));
+ hwaddr_bottom = dev->enetaddr[0] | dev->enetaddr[1] << 8 |
+ dev->enetaddr[2] << 16 | dev->enetaddr[3] << 24;
macb_writel(macb, SA1B, hwaddr_bottom);
- hwaddr_top = cpu_to_le16(*((u16 *)(dev->enetaddr + 4)));
+ hwaddr_top = dev->enetaddr[4] | dev->enetaddr[5] << 8;
macb_writel(macb, SA1T, hwaddr_top);
return 0;
}
--
1.7.2.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH v2] macb: fix compile warning
2011-06-09 12:08 ` [U-Boot] [PATCH v2] " Andreas Bießmann
@ 2011-06-09 19:02 ` Reinhard Meyer
0 siblings, 0 replies; 6+ messages in thread
From: Reinhard Meyer @ 2011-06-09 19:02 UTC (permalink / raw)
To: u-boot
Dear Andreas Bie?mann,
> This patch fixes following compile warning:
>
> ---8<---
> macb.c: In function 'macb_write_hwaddr':
> macb.c:525:2: warning: dereferencing type-punned pointer will break strict-aliasing rules
> --->8---
>
> Signed-off-by: Andreas Bie?mann<andreas.devel@gmail.com>
Tested-by: Reinhard Meyer<u-boot@emk-elektronik.de>
> ---
> BEWARE! this patch is only compile tested!
Works well with top9000(at91sam9xe). Thanks.
>
> changes since v1:
> - use correct eth_device
>
> drivers/net/macb.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/macb.c b/drivers/net/macb.c
> index 72ea1fc..c63eea9 100644
> --- a/drivers/net/macb.c
> +++ b/drivers/net/macb.c
> @@ -522,9 +522,10 @@ static int macb_write_hwaddr(struct eth_device *dev)
> u16 hwaddr_top;
>
> /* set hardware address */
> - hwaddr_bottom = cpu_to_le32(*((u32 *)dev->enetaddr));
> + hwaddr_bottom = dev->enetaddr[0] | dev->enetaddr[1]<< 8 |
> + dev->enetaddr[2]<< 16 | dev->enetaddr[3]<< 24;
> macb_writel(macb, SA1B, hwaddr_bottom);
> - hwaddr_top = cpu_to_le16(*((u16 *)(dev->enetaddr + 4)));
> + hwaddr_top = dev->enetaddr[4] | dev->enetaddr[5]<< 8;
> macb_writel(macb, SA1T, hwaddr_top);
> return 0;
> }
Applied to u-boot-atmel/master. Thanks,
Reinhard
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] macb: fix compile warning
2011-06-09 11:33 [U-Boot] [PATCH] macb: fix compile warning Andreas Bießmann
2011-06-09 12:08 ` [U-Boot] [PATCH v2] " Andreas Bießmann
@ 2011-07-27 21:48 ` Wolfgang Denk
2011-07-27 21:55 ` Reinhard Meyer
1 sibling, 1 reply; 6+ messages in thread
From: Wolfgang Denk @ 2011-07-27 21:48 UTC (permalink / raw)
To: u-boot
Dear "=?UTF-8?q?Andreas=20Bie=C3=9Fmann?=",
In message <1307619188-18655-1-git-send-email-andreas.devel@gmail.com> you wrote:
> This patch fixes following compile warning:
>
> ---8<---
> macb.c: In function 'macb_write_hwaddr':
> macb.c:525:2: warning: dereferencing type-punned pointer will break strict-aliasing rules
> --->8---
>
> Signed-off-by: Andreas Bie??mann <andreas.devel@gmail.com>
> ---
> BEWARE! this patch is only copile tested!
>
> drivers/net/macb.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/macb.c b/drivers/net/macb.c
> index 72ea1fc..da41054 100644
> --- a/drivers/net/macb.c
> +++ b/drivers/net/macb.c
> @@ -522,9 +522,10 @@ static int macb_write_hwaddr(struct eth_device *dev)
> u16 hwaddr_top;
>
> /* set hardware address */
> - hwaddr_bottom = cpu_to_le32(*((u32 *)dev->enetaddr));
> + hwaddr_bottom = netdev->enetaddr[0] | netdev->enetaddr[1] << 8 |
> + netdev->enetaddr[2] << 16 | netdev->enetaddr[3] << 24;
> macb_writel(macb, SA1B, hwaddr_bottom);
> - hwaddr_top = cpu_to_le16(*((u16 *)(dev->enetaddr + 4)));
> + hwaddr_top = netdev->enetaddr[4] | netdev->enetaddr[5] << 8;
> macb_writel(macb, SA1T, hwaddr_top);
> return 0;
This doesn't apply. Can you please rebase and resubmit? Thanks.
Best regards,
Wolfgang Denk
--
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
"355/113 -- Not the famous irrational number PI, but an incredible
simulation!"
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] macb: fix compile warning
2011-07-27 21:48 ` [U-Boot] [PATCH] " Wolfgang Denk
@ 2011-07-27 21:55 ` Reinhard Meyer
2011-07-27 22:06 ` Wolfgang Denk
0 siblings, 1 reply; 6+ messages in thread
From: Reinhard Meyer @ 2011-07-27 21:55 UTC (permalink / raw)
To: u-boot
Dear Wolfgang Denk,
> Dear "=?UTF-8?q?Andreas=20Bie=C3=9Fmann?=",
>
> In message<1307619188-18655-1-git-send-email-andreas.devel@gmail.com> you wrote:
>> This patch fixes following compile warning:
>>
>> ---8<---
>> macb.c: In function 'macb_write_hwaddr':
>> macb.c:525:2: warning: dereferencing type-punned pointer will break strict-aliasing rules
>> --->8---
>>
>> Signed-off-by: Andreas Bie??mann<andreas.devel@gmail.com>
> This doesn't apply. Can you please rebase and resubmit? Thanks.
V2 of this patch has been mainlined in June already.
Note: macb is the LAN driver for all Atmel ARM and AVR32 SoCs.
Best Regards,
Reinhard
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] macb: fix compile warning
2011-07-27 21:55 ` Reinhard Meyer
@ 2011-07-27 22:06 ` Wolfgang Denk
0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Denk @ 2011-07-27 22:06 UTC (permalink / raw)
To: u-boot
Dear Reinhard Meyer,
In message <4E30894C.1030509@emk-elektronik.de> you wrote:
>
> > This doesn't apply. Can you please rebase and resubmit? Thanks.
>
> V2 of this patch has been mainlined in June already.
I see, thanks.
Best regards,
Wolfgang Denk
--
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
If the car industry behaved like the computer industry over the last
30 years, a Rolls-Royce would cost $5, get 300 miles per gallon, and
blow up once a year killing all passengers inside.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-07-27 22:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-09 11:33 [U-Boot] [PATCH] macb: fix compile warning Andreas Bießmann
2011-06-09 12:08 ` [U-Boot] [PATCH v2] " Andreas Bießmann
2011-06-09 19:02 ` Reinhard Meyer
2011-07-27 21:48 ` [U-Boot] [PATCH] " Wolfgang Denk
2011-07-27 21:55 ` Reinhard Meyer
2011-07-27 22:06 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox