Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1557736 > unrolled thread

[patch net-next] stmmac: indent an if statement

Started byDan Carpenter <dan.carpenter@oracle.com>
First post2017-01-12 20:00 +0100
Last post2017-01-16 10:50 +0100
Articles 5 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [patch net-next] stmmac: indent an if statement Dan Carpenter <dan.carpenter@oracle.com> - 2017-01-12 20:00 +0100
    Re: [patch net-next] stmmac: indent an if statement Julia Lawall <julia.lawall@lip6.fr> - 2017-01-12 20:50 +0100
    Re: [patch net-next] stmmac: indent an if statement David Miller <davem@davemloft.net> - 2017-01-16 04:20 +0100
      Re: [patch net-next] stmmac: indent an if statement Dan Carpenter <dan.carpenter@oracle.com> - 2017-01-16 10:30 +0100
        Re: [patch net-next] stmmac: indent an if statement Dan Carpenter <dan.carpenter@oracle.com> - 2017-01-16 10:50 +0100

#1557736 — [patch net-next] stmmac: indent an if statement

FromDan Carpenter <dan.carpenter@oracle.com>
Date2017-01-12 20:00 +0100
Subject[patch net-next] stmmac: indent an if statement
Message-ID<sYSLo-7sp-27@gated-at.bofh.it>
The break statement should be indented one more tab.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index ac32f9e..4daa8a3 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -191,7 +191,7 @@ static int stmmac_dt_phy(struct plat_stmmacenet_data *plat,
 		for_each_child_of_node(np, plat->mdio_node) {
 			if (of_device_is_compatible(plat->mdio_node,
 						    "snps,dwmac-mdio"))
-			break;
+				break;
 		}
 	}
 

[toc] | [next] | [standalone]


#1557751

FromJulia Lawall <julia.lawall@lip6.fr>
Date2017-01-12 20:50 +0100
Message-ID<sYTxM-7XH-13@gated-at.bofh.it>
In reply to#1557736

On Thu, 12 Jan 2017, Dan Carpenter wrote:

> The break statement should be indented one more tab.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> index ac32f9e..4daa8a3 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -191,7 +191,7 @@ static int stmmac_dt_phy(struct plat_stmmacenet_data *plat,
>  		for_each_child_of_node(np, plat->mdio_node) {
>  			if (of_device_is_compatible(plat->mdio_node,
>  						    "snps,dwmac-mdio"))
> -			break;
> +				break;

If there is a break, there is probably also a need for an of_node_put?

julia

>  		}
>  	}
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

[toc] | [prev] | [next] | [standalone]


#1559415

FromDavid Miller <davem@davemloft.net>
Date2017-01-16 04:20 +0100
Message-ID<t05ZU-2O6-9@gated-at.bofh.it>
In reply to#1557736
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 12 Jan 2017 21:46:32 +0300

> The break statement should be indented one more tab.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, but like Julia I think we might have a missing of_node_put()
here.

[toc] | [prev] | [next] | [standalone]


#1559547

FromDan Carpenter <dan.carpenter@oracle.com>
Date2017-01-16 10:30 +0100
Message-ID<t0bLY-6Q2-13@gated-at.bofh.it>
In reply to#1559415
On Sun, Jan 15, 2017 at 10:14:38PM -0500, David Miller wrote:
> From: Dan Carpenter <dan.carpenter@oracle.com>
> Date: Thu, 12 Jan 2017 21:46:32 +0300
> 
> > The break statement should be indented one more tab.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Applied, but like Julia I think we might have a missing of_node_put()
> here.

Of course, sorry for dropping the ball on this.  I'll send a patch for
that.

regards,
dan carpenter

[toc] | [prev] | [next] | [standalone]


#1559564

FromDan Carpenter <dan.carpenter@oracle.com>
Date2017-01-16 10:50 +0100
Message-ID<t0c5j-6Xo-11@gated-at.bofh.it>
In reply to#1559547
On Mon, Jan 16, 2017 at 12:19:24PM +0300, Dan Carpenter wrote:
> On Sun, Jan 15, 2017 at 10:14:38PM -0500, David Miller wrote:
> > From: Dan Carpenter <dan.carpenter@oracle.com>
> > Date: Thu, 12 Jan 2017 21:46:32 +0300
> > 
> > > The break statement should be indented one more tab.
> > > 
> > > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> > Applied, but like Julia I think we might have a missing of_node_put()
> > here.
> 
> Of course, sorry for dropping the ball on this.  I'll send a patch for
> that.
> 

Actually, I've looked at it some more and I think this function is OK.
We're supposed to do an of_node_put() later...  I can't find where that
happens, but presumably that's because I don't know stmmac well.  This
code here, though, is fine.

regards,
dan carpenter

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web