Skip to contentSkip to conversation

Fix GCC 6.2 compiler warnings

PATCH New Andre Przywara 10 participants 39 messages Nov 16, 2016 – Dec 4, 2016

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

cover Fix GCC 6.2 compiler warnings

More or less by accident I ran buildman the other day on a box with GCC 6.2.0 cross-compilers. By default it seems that the 6.x series enables more (and new) warnings, so the results were non-clean builds for about two thirds of the armv8 defconfigs.
Some of the warnings are cosmectic, but some are genuine bugs (mostly in error handling cases, but still).
This is a first bunch of fixes, shamelessly picking the low hanging fruits here.
I fixed even the cases where the code itself was correct, to avoid warnings and also not to confuse any readers of the code.
Also getting used to ignore warnings leads to eventually missing that one genuine one in the future (been there ...)

In a few cases I made a guess on the fix, please feel free to correct me in the (likely) case I got it wrong.

Applies on top of v2016.11 release.

Cheers,
Andre.

P.S. Almost every Freescale board build still complains along the lines of [1]. I spent some time in that file (drivers/ddr/fsl/options.c) and narrowly escaped before I lost the remaining bits of my sanity to the daemons of #ifdef hell.
If someone more familiar with that code could take a look and decide whether those definitions either belong into some #ifdef clauses or they should be attributed with __maybe_unused.

[1] http://pastebin.com/TrLSssqU

Andre Przywara (12):
ls2080aqds: eth: add missing braces
mtd: cfi_flash: fix indentation
net: e1000: fix indentation
net: ldpaa_eth: add missing braces
net: rtl8169: remove unneeded definition
marvell: comphy_a3700: fix bitmask
usb: eth: r8152_fw: fix indentation
davinci: da8xxevm: fix indentation
phy: micrel: add missing braces
cmd: tpm_test: fix indentation
Xilinx ZynqMP: fix minimum SDHCI frequency
usb: gadget: remove unused shortname variable

 board/davinci/da8xxevm/da850evm.c  | 4 ++--
 board/freescale/ls2080aqds/eth.c   | 3 ++-
 cmd/tpm_test.c                     | 4 ++--
 drivers/mtd/cfi_flash.c            | 4 ++--
 drivers/net/e1000.c                | 5 ++---
 drivers/net/ldpaa_eth/ldpaa_eth.c  | 3 ++-
 drivers/net/phy/micrel.c           | 3 ++-
 drivers/net/rtl8169.c              | 3 ---
 drivers/phy/marvell/comphy_a3700.h | 4 ++--
 drivers/usb/eth/r8152_fw.c         | 8 ++++----
 drivers/usb/gadget/ether.c         | 1 -
 include/configs/xilinx_zynqmp_ep.h | 2 +-
 12 files changed, 21 insertions(+), 23 deletions(-)
Signature · 1 line
2.8.2
#1 lore raw

PATCH 1/12 ls2080aqds: eth: add missing braces

The whole error message should be within the else clause, not just the first part.
Pointed out by GCC 6.2's -Wmisleading-indentation warning.

---
 board/freescale/ls2080aqds/eth.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
board/freescale/ls2080aqds/eth.c +2 -1
index 95ff68b..7bf7a5b 100644
@@ -196,12 +196,13 @@ static void sgmii_configure_repeater(int serdes_port)
 					       value);
 					i = 5;
 					j = 5;
-				} else
+				} else {
 					printf("DPMAC %d :PHY is failed to ",
 					       dpmac_id);
 					printf("configure the repeater 0x%x\n",
 					       value);
 				}
+			}
 		}
 	}
 error:
Signature · 1 line
2.8.2
#2 lore raw

PATCH 1/12 ls2080aqds: eth: add missing braces

Quoted 19 lines · Andre Przywara

The whole error message should be within the else clause, not just the first part.
Pointed out by GCC 6.2's -Wmisleading-indentation warning.

---
 board/freescale/ls2080aqds/eth.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
board/freescale/ls2080aqds/eth.c +0 -1
index 95ff68b..7bf7a5b 100644
@@ -196,12 +196,13 @@ static void sgmii_configure_repeater(int serdes_port)
 					       value);
 					i = 5;
 					j = 5;
-				} else

board/freescale/ls2080aqds/eth.c static void sgmii_configure_repeater(int serdes_port) · line 208

Quoted 10 lines
board/freescale/ls2080aqds/eth.c +2 -0
+				} else {
 					printf("DPMAC %d :PHY is failed to ",
 					       dpmac_id);
 					printf("configure the repeater 0x%x\n",
 					       value);
 				}
+			}
 		}
 	}
 error:

Thanks for finding this. This is being addressed by
http://patchwork.ozlabs.org/patch/682885/. Currently in my test queue.

York

#3 lore raw

PATCH 2/12 mtd: cfi_flash: fix indentation

In reply to Andre Przywara

The indentation is misleading here and suggests that the write command will be only executed in the else clause.
It seems like this is not intended, so fix the indentation to avoid both compiler warnings and puzzled readers.

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

---
 drivers/mtd/cfi_flash.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/cfi_flash.c +2 -2
index 33c4a93..e036b88 100644
@@ -1456,8 +1456,8 @@ static int cfi_protect_bugfix(flash_info_t *info, long sector, int prot)
 				cmd = FLASH_CMD_PROTECT_SET;
 			else
 				cmd = FLASH_CMD_PROTECT_CLEAR;
-				flash_write_cmd(info, sector, 0,
-					  FLASH_CMD_PROTECT);
+
+			flash_write_cmd(info, sector, 0, FLASH_CMD_PROTECT);
 			flash_write_cmd(info, sector, 0, cmd);
 			/* re-enable interrupts if necessary */
 			if (flag)
Signature · 1 line
2.8.2
#4 lore raw

PATCH 2/12 mtd: cfi_flash: fix indentation

Quoted 8 lines · Andre Przywara

The indentation is misleading here and suggests that the write command will be only executed in the else clause.
It seems like this is not intended, so fix the indentation to avoid both compiler warnings and puzzled readers.

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

Thanks,
Stefan

#5 lore raw

PATCH 2/12 mtd: cfi_flash: fix indentation

In reply to Andre Przywara
Quoted 18 lines · Andre Przywara

The indentation is misleading here and suggests that the write command will be only executed in the else clause.
It seems like this is not intended, so fix the indentation to avoid both compiler warnings and puzzled readers.

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

---
 drivers/mtd/cfi_flash.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/cfi_flash.c +0 -0
index 33c4a93..e036b88 100644

drivers/mtd/cfi_flash.c static int cfi_protect_bugfix(flash_info_t *info, long sector, int prot) · line 1463

Quoted 10 lines
drivers/mtd/cfi_flash.c +2 -2
@@ -1456,8 +1456,8 @@ static int cfi_protect_bugfix(flash_info_t *info, long sector, int prot)
 				cmd = FLASH_CMD_PROTECT_SET;
 			else
 				cmd = FLASH_CMD_PROTECT_CLEAR;
-				flash_write_cmd(info, sector, 0,
-					  FLASH_CMD_PROTECT);
+
+			flash_write_cmd(info, sector, 0, FLASH_CMD_PROTECT);
 			flash_write_cmd(info, sector, 0, cmd);
 			/* re-enable interrupts if necessary */
 			if (flag)

The new GCC can find this? Nice.

York

#6 lore raw

PATCH 2/12 mtd: cfi_flash: fix indentation

In reply to Andre Przywara
Quoted 9 lines · Andre Przywara

The indentation is misleading here and suggests that the write command will be only executed in the else clause.
It seems like this is not intended, so fix the indentation to avoid both compiler warnings and puzzled readers.

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

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161204/ab18da82/attachment.sig>
#7 lore raw

PATCH 3/12 net: e1000: fix indentation

In reply to Andre Przywara

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.

---
 drivers/net/e1000.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/e1000.c +2 -3
index 3332ad9..875682b 100644
@@ -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 */
Signature · 1 line
2.8.2
#8 lore raw

PATCH 3/12 net: e1000: fix indentation

Quoted 16 lines · Andre Przywara

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.

---
 drivers/net/e1000.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/e1000.c +0 -0
index 3332ad9..875682b 100644

drivers/net/e1000.c e1000_initialize_hardware_bits(struct e1000_hw *hw) · line 1527

Quoted 9 lines
drivers/net/e1000.c +1 -3
@@ -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.

Quoted 11 lines
drivers/net/e1000.c +1 -1
+                       return;
                case e1000_82571:
                case e1000_82572:
                        /* Clear PHY TX compatible mode bits */
--

2.8.2

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#9 lore raw

PATCH 3/12 net: e1000: fix indentation

In reply to Andre Przywara
Quoted 8 lines · Andre Przywara

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161204/bc907821/attachment.sig>
#10 lore raw

PATCH 4/12 net: ldpaa_eth: add missing braces

In reply to Andre Przywara

The error checking makes only sense if the previous line has been executed, so add block braces around the _whole_ then clause.

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

---
 drivers/net/ldpaa_eth/ldpaa_eth.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ldpaa_eth/ldpaa_eth.c +2 -1
index 75b2b6b..4e61700 100644
@@ -420,13 +420,14 @@ static int ldpaa_eth_open(struct eth_device *net_dev, bd_t *bd)
 		goto err_dpmac_setup;
 
 #ifdef CONFIG_PHYLIB
