diff mbox

[U-Boot,03/12] net: e1000: fix indentation

Message ID 1479257416-29389-4-git-send-email-andre.przywara@arm.com
State Accepted
Commit 063bb708b59c882dcd7ec08a370c0e5773b3c772
Delegated to: Tom Rini
Headers show

Commit Message

Andre Przywara Nov. 16, 2016, 12:50 a.m. UTC
Apparently the indentation is off here, for the IGB model just want to
bail out early.
Fix this to avoid both compiler warnings and puzzled readers.

Pointed out by GCC 6.2's -Wmisleading-indentation warning.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 drivers/net/e1000.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Joe Hershberger Nov. 29, 2016, 7 p.m. UTC | #1
On Tue, Nov 15, 2016 at 6:50 PM, Andre Przywara <andre.przywara@arm.com> wrote:
> Apparently the indentation is off here, for the IGB model just want to
> bail out early.
> Fix this to avoid both compiler warnings and puzzled readers.
>
> Pointed out by GCC 6.2's -Wmisleading-indentation warning.
>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  drivers/net/e1000.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c
> index 3332ad9..875682b 100644
> --- a/drivers/net/e1000.c
> +++ b/drivers/net/e1000.c
> @@ -1522,11 +1522,10 @@ e1000_initialize_hardware_bits(struct e1000_hw *hw)
>                 reg_txdctl1 |= E1000_TXDCTL_COUNT_DESC;
>                 E1000_WRITE_REG(hw, TXDCTL1, reg_txdctl1);
>
> -       /* IGB is cool */
> -       if (hw->mac_type == e1000_igb)
> -               return;
>
>                 switch (hw->mac_type) {
> +               case e1000_igb:                 /* IGB is cool */

Too bad you didn't take this opportunity to drop the worthless comment. Oh well.

Acked-by: Joe Hershberger <joe.hershberger@ni.com>

> +                       return;
>                 case e1000_82571:
>                 case e1000_82572:
>                         /* Clear PHY TX compatible mode bits */
> --
> 2.8.2
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
Tom Rini Dec. 4, 2016, 11:01 p.m. UTC | #2
On Wed, Nov 16, 2016 at 12:50:07AM +0000, Andre Przywara wrote:

> Apparently the indentation is off here, for the IGB model just want to
> bail out early.
> Fix this to avoid both compiler warnings and puzzled readers.
> 
> Pointed out by GCC 6.2's -Wmisleading-indentation warning.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> Acked-by: Joe Hershberger <joe.hershberger@ni.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c
index 3332ad9..875682b 100644
--- a/drivers/net/e1000.c
+++ b/drivers/net/e1000.c
@@ -1522,11 +1522,10 @@  e1000_initialize_hardware_bits(struct e1000_hw *hw)
 		reg_txdctl1 |= E1000_TXDCTL_COUNT_DESC;
 		E1000_WRITE_REG(hw, TXDCTL1, reg_txdctl1);
 
-	/* IGB is cool */
-	if (hw->mac_type == e1000_igb)
-		return;
 
 		switch (hw->mac_type) {
+		case e1000_igb:			/* IGB is cool */
+			return;
 		case e1000_82571:
 		case e1000_82572:
 			/* Clear PHY TX compatible mode bits */