* [U-Boot] [PATCH] net: macb: fix the building warning
@ 2013-08-16 1:46 Bo Shen
2013-08-16 11:02 ` Andreas Bießmann
0 siblings, 1 reply; 2+ messages in thread
From: Bo Shen @ 2013-08-16 1:46 UTC (permalink / raw)
To: u-boot
fix the following building warning
---8>---
macb.c: In function 'macb_init':
macb.c:400:14: warning: 'phydev' may be used uninitialized in this function
macb.c:377:21: note: 'phydev' was declared here
---<8---
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
drivers/net/macb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 1f7cc32..90ae42d 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -374,7 +374,7 @@ static int macb_phy_init(struct macb_device *macb)
{
struct eth_device *netdev = &macb->netdev;
#ifdef CONFIG_PHYLIB
- struct phy_device *phydev;
+ struct phy_device *phydev = NULL;
#endif
u32 ncfgr;
u16 phy_id, status, adv, lpa;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread* [U-Boot] [PATCH] net: macb: fix the building warning
2013-08-16 1:46 [U-Boot] [PATCH] net: macb: fix the building warning Bo Shen
@ 2013-08-16 11:02 ` Andreas Bießmann
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Bießmann @ 2013-08-16 11:02 UTC (permalink / raw)
To: u-boot
Hi Bo,
On 16.08.13 03:46, Bo Shen wrote:
> fix the following building warning
> ---8>---
> macb.c: In function 'macb_init':
> macb.c:400:14: warning: 'phydev' may be used uninitialized in this function
> macb.c:377:21: note: 'phydev' was declared here
> ---<8---
>
> Signed-off-by: Bo Shen <voice.shen@atmel.com>
>
> ---
> drivers/net/macb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/macb.c b/drivers/net/macb.c
> index 1f7cc32..90ae42d 100644
> --- a/drivers/net/macb.c
> +++ b/drivers/net/macb.c
> @@ -374,7 +374,7 @@ static int macb_phy_init(struct macb_device *macb)
> {
> struct eth_device *netdev = &macb->netdev;
> #ifdef CONFIG_PHYLIB
> - struct phy_device *phydev;
> + struct phy_device *phydev = NULL;
NAK, this will deference a NULL pointer later on ...
Best regards
Andreas Bie?mann
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-08-16 11:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-16 1:46 [U-Boot] [PATCH] net: macb: fix the building warning Bo Shen
2013-08-16 11:02 ` Andreas Bießmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox