eth-raw-os.c: Add cast to bind(2) call
Subsystems (3)
PATCH 1/4 eth-raw-os.c: Add cast to bind(2) call
With more recent gcc versions we otherwise get an error like:
note: expected 'const struct sockaddr *' but argument is of type 'struct sockaddr_in *'
and the common solution here is to cast, rather than re-work the code.
--- arch/sandbox/cpu/eth-raw-os.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/sandbox/cpu/eth-raw-os.c +2 -1
@@ -194,7 +194,8 @@ int sandbox_eth_raw_os_send(void *packet, int length, addr.sin_family =AF_INET ; addr.sin_port = udph->source; addr.sin_addr.s_addr = iph->saddr; - retval =bind (priv->local_bind_sd, &addr,sizeof (addr)); + retval =bind (priv->local_bind_sd, (struct sockaddr *)&addr, +sizeof (addr));if (retval <0 )printf ("Failed to bind: %d %s\n" , errno,strerror (errno));
Signature · 1 line
2.6.2
PATCH 1/4 eth-raw-os.c: Add cast to bind(2) call
Quoted 11 lines · Tom Rini
With more recent gcc versions we otherwise get an error like:
note: expected 'const struct sockaddr *' but argument is of type 'structsockaddr_in*'and the common solution here is to cast, rather than re-work the code.
Cc Joe Hershberger <[email protected]>Cc Simon Glass <[email protected]>Signed-off-by Tom Rini <[email protected]>Reviewed-by Bin Meng <[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: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160115/85b953b2/attachment.sig>
PATCH 2/4 fsl_*_serdes.c: Modify memset call in serdes_init
In reply to Tom RiniGCC 5.x does not like sizeof(array_variable) and errors out. Change these calls to be instead sizeof(u8) (as that's what serdes_prtcl_map is) * SERDES_PRCTL_COUNT (the number of array elements).
--- arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_serdes.c | 2 +- arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch3_serdes.c | 2 +- arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_serdes.c +1 -1
@@ -86,7 +86,7 @@ void serdes_init(u32 sd, u32 sd_addr, u32 sd_prctl_mask, u32 sd_prctl_shift,u32 cfg;int lane; -memset (serdes_prtcl_map,0 ,sizeof (serdes_prtcl_map)); +memset (serdes_prtcl_map,0 ,sizeof (u8) *SERDES_PRCTL_COUNT ); cfg =gur_in32 (&gur->rcwsr[4 ]) & sd_prctl_mask; cfg >>= sd_prctl_shift;
arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch3_serdes.c +1 -1
@@ -74,7 +74,7 @@ void serdes_init(u32 sd, u32 sd_addr, u32 sd_prctl_mask, u32 sd_prctl_shift,u32 cfg;int lane; -memset (serdes_prtcl_map,0 ,sizeof (serdes_prtcl_map)); +memset (serdes_prtcl_map,0 ,sizeof (u8) *SERDES_PRCTL_COUNT ); cfg =gur_in32 (&gur->rcwsr[28 ]) & sd_prctl_mask; cfg >>= sd_prctl_shift;
arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c +1 -1
@@ -184,7 +184,7 @@ void serdes_init(u32 sd, u32 sd_addr, u32 sd_prctl_mask, u32 sd_prctl_shift,u32 cfg;int lane; -memset (serdes_prtcl_map,0 ,sizeof (serdes_prtcl_map)); +memset (serdes_prtcl_map,0 ,sizeof (u8) *SERDES_PRCTL_COUNT );#ifdef CONFIG_SYS_FSL_ERRATUM_A007186 struct ccsr_sfp_regs __iomem *sfp_regs = (struct ccsr_sfp_regs __iomem *)(CONFIG_SYS_SFP_ADDR );
Signature · 1 line
2.6.2
PATCH 2/4 fsl_*_serdes.c: Modify memset call in serdes_init
Quoted 43 lines · Tom Rini
GCC 5.x does not like
sizeof(array_variable)and errors out. Change these calls to be instead sizeof(u8) (as that's whatserdes_prtcl_mapis) *SERDES_PRCTL_COUNT(the number of array elements).Cc York Sun <[email protected]>Signed-off-by Tom Rini <[email protected]>--- arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_serdes.c | 2 +- arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch3_serdes.c | 2 +- arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_serdes.c +1
-1@@ -86,7 +86,7 @@ void serdes_init(u32 sd, u32 sd_addr, u32 sd_prctl_mask, u32 sd_prctl_shift,u32 cfg;int lane; -memset (serdes_prtcl_map,0 ,sizeof (serdes_prtcl_map)); +memset (serdes_prtcl_map,0 ,sizeof (u8) *SERDES_PRCTL_COUNT ); cfg =gur_in32 (&gur->rcwsr[4 ]) & sd_prctl_mask; cfg >>= sd_prctl_shift;arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch3_serdes.c +1
-1@@ -74,7 +74,7 @@ void serdes_init(u32 sd, u32 sd_addr, u32 sd_prctl_mask, u32 sd_prctl_shift,u32 cfg;int lane; -memset (serdes_prtcl_map,0 ,sizeof (serdes_prtcl_map)); +memset (serdes_prtcl_map,0 ,sizeof (u8) *SERDES_PRCTL_COUNT ); cfg =gur_in32 (&gur->rcwsr[28 ]) & sd_prctl_mask; cfg >>= sd_prctl_shift;arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c +0
-0
arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c void serdes_init(u32 sd, u32 sd_addr, u32 sd_prctl_mask, u32 sd_prctl_shift,
Quoted 9 lines
arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c +1
-2@@ -184,7 +184,7 @@ void serdes_init(u32 sd, u32 sd_addr, u32 sd_prctl_mask, u32 sd_prctl_shift,u32 cfg;int lane; -memset (serdes_prtcl_map,0 ,sizeof (serdes_prtcl_map)); +memset (serdes_prtcl_map,0 ,sizeof (u8) *SERDES_PRCTL_COUNT );#ifdef CONFIG_SYS_FSL_ERRATUM_A007186 struct ccsr_sfp_regs __iomem *sfp_regs = (struct ccsr_sfp_regs __iomem *)(CONFIG_SYS_SFP_ADDR ); --
York Sun
AppliedPATCH 2/4 fsl_*_serdes.c: Modify memset call in serdes_init
In reply to Tom RiniQuoted 7 lines · Tom Rini
GCC 5.x does not like
sizeof(array_variable)and errors out. Change these calls to be instead sizeof(u8) (as that's whatserdes_prtcl_mapis) *SERDES_PRCTL_COUNT(the number of array elements).Cc York Sun <[email protected]>Signed-off-by Tom Rini <[email protected]>---
Applied to fsl-qoriq master. Awaiting upstream.
York
PATCH 3/4 qbman_portal.c: Update BUG_ON() call in qbman_swp_mc_submit
In reply to Tom RiniWith gcc-5.x we get a warning about the ambiguity of BUG_ON(!a != b) and becomes BUG_ON((!a) != b). In this case reading of the function leads to us wanting to rewrite this as BUG_ON(a != b).
--- drivers/net/fsl-mc/dpio/qbman_portal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/fsl-mc/dpio/qbman_portal.c +1 -1
@@ -117,7 +117,7 @@ void qbman_swp_mc_submit(struct qbman_swp *p, void *cmd, uint32_t cmd_verb) {uint32_t *v = cmd;#ifdef QBMAN_CHECKING -BUG_ON (!p->mc.check != swp_mc_can_submit); +BUG_ON (p->mc.check != swp_mc_can_submit);#endif lwsync ();/* TBD: "|=" is going to hurt performance. Need to move as many fields
Signature · 1 line
2.6.2
PATCH 3/4 qbman_portal.c: Update BUG_ON() call in qbman_swp_mc_submit
Quoted 19 lines · Tom Rini
With gcc-5.x we get a warning about the ambiguity of
BUG_ON(!a != b)and becomesBUG_ON((!a) != b). In this case reading of the function leads to us wanting to rewrite this asBUG_ON(a != b).Cc Prabhakar Kushwaha <[email protected]>Cc Geoff Thorpe <[email protected]>Cc Haiying Wang <[email protected]>Cc Roy Pledge <[email protected]>Cc York Sun <[email protected]>Signed-off-by Tom Rini <[email protected]>--- drivers/net/fsl-mc/dpio/qbman_portal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/fsl-mc/dpio/qbman_portal.c +0
-0
drivers/net/fsl-mc/dpio/qbman_portal.c void qbman_swp_mc_submit(struct qbman_swp *p, void *cmd, uint32_t cmd_verb)
Quoted 9 lines
drivers/net/fsl-mc/dpio/qbman_portal.c +1
-2@@ -117,7 +117,7 @@ void qbman_swp_mc_submit(struct qbman_swp *p, void *cmd, uint32_t cmd_verb) {uint32_t *v = cmd;#ifdef QBMAN_CHECKING -BUG_ON (!p->mc.check != swp_mc_can_submit); +BUG_ON (p->mc.check != swp_mc_can_submit);#endif lwsync ();/* TBD: "|=" is going to hurt performance. Need to move as many fields --
York Sun
AppliedPATCH 3/4 qbman_portal.c: Update BUG_ON() call in qbman_swp_mc_submit
In reply to Tom RiniQuoted 11 lines · Tom Rini
With gcc-5.x we get a warning about the ambiguity of
BUG_ON(!a != b)and becomesBUG_ON((!a) != b). In this case reading of the function leads to us wanting to rewrite this asBUG_ON(a != b).Cc Prabhakar Kushwaha <[email protected]>Cc Geoff Thorpe <[email protected]>Cc Haiying Wang <[email protected]>Cc Roy Pledge <[email protected]>Cc York Sun <[email protected]>Signed-off-by Tom Rini <[email protected]>---
Applied to fsl-qoriq master. Awaiting upstream.
York
PATCH 1/4 eth-raw-os.c: Add cast to bind(2) call
In reply to Tom RiniQuoted 18 lines · Tom Rini
With more recent gcc versions we otherwise get an error like:
note: expected 'const struct sockaddr *' but argument is of type 'structsockaddr_in*'and the common solution here is to cast, rather than re-work the code.
Cc Joe Hershberger <[email protected]>Cc Simon Glass <[email protected]>Signed-off-by Tom Rini <[email protected]>--- arch/sandbox/cpu/eth-raw-os.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)arch/sandbox/cpu/eth-raw-os.c +0
-0
arch/sandbox/cpu/eth-raw-os.c int sandbox_eth_raw_os_send(void *packet, int length,
Quoted 10 lines
arch/sandbox/cpu/eth-raw-os.c +2
-2@@ -194,7 +194,8 @@ int sandbox_eth_raw_os_send(void *packet, int length, addr.sin_family =AF_INET ; addr.sin_port = udph->source; addr.sin_addr.s_addr = iph->saddr; - retval =bind (priv->local_bind_sd, &addr,sizeof (addr)); + retval =bind (priv->local_bind_sd, (struct sockaddr *)&addr, +sizeof (addr));if (retval <0 )printf ("Failed to bind: %d %s\n" , errno,strerror (errno)); --
PATCH 1/4 eth-raw-os.c: Add cast to bind(2) call
In reply to Tom RiniQuoted 9 lines · Tom Rini
With more recent gcc versions we otherwise get an error like:
note: expected 'const struct sockaddr *' but argument is of type 'structsockaddr_in*'and the common solution here is to cast, rather than re-work the code.
Cc Joe Hershberger <[email protected]>Cc Simon Glass <[email protected]>Signed-off-by Tom Rini <[email protected]>
PATCH 1/4 eth-raw-os.c: Add cast to bind(2) call
Hi Tom,
Quoted 5 lines · Joe Hershberger
Quoted 4 lines · Tom Rini
With more recent gcc versions we otherwise get an error like:
note: expected 'const struct sockaddr *' but argument is of type 'structsockaddr_in*'
Quoted 7 lines
Quoted 5 lines
and the common solution here is to cast, rather than re-work the code.
Cc Joe Hershberger <[email protected]>Cc Simon Glass <[email protected]>Signed-off-by Tom Rini <[email protected]>Acked-by Joe Hershberger <[email protected]>
I see this patch was assigned to me in patchwork. Patch 2&3 in the same series were applied by York to fsl-qoriq repo and patch 4 was applied by you to u-boot/master. So maybe you can apply this patch directly to u-boot/master?
Regards,
Bin
PATCH 1/4 eth-raw-os.c: Add cast to bind(2) call
Quoted 15 lines · Bin Meng
Hi Tom,
Quoted 11 lines · Joe Hershberger
Quoted 9 lines · Tom Rini
With more recent gcc versions we otherwise get an error like:
note: expected 'const struct sockaddr *' but argument is of type 'structsockaddr_in*'and the common solution here is to cast, rather than re-work the code.
Cc Joe Hershberger <[email protected]>Cc Simon Glass <[email protected]>Signed-off-by Tom Rini <[email protected]>
Quoted 6 lines
Quoted 1 line
Acked-by Joe Hershberger <[email protected]>I see this patch was assigned to me in patchwork. Patch 2&3 in the same series were applied by York to fsl-qoriq repo and patch 4 was applied by you to u-boot/master. So maybe you can apply this patch directly to u-boot/master?
Sure. I think I intended to assign this to Simon instead, sorry. The golden rule about patchwork assignments is I get 'em wrong sometimes, just pass it around if so :)
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160115/3dd881c7/attachment.sig>
PATCH 4/4 arch/arm/cpu/arm920t/ep93xx/led.c: Mark inline functions as static inline
In reply to Tom RiniWith gcc-5.x we get warning about inline non-static functions referring to static elements.
--- arch/arm/cpu/arm920t/ep93xx/led.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/cpu/arm920t/ep93xx/led.c +2 -2
@@ -13,7 +13,7 @@ static uint8_t saved_state[2] = {STATUS_LED_OFF, STATUS_LED_OFF};static uint32_t gpio_pin[2 ] = {1 <<STATUS_LED_GREEN ,1 <<STATUS_LED_RED }; -inline void switch_LED_on (uint8_t led) +static inline void switch_LED_on (uint8_t led) { registerstruct gpio_regs *gpio = (struct gpio_regs *)GPIO_BASE ;
@@ -21,7 +21,7 @@ inline void switch_LED_on(uint8_t led) saved_state[led] =STATUS_LED_ON ; } -inline void switch_LED_off (uint8_t led) +static inline void switch_LED_off (uint8_t led) { registerstruct gpio_regs *gpio = (struct gpio_regs *)GPIO_BASE ;
Signature · 1 line
2.6.2
PATCH 4/4 arch/arm/cpu/arm920t/ep93xx/led.c: Mark inline functions as static inline
Quoted 22 lines · Tom Rini
With gcc-5.x we get warning about inline non-static functions referring to static elements.
Signed-off-by Tom Rini <[email protected]>--- arch/arm/cpu/arm920t/ep93xx/led.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/arm/cpu/arm920t/ep93xx/led.c +1
-1@@ -13,7 +13,7 @@ static uint8_t saved_state[2] = {STATUS_LED_OFF, STATUS_LED_OFF};static uint32_t gpio_pin[2 ] = {1 <<STATUS_LED_GREEN ,1 <<STATUS_LED_RED }; -inline void switch_LED_on (uint8_t led) +static inline void switch_LED_on (uint8_t led) { registerstruct gpio_regs *gpio = (struct gpio_regs *)GPIO_BASE ;
arch/arm/cpu/arm920t/ep93xx/led.c inline void switch_LED_on(uint8_t led)
Quoted 9 lines
arch/arm/cpu/arm920t/ep93xx/led.c +1
-2@@ -21,7 +21,7 @@ inline void switch_LED_on(uint8_t led) saved_state[led] =STATUS_LED_ON ; } -inline void switch_LED_off (uint8_t led) +static inline void switch_LED_off (uint8_t led) { registerstruct gpio_regs *gpio = (struct gpio_regs *)GPIO_BASE ; --
PATCH 4/4 arch/arm/cpu/arm920t/ep93xx/led.c: Mark inline functions as static inline
In reply to Tom RiniQuoted 5 lines · Tom Rini
With gcc-5.x we get warning about inline non-static functions referring to static elements.
Signed-off-by Tom Rini <[email protected]>Reviewed-by Bin Meng <[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: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151206/7d833422/attachment.sig>