Fix GCC 6.2 compiler warnings
Subsystems (6)
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
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
@@ -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
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.Signed-off-by Andre Przywara <[email protected]>--- board/freescale/ls2080aqds/eth.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)board/freescale/ls2080aqds/eth.c +0
-1@@ -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
PATCH 2/12 mtd: cfi_flash: fix indentation
In reply to Andre PrzywaraThe 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
@@ -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
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.
Signed-off-by Andre Przywara <[email protected]>
Thanks,
Stefan
PATCH 2/12 mtd: cfi_flash: fix indentation
In reply to Andre PrzywaraQuoted 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.
Signed-off-by Andre Przywara <[email protected]>--- drivers/mtd/cfi_flash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/mtd/cfi_flash.c +0
-0
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
PATCH 2/12 mtd: cfi_flash: fix indentation
In reply to Andre PrzywaraQuoted 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.
Signed-off-by Andre Przywara <[email protected]>Reviewed-by Stefan Roese <[email protected]>
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>
PATCH 3/12 net: e1000: fix indentation
In reply to Andre PrzywaraApparently 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
@@ -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
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.
Signed-off-by Andre Przywara <[email protected]>--- drivers/net/e1000.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)drivers/net/e1000.c +0
-0
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
PATCH 3/12 net: e1000: fix indentation
In reply to Andre PrzywaraQuoted 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.
Signed-off-by Andre Przywara <[email protected]>Acked-by Joe Hershberger <[email protected]>
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>
PATCH 4/12 net: ldpaa_eth: add missing braces
In reply to Andre PrzywaraThe 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
@@ -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
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.
Signed-off-by Andre Przywara <[email protected]>--- drivers/net/ldpaa_eth/ldpaa_eth.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/ldpaa_eth/ldpaa_eth.c +1
-1@@ -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
-0err =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
PATCH 5/12 net: rtl8169: remove unneeded definition
In reply to Andre PrzywaraThe 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
@@ -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
PATCH 5/12 net: rtl8169: remove unneeded definition
Quoted 4 lines · Andre Przywara
The
rtl8169_intr_maskvariable isn't used anywhere in the code, so just remove it to avoid a GCC 6.2 compiler warning.Signed-off-by Andre Przywara <[email protected]>
PATCH 5/12 net: rtl8169: remove unneeded definition
In reply to Andre PrzywaraQuoted 5 lines · Andre Przywara
The
rtl8169_intr_maskvariable isn't used anywhere in the code, so just remove it to avoid a GCC 6.2 compiler warning.Signed-off-by Andre Przywara <[email protected]>Acked-by Joe Hershberger <[email protected]>
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>
PATCH 6/12 marvell: comphy_a3700: fix bitmask
In reply to Andre PrzywaraObviously 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
@@ -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
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.
Signed-off-by Andre Przywara <[email protected]>--- drivers/phy/marvell/comphy_a3700.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/phy/marvell/comphy_a3700.h +0
-0@@ -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
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.
Signed-off-by Andre Przywara <[email protected]>--- drivers/phy/marvell/comphy_a3700.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/phy/marvell/comphy_a3700.h +0
-0@@ -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
PATCH 6/12 marvell: comphy_a3700: fix bitmask
In reply to Andre PrzywaraQuoted 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.
Signed-off-by Andre Przywara <[email protected]>Reviewed-by Stefan Roese <[email protected]>Reviewed-by Stefan Roese <[email protected]>
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>
PATCH 7/12 usb: eth: r8152_fw: fix indentation
In reply to Andre PrzywaraApparently 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
@@ -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
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.
Signed-off-by Andre Przywara <[email protected]>
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@@ -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
PATCH 7/12 usb: eth: r8152_fw: fix indentation
In reply to Andre PrzywaraQuoted 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.
Signed-off-by Andre Przywara <[email protected]>
PATCH 7/12 usb: eth: r8152_fw: fix indentation
In reply to Andre PrzywaraQuoted 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.
Signed-off-by Andre Przywara <[email protected]>Reviewed-by Marek Vasut <[email protected]>Acked-by Joe Hershberger <[email protected]>
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>
PATCH 8/12 davinci: da8xxevm: fix indentation
In reply to Andre PrzywaraApparently 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
@@ -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
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.
Signed-off-by Andre Przywara <[email protected]>
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>
PATCH 9/12 phy: micrel: add missing braces
In reply to Andre PrzywaraThe 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
@@ -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
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.
Signed-off-by Andre Przywara <[email protected]>
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@@ -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
PATCH 10/12 cmd: tpm_test: fix indentation
In reply to Andre PrzywaraThe 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
@@ -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
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.
Signed-off-by Andre Przywara <[email protected]>--- cmd/tpm_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
PATCH 11/12 Xilinx ZynqMP: fix minimum SDHCI frequency
In reply to Andre PrzywaraIt 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
@@ -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
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.
Signed-off-by Andre Przywara <[email protected]>--- include/configs/xilinx_zynqmp_ep.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/configs/xilinx_zynqmp_ep.h +0
-0
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
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.
Signed-off-by Andre Przywara <[email protected]>--- include/configs/xilinx_zynqmp_ep.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/configs/xilinx_zynqmp_ep.h +0
-0include/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/299ceaf77ee6d5a555ecb5f129bd9248aa981837Definitely 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
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.
Signed-off-by Andre Przywara <[email protected]>--- include/configs/xilinx_zynqmp_ep.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/configs/xilinx_zynqmp_ep.h +0
-0include/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/299ceaf77ee6d5a555ecb5f129bd9248aa981837Definitely 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.
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.
Signed-off-by Andre Przywara <[email protected]>--- include/configs/xilinx_zynqmp_ep.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/configs/xilinx_zynqmp_ep.h +0
-0include/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/299ceaf77ee6d5a555ecb5f129bd9248aa981837Definitely 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.htmlEven 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
PATCH 12/12 usb: gadget: remove unused shortname variable
In reply to Andre PrzywaraThe 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
@@ -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
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.
Signed-off-by Andre Przywara <[email protected]>--- drivers/usb/gadget/ether.c | 1 - 1 file changed, 1 deletion(-)drivers/usb/gadget/ether.c +0
-0
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
PATCH 12/12 usb: gadget: remove unused shortname variable
In reply to Andre PrzywaraHi 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.
Signed-off-by Andre Przywara <[email protected]>--- drivers/usb/gadget/ether.c | 1 - 1 file changed, 1 deletion(-)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
Quoted 1 line
overflows */
Signature · 5 lines
Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
PATCH 12/12 usb: gadget: remove unused shortname variable
In reply to Andre PrzywaraQuoted 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.
Signed-off-by Andre Przywara <[email protected]>Reviewed-by Marek Vasut <[email protected]>Acked-by Lukasz Majewski <[email protected]>
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>
PATCH 12/12 usb: gadget: remove unused shortname variable
In reply to Andre PrzywaraQuoted 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.
Signed-off-by Andre Przywara <[email protected]>Reviewed-by Marek Vasut <[email protected]>Acked-by Lukasz Majewski <[email protected]>
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>