-	if (priv->phydev)
+	if (priv->phydev) {
 		err = phy_startup(priv->phydev);
 		if (err) {
 			printf("%s: Could not initialize\n",
 			       priv->phydev->dev->name);
 			goto err_dpamc_bind;
 		}
+	}
 #else
 	priv->phydev = (struct phy_device *)malloc(sizeof(struct phy_device));
 	memset(priv->phydev, 0, sizeof(struct phy_device));
Signature · 1 line
2.8.2
#11 lore raw

PATCH 4/12 net: ldpaa_eth: add missing braces

Quoted 21 lines · Andre Przywara

The error checking makes only sense if the previous line has been executed, so add block braces around the _whole_ then clause.

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

---
 drivers/net/ldpaa_eth/ldpaa_eth.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ldpaa_eth/ldpaa_eth.c +1 -1
index 75b2b6b..4e61700 100644
@@ -420,13 +420,14 @@ static int ldpaa_eth_open(struct eth_device *net_dev, bd_t *bd)
 		goto err_dpmac_setup;
 
 #ifdef CONFIG_PHYLIB
-	if (priv->phydev)
+	if (priv->phydev) {

drivers/net/ldpaa_eth/ldpaa_eth.c static int ldpaa_eth_open(struct eth_device *net_dev, bd_t *bd) · line 433

Quoted 10 lines
drivers/net/ldpaa_eth/ldpaa_eth.c +1 -0
 		err = phy_startup(priv->phydev);
 		if (err) {
 			printf("%s: Could not initialize\n",
 			       priv->phydev->dev->name);
 			goto err_dpamc_bind;
 		}
+	}
 #else
 	priv->phydev = (struct phy_device *)malloc(sizeof(struct phy_device));
 	memset(priv->phydev, 0, sizeof(struct phy_device));

This is being addressed by http://patchwork.ozlabs.org/patch/690814/.
Currently in my test queue.

York

#12 lore raw

PATCH 5/12 net: rtl8169: remove unneeded definition

In reply to Andre Przywara

The rtl8169_intr_mask variable isn't used anywhere in the code, so just remove it to avoid a GCC 6.2 compiler warning.

---
 drivers/net/rtl8169.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/net/rtl8169.c +0 -3
index a3f4423..5297e30 100644
@@ -339,9 +339,6 @@ struct rtl8169_private {
 
 static struct rtl8169_private *tpc;
 
-static const u16 rtl8169_intr_mask =
-    SYSErr | PCSTimeout | RxUnderrun | RxOverflow | RxFIFOOver | TxErr |
-    TxOK | RxErr | RxOK;
 static const unsigned int rtl8169_rx_config =
     (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift);
 
Signature · 1 line
2.8.2
#14 lore raw

PATCH 5/12 net: rtl8169: remove unneeded definition

In reply to Andre Przywara
Quoted 5 lines · Andre Przywara

The rtl8169_intr_mask variable isn't used anywhere in the code, so just remove it to avoid a GCC 6.2 compiler warning.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161204/d099b686/attachment.sig>
#15 lore raw

PATCH 6/12 marvell: comphy_a3700: fix bitmask

In reply to Andre Przywara

Obviously the mask for the rx and tx select field cannot be right, as it would overlap in one and exceed the 32-bit register in the other case. From looking at the neighbouring bits it looks like the mask should be really 4 bits wide instead of 8.

Pointed out by a GCC 6.2 (default) warning.

---
 drivers/phy/marvell/comphy_a3700.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/phy/marvell/comphy_a3700.h +2 -2
index eb2ed7b..dd60b88 100644
@@ -33,9 +33,9 @@
 #define rb_pin_pu_tx			BIT(18)
 #define rb_pin_tx_idle			BIT(19)
 #define rf_gen_rx_sel_shift		22
-#define rf_gen_rx_select		(0xFF << rf_gen_rx_sel_shift)
+#define rf_gen_rx_select		(0x0F << rf_gen_rx_sel_shift)
 #define rf_gen_tx_sel_shift		26
-#define rf_gen_tx_select		(0xFF << rf_gen_tx_sel_shift)
+#define rf_gen_tx_select		(0x0F << rf_gen_tx_sel_shift)
 #define rb_phy_rx_init			BIT(30)
 
 #define COMPHY_PHY_STAT1_ADDR(lane)	MVEBU_REG(0x018318 + (lane) * 0x28)
Signature · 1 line
2.8.2
#16 lore raw

PATCH 6/12 marvell: comphy_a3700: fix bitmask

(Adding a few Marvell people to Cc)

Quoted 18 lines · Andre Przywara

Obviously the mask for the rx and tx select field cannot be right, as it would overlap in one and exceed the 32-bit register in the other case. From looking at the neighbouring bits it looks like the mask should be really 4 bits wide instead of 8.

Pointed out by a GCC 6.2 (default) warning.

---
 drivers/phy/marvell/comphy_a3700.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/phy/marvell/comphy_a3700.h +0 -0
index eb2ed7b..dd60b88 100644
@@ -33,9 +33,9 @@
 #define rb_pin_pu_tx			BIT(18)

drivers/phy/marvell/comphy_a3700.h line 41

Quoted 10 lines
drivers/phy/marvell/comphy_a3700.h +2 -2
 #define rb_pin_tx_idle			BIT(19)
 #define rf_gen_rx_sel_shift		22
-#define rf_gen_rx_select		(0xFF << rf_gen_rx_sel_shift)
+#define rf_gen_rx_select		(0x0F << rf_gen_rx_sel_shift)
 #define rf_gen_tx_sel_shift		26
-#define rf_gen_tx_select		(0xFF << rf_gen_tx_sel_shift)
+#define rf_gen_tx_select		(0x0F << rf_gen_tx_sel_shift)
 #define rb_phy_rx_init			BIT(30)
 
 #define COMPHY_PHY_STAT1_ADDR(lane)	MVEBU_REG(0x018318 + (lane) * 0x28)

Looks good to me, so:

Thanks,
Stefan

#17 lore raw

PATCH 6/12 marvell: comphy_a3700: fix bitmask

Agree, both fields are 4 bits wide.

Kosta

-----Original Message-----
From: Stefan Roese [mailto:sr at denx.de]
Sent: Wednesday, November 16, 2016 13:32
To: Andre Przywara
Cc: u-boot at lists.denx.de; Nadav Haklai; Kostya Porotchkin; Hanna Hawa
Subject: Re: [PATCH 06/12] marvell: comphy_a3700: fix bitmask

(Adding a few Marvell people to Cc)

Quoted 19 lines · Andre Przywara

Obviously the mask for the rx and tx select field cannot be right, as it would overlap in one and exceed the 32-bit register in the other case. From looking at the neighbouring bits it looks like the mask should be really 4 bits wide instead of 8.

Pointed out by a GCC 6.2 (default) warning.

---
 drivers/phy/marvell/comphy_a3700.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/phy/marvell/comphy_a3700.h +0 -0
index eb2ed7b..dd60b88 100644
@@ -33,9 +33,9 @@
 #define rb_pin_pu_tx			BIT(18)

drivers/phy/marvell/comphy_a3700.h line 41

Quoted 10 lines
drivers/phy/marvell/comphy_a3700.h +2 -2
 #define rb_pin_tx_idle			BIT(19)
 #define rf_gen_rx_sel_shift		22
-#define rf_gen_rx_select		(0xFF << rf_gen_rx_sel_shift)
+#define rf_gen_rx_select		(0x0F << rf_gen_rx_sel_shift)
 #define rf_gen_tx_sel_shift		26
-#define rf_gen_tx_select		(0xFF << rf_gen_tx_sel_shift)
+#define rf_gen_tx_select		(0x0F << rf_gen_tx_sel_shift)
 #define rb_phy_rx_init			BIT(30)
 
 #define COMPHY_PHY_STAT1_ADDR(lane)	MVEBU_REG(0x018318 + (lane) * 0x28)

Looks good to me, so:

Thanks,
Stefan

#18 lore raw

PATCH 6/12 marvell: comphy_a3700: fix bitmask

In reply to Andre Przywara
Quoted 10 lines · Andre Przywara

Obviously the mask for the rx and tx select field cannot be right, as it would overlap in one and exceed the 32-bit register in the other case. From looking at the neighbouring bits it looks like the mask should be really 4 bits wide instead of 8.

Pointed out by a GCC 6.2 (default) warning.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161204/d24a48bd/attachment.sig>
#19 lore raw

PATCH 7/12 usb: eth: r8152_fw: fix indentation

In reply to Andre Przywara

Apparently the indentation is wrong here, fix this to avoid compiler warnings and puzzled readers.

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

---
 drivers/usb/eth/r8152_fw.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/usb/eth/r8152_fw.c +4 -4
index b6c8228..81c3754 100644
@@ -871,10 +871,10 @@ void r8153_firmware(struct r8152 *tp)
 	} else if (tp->version == RTL_VER_04) {
 		r8153_pre_ram_code(tp, 0x7001);
 
-	for (i = 0; i < ARRAY_SIZE(r8153_ram_code_bc); i += 2)
-		ocp_write_word(tp, MCU_TYPE_PLA,
-			       r8153_ram_code_bc[i],
-			       r8153_ram_code_bc[i+1]);
+		for (i = 0; i < ARRAY_SIZE(r8153_ram_code_bc); i += 2)
+			ocp_write_word(tp, MCU_TYPE_PLA,
+				       r8153_ram_code_bc[i],
+				       r8153_ram_code_bc[i+1]);
 
 		r8153_post_ram_code(tp);
 
Signature · 1 line
2.8.2
#20 lore raw

PATCH 7/12 usb: eth: r8152_fw: fix indentation

Quoted 6 lines · Andre Przywara

Apparently the indentation is wrong here, fix this to avoid compiler warnings and puzzled readers.

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

Quoted 24 lines
---
 drivers/usb/eth/r8152_fw.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/usb/eth/r8152_fw.c +4 -4
index b6c8228..81c3754 100644
@@ -871,10 +871,10 @@ void r8153_firmware(struct r8152 *tp)
 	} else if (tp->version == RTL_VER_04) {
 		r8153_pre_ram_code(tp, 0x7001);
 
-	for (i = 0; i < ARRAY_SIZE(r8153_ram_code_bc); i += 2)
-		ocp_write_word(tp, MCU_TYPE_PLA,
-			       r8153_ram_code_bc[i],
-			       r8153_ram_code_bc[i+1]);
+		for (i = 0; i < ARRAY_SIZE(r8153_ram_code_bc); i += 2)
+			ocp_write_word(tp, MCU_TYPE_PLA,
+				       r8153_ram_code_bc[i],
+				       r8153_ram_code_bc[i+1]);
 
 		r8153_post_ram_code(tp);
 
Signature · 2 lines
Best regards,
Marek Vasut
#22 lore raw

PATCH 7/12 usb: eth: r8152_fw: fix indentation

In reply to Andre Przywara
Quoted 8 lines · Andre Przywara

Apparently the indentation is wrong here, fix this to avoid compiler warnings and puzzled readers.

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

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161204/55cbac36/attachment.sig>
#23 lore raw

PATCH 8/12 davinci: da8xxevm: fix indentation

In reply to Andre Przywara

Apparently the indentation is wrong in this case, as the second message should be printed indepdently of the if statement.

Fix this indentation to avoid both compiler warnings and puzzled readers.

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

---
 board/davinci/da8xxevm/da850evm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
board/davinci/da8xxevm/da850evm.c +2 -2
index 50223f4..52f914d 100644
@@ -164,7 +164,7 @@ int misc_init_r(void)
 		    memcmp(env_enetaddr, buff, 6))
 			printf("Warning: MAC address in SPI flash don't match "
 					"with the MAC address in the environment\n");
-			printf("Default using MAC address from environment\n");
+		printf("Default using MAC address from environment\n");
 	}
 #endif
 	uint8_t enetaddr[8];
@@ -190,7 +190,7 @@ int misc_init_r(void)
 		if (eeprom_mac_read && memcmp(enetaddr, env_enetaddr, 6))
 			printf("Warning: MAC address in EEPROM don't match "
 					"with the MAC address in the environment\n");
-			printf("Default using MAC address from environment\n");
+		printf("Default using MAC address from environment\n");
 	}
 
 #endif
Signature · 1 line
2.8.2
#24 lore raw

PATCH 8/12 davinci: da8xxevm: fix indentation

Quoted 8 lines · Andre Przywara

Apparently the indentation is wrong in this case, as the second message should be printed indepdently of the if statement.

Fix this indentation to avoid both compiler warnings and puzzled readers.

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

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161204/4ae818c8/attachment.sig>
#25 lore raw

PATCH 9/12 phy: micrel: add missing braces

In reply to Andre Przywara

The error checking makes only sense if the previous line has been executed, so add block braces around the _whole_ then clause.

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

---
 drivers/net/phy/micrel.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/phy/micrel.c +2 -1
index 9ea3105..afcd1a6 100644
@@ -300,10 +300,11 @@ static int ksz9021_of_config(struct phy_device *phydev)
 	};
 	int i, ret = 0;
 
-	for (i = 0; i < ARRAY_SIZE(ofcfg); i++)
+	for (i = 0; i < ARRAY_SIZE(ofcfg); i++) {
 		ret = ksz90x1_of_config_group(phydev, &(ofcfg[i]));
 		if (ret)
 			return ret;
+	}
 
 	return 0;
 }
Signature · 1 line
2.8.2
#26 lore raw

PATCH 9/12 phy: micrel: add missing braces

Quoted 6 lines · Andre Przywara

The error checking makes only sense if the previous line has been executed, so add block braces around the _whole_ then clause.

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

Already fixed

https://patchwork.ozlabs.org/patch/694537/

Quoted 22 lines
---
 drivers/net/phy/micrel.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/phy/micrel.c +2 -1
index 9ea3105..afcd1a6 100644
@@ -300,10 +300,11 @@ static int ksz9021_of_config(struct phy_device *phydev)
 	};
 	int i, ret = 0;
 
-	for (i = 0; i < ARRAY_SIZE(ofcfg); i++)
+	for (i = 0; i < ARRAY_SIZE(ofcfg); i++) {
 		ret = ksz90x1_of_config_group(phydev, &(ofcfg[i]));
 		if (ret)
 			return ret;
+	}
 
 	return 0;
 }
Signature · 2 lines
Best regards,
Marek Vasut
#27 lore raw

PATCH 10/12 cmd: tpm_test: fix indentation

In reply to Andre Przywara

The final line with the linefeeds should obviously only printed once (what the code actually does), but the indentation suggests otherwise.

Fix the indentation to avoid compiler warnings and puzzled readers.

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

---
 cmd/tpm_test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
cmd/tpm_test.c +2 -2
index 65332d1..576e4fb 100644
@@ -539,8 +539,8 @@ static int do_tpmtest(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 		for (i = 0; i < argc; i++)
 			printf(" %s", argv[i]);
-			printf("\n------\n");
-		} while (0);
+		printf("\n------\n");
+	} while (0);
 	argc--;
 	argv++;
 	c = find_cmd_tbl(argv[0], cmd_cros_tpm_sub,
Signature · 1 line
2.8.2
#28 lore raw

PATCH 10/12 cmd: tpm_test: fix indentation

Quoted 11 lines · Andre Przywara

The final line with the linefeeds should obviously only printed once (what the code actually does), but the indentation suggests otherwise.

Fix the indentation to avoid compiler warnings and puzzled readers.

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

---
 cmd/tpm_test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
#29 lore raw

PATCH 11/12 Xilinx ZynqMP: fix minimum SDHCI frequency

In reply to Andre Przywara

It seems pretty odd that the minimum supported SDHCI frequency is the maximum frequency shifted _left_ by 9 bits. Shifting it right by that amount seems to make much more sense.

Pointed out by GCC 6.2 as the value needs more than 32 bits.

---
 include/configs/xilinx_zynqmp_ep.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/xilinx_zynqmp_ep.h +1 -1
index 8e4b960..d0ce768 100644
@@ -14,7 +14,7 @@
 #define __CONFIG_ZYNQMP_EP_H
 
 #define CONFIG_ZYNQ_SDHCI_MAX_FREQ	52000000
-#define CONFIG_ZYNQ_SDHCI_MIN_FREQ	(CONFIG_ZYNQ_SDHCI_MAX_FREQ << 9)
+#define CONFIG_ZYNQ_SDHCI_MIN_FREQ	(CONFIG_ZYNQ_SDHCI_MAX_FREQ >> 9)
 #define CONFIG_ZYNQ_EEPROM
 #define CONFIG_SATA_CEVA
 #define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR, \
Signature · 1 line
2.8.2
#30 lore raw

PATCH 11/12 Xilinx ZynqMP: fix minimum SDHCI frequency

Hi,

Quoted 17 lines · Andre Przywara

It seems pretty odd that the minimum supported SDHCI frequency is the maximum frequency shifted _left_ by 9 bits. Shifting it right by that amount seems to make much more sense.

Pointed out by GCC 6.2 as the value needs more than 32 bits.

---
 include/configs/xilinx_zynqmp_ep.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/xilinx_zynqmp_ep.h +0 -0
index 8e4b960..d0ce768 100644

include/configs/xilinx_zynqmp_ep.h line 20

Quoted 8 lines
include/configs/xilinx_zynqmp_ep.h +1 -1
@@ -14,7 +14,7 @@
 #define __CONFIG_ZYNQMP_EP_H
 
 #define CONFIG_ZYNQ_SDHCI_MAX_FREQ	52000000
-#define CONFIG_ZYNQ_SDHCI_MIN_FREQ	(CONFIG_ZYNQ_SDHCI_MAX_FREQ << 9)
+#define CONFIG_ZYNQ_SDHCI_MIN_FREQ	(CONFIG_ZYNQ_SDHCI_MAX_FREQ >> 9)
 #define CONFIG_ZYNQ_EEPROM
 #define CONFIG_SATA_CEVA
 #define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR, \

thanks for the patch. We have fixed that in our internal repo but didn't send this out yet.

Here is the link
https://github.com/Xilinx/u-boot-xlnx/commit/299ceaf77ee6d5a555ecb5f129bd9248aa981837

Definitely it is good patch and will apply.

Thanks,
Michal

#31 lore raw

PATCH 11/12 Xilinx ZynqMP: fix minimum SDHCI frequency

Quoted 32 lines · Michal Simek

Hi,

Quoted 17 lines · Andre Przywara

It seems pretty odd that the minimum supported SDHCI frequency is the maximum frequency shifted _left_ by 9 bits. Shifting it right by that amount seems to make much more sense.

Pointed out by GCC 6.2 as the value needs more than 32 bits.

---
 include/configs/xilinx_zynqmp_ep.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/xilinx_zynqmp_ep.h +0 -0
index 8e4b960..d0ce768 100644

include/configs/xilinx_zynqmp_ep.h line 20

Quoted 8 lines
include/configs/xilinx_zynqmp_ep.h +1 -1
@@ -14,7 +14,7 @@
 #define __CONFIG_ZYNQMP_EP_H
 
 #define CONFIG_ZYNQ_SDHCI_MAX_FREQ	52000000
-#define CONFIG_ZYNQ_SDHCI_MIN_FREQ	(CONFIG_ZYNQ_SDHCI_MAX_FREQ << 9)
+#define CONFIG_ZYNQ_SDHCI_MIN_FREQ	(CONFIG_ZYNQ_SDHCI_MAX_FREQ >> 9)
 #define CONFIG_ZYNQ_EEPROM
 #define CONFIG_SATA_CEVA
 #define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR, \

thanks for the patch. We have fixed that in our internal repo but didn't send this out yet.

Quoted 4 lines

Here is the link
https://github.com/Xilinx/u-boot-xlnx/commit/299ceaf77ee6d5a555ecb5f129bd9248aa981837

Definitely it is good patch and will apply.

ok - it is already the part of my pull request I sent yesterday
http://lists.denx.de/pipermail/u-boot/2016-November/272771.html

Thanks,
Michal

#32 lore raw

PATCH 11/12 Xilinx ZynqMP: fix minimum SDHCI frequency

On 16/11/16 06:37, Michal Simek wrote:

Hi Michal,

Quoted 33 lines · Michal Simek
Quoted 32 lines

Hi,

Quoted 17 lines · Andre Przywara

It seems pretty odd that the minimum supported SDHCI frequency is the maximum frequency shifted _left_ by 9 bits. Shifting it right by that amount seems to make much more sense.

Pointed out by GCC 6.2 as the value needs more than 32 bits.

---
 include/configs/xilinx_zynqmp_ep.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/xilinx_zynqmp_ep.h +0 -0
index 8e4b960..d0ce768 100644

include/configs/xilinx_zynqmp_ep.h line 20

Quoted 8 lines
include/configs/xilinx_zynqmp_ep.h +1 -1
@@ -14,7 +14,7 @@
 #define __CONFIG_ZYNQMP_EP_H
 
 #define CONFIG_ZYNQ_SDHCI_MAX_FREQ	52000000
-#define CONFIG_ZYNQ_SDHCI_MIN_FREQ	(CONFIG_ZYNQ_SDHCI_MAX_FREQ << 9)
+#define CONFIG_ZYNQ_SDHCI_MIN_FREQ	(CONFIG_ZYNQ_SDHCI_MAX_FREQ >> 9)
 #define CONFIG_ZYNQ_EEPROM
 #define CONFIG_SATA_CEVA
 #define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR, \

thanks for the patch. We have fixed that in our internal repo but didn't send this out yet.

Quoted 7 lines
Quoted 4 lines

Here is the link
https://github.com/Xilinx/u-boot-xlnx/commit/299ceaf77ee6d5a555ecb5f129bd9248aa981837

Definitely it is good patch and will apply.

ok - it is already the part of my pull request I sent yesterday
http://lists.denx.de/pipermail/u-boot/2016-November/272771.html

Even better!
Out of curiosity: How did you spot this? Was is actually causing problems or was it GCC 6.x as well?

Anyway glad to see it fixed already.

Cheers,
Andre.

#33 lore raw

PATCH 11/12 Xilinx ZynqMP: fix minimum SDHCI frequency

Quoted 42 lines · Andr? Przywara

On 16/11/16 06:37, Michal Simek wrote:

Hi Michal,

Quoted 38 lines · Michal Simek
Quoted 36 lines

Hi,

Quoted 17 lines · Andre Przywara

It seems pretty odd that the minimum supported SDHCI frequency is the maximum frequency shifted _left_ by 9 bits. Shifting it right by that amount seems to make much more sense.

Pointed out by GCC 6.2 as the value needs more than 32 bits.

---
 include/configs/xilinx_zynqmp_ep.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/xilinx_zynqmp_ep.h +0 -0
index 8e4b960..d0ce768 100644

include/configs/xilinx_zynqmp_ep.h line 20

Quoted 8 lines
include/configs/xilinx_zynqmp_ep.h +1 -1
@@ -14,7 +14,7 @@
 #define __CONFIG_ZYNQMP_EP_H
 
 #define CONFIG_ZYNQ_SDHCI_MAX_FREQ	52000000
-#define CONFIG_ZYNQ_SDHCI_MIN_FREQ	(CONFIG_ZYNQ_SDHCI_MAX_FREQ << 9)
+#define CONFIG_ZYNQ_SDHCI_MIN_FREQ	(CONFIG_ZYNQ_SDHCI_MAX_FREQ >> 9)
 #define CONFIG_ZYNQ_EEPROM
 #define CONFIG_SATA_CEVA
 #define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR, \

thanks for the patch. We have fixed that in our internal repo but didn't send this out yet.

Here is the link
https://github.com/Xilinx/u-boot-xlnx/commit/299ceaf77ee6d5a555ecb5f129bd9248aa981837

Definitely it is good patch and will apply.

Quoted 8 lines
Quoted 2 lines

ok - it is already the part of my pull request I sent yesterday
http://lists.denx.de/pipermail/u-boot/2016-November/272771.html

Even better!
Out of curiosity: How did you spot this? Was is actually causing problems or was it GCC 6.x as well?

Anyway glad to see it fixed already.

Yes, it was causing the problem on emulation platform which hasn't been detected by testing.

Thanks,
Michal

#34 lore raw

PATCH 12/12 usb: gadget: remove unused shortname variable

In reply to Andre Przywara

The shortname variable isn't referenced anywhere in the code, so just remove it.

Pointed out by a GCC 6.2 default warning option.

---
 drivers/usb/gadget/ether.c | 1 -
 1 file changed, 1 deletion(-)
drivers/usb/gadget/ether.c +0 -1
index 497b981..a210d33 100644
@@ -76,7 +76,6 @@ unsigned packet_received, packet_sent;
 /* Based on linux 2.6.27 version */
 #define DRIVER_VERSION		"May Day 2005"
 
-static const char shortname[] = "ether";
 static const char driver_desc[] = DRIVER_DESC;
 
 #define RX_EXTRA	20		/* guard against rx overflows */
Signature · 1 line
2.8.2
#35 lore raw

PATCH 12/12 usb: gadget: remove unused shortname variable

Quoted 16 lines · Andre Przywara

The shortname variable isn't referenced anywhere in the code, so just remove it.

Pointed out by a GCC 6.2 default warning option.

---
 drivers/usb/gadget/ether.c | 1 -
 1 file changed, 1 deletion(-)
drivers/usb/gadget/ether.c +0 -0
index 497b981..a210d33 100644

drivers/usb/gadget/ether.c unsigned packet_received, packet_sent; · line 81

Quoted 7 lines
drivers/usb/gadget/ether.c +0 -1
@@ -76,7 +76,6 @@ unsigned packet_received, packet_sent;
 /* Based on linux 2.6.27 version */
 #define DRIVER_VERSION		"May Day 2005"
 
-static const char shortname[] = "ether";
 static const char driver_desc[] = DRIVER_DESC;
 
 #define RX_EXTRA	20		/* guard against rx overflows */
Signature · 2 lines
Best regards,
Marek Vasut
#36 lore raw

PATCH 12/12 usb: gadget: remove unused shortname variable

In reply to Andre Przywara

Hi Andre,

Quoted 22 lines

The shortname variable isn't referenced anywhere in the code, so just remove it.

Pointed out by a GCC 6.2 default warning option.

---
 drivers/usb/gadget/ether.c | 1 -
 1 file changed, 1 deletion(-)
drivers/usb/gadget/ether.c +0 -1
index 497b981..a210d33 100644
@@ -76,7 +76,6 @@ unsigned packet_received, packet_sent;
 /* Based on linux 2.6.27 version */
 #define DRIVER_VERSION		"May Day 2005"
 
-static const char shortname[] = "ether";
 static const char driver_desc[] = DRIVER_DESC;
 
 #define RX_EXTRA	20		/* guard against rx
Quoted 1 line

overflows */

Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
#37 lore raw

PATCH 12/12 usb: gadget: remove unused shortname variable

In reply to Andre Przywara
Quoted 8 lines · Andre Przywara

The shortname variable isn't referenced anywhere in the code, so just remove it.

Pointed out by a GCC 6.2 default warning option.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161204/c6f55b9f/attachment.sig>
#38 lore raw

PATCH 12/12 usb: gadget: remove unused shortname variable

In reply to Andre Przywara
Quoted 8 lines · Andre Przywara

The shortname variable isn't referenced anywhere in the code, so just remove it.

Pointed out by a GCC 6.2 default warning option.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161204/47fb8783/attachment.sig>