stm32mp1: Fix warnings when compiling with W=1
Subsystems (14)
PATCH 1/20 stm32mp1: Fix warnings when compiling with W=1
This patch solves the following warnings:
arch/arm/mach-stm32mp/cpu.c:378:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (instance > ARRAY_SIZE(serial_addr))
^
---
arch/arm/mach-stm32mp/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-stm32mp/cpu.c +1 -1
@@ -366,7 +366,7 @@ static void setup_boot_mode(void)u32 boot_ctx =readl (TAMP_BOOT_CONTEXT );u32 boot_mode = (boot_ctx &TAMP_BOOT_MODE_MASK ) >>TAMP_BOOT_MODE_SHIFT ; -int instance = (boot_mode &TAMP_BOOT_INSTANCE_MASK ) -1 ; +unsigned int instance = (boot_mode &TAMP_BOOT_INSTANCE_MASK ) -1 ;u32 forced_mode = (boot_ctx &TAMP_BOOT_FORCED_MASK );struct udevice *dev;int alias;
Signature · 1 line
2.7.4
PATCH 1/20 stm32mp1: Fix warnings when compiling with W=1
Hi,
Quoted 8 lines
From: Patrick DELAUNAY <[email protected]>
Sent: vendredi 21 juin 2019 15:27This patch solves the following warnings:
arch/arm/mach-stm32mp/cpu.c:378:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (instance >ARRAY_SIZE(serial_addr))
Quoted 9 lines
^Signed-off-by Patrice Chotard <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
arch/arm/mach-stm32mp/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to u-boot-stm32/master, thanks!
Patrick
PATCH 2/20 board: stm32mp1: Fix warnings when compiling with W=1
In reply to Patrick DelaunayThis patch solves the following warnings:
warning: no previous prototype for 'board_quiesce_devices' [-Wmissing-prototypes]
void board_quiesce_devices(void)
^~~~~~~~~~~~~~~~~~~~~
---
board/st/stm32mp1/stm32mp1.c | 1 + 1 file changed, 1 insertion(+)
board/st/stm32mp1/stm32mp1.c +1 -0
@@ -4,6 +4,7 @@*/ #include <common.h> #include <adc.h> +#include <bootm.h> #include <config.h> #include <clk.h> #include <dm.h>
Signature · 1 line
2.7.4
PATCH 2/20 board: stm32mp1: Fix warnings when compiling with W=1
Hi,
Quoted 7 lines
From: Patrick DELAUNAY <[email protected]>
Sent: vendredi 21 juin 2019 15:27This patch solves the following warnings:
warning: no previous prototype for '
board_quiesce_devices' [-Wmissing- prototypes] voidboard_quiesce_devices(void)
Quoted 9 lines
^~~~~~~~~~~~~~~~~~~~~Signed-off-by Patrice Chotard <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
board/st/stm32mp1/stm32mp1.c | 1 + 1 file changed, 1 insertion(+)
Applied to u-boot-stm32/master, thanks!
Patrick
PATCH 3/20 serial: stm32: Fix warnings when compiling with W=1
In reply to Patrick DelaunayThis patch solves the following warnings:
drivers/serial/serial_stm32.c: In function 'stm32_serial_probe':
warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
if (plat->clock_rate < 0) {
^---
drivers/serial/serial_stm32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/serial/serial_stm32.c +2 -2
@@ -195,9 +195,9 @@ static int stm32_serial_probe(struct udevice *dev) } plat->clock_rate =clk_get_rate (&clk); -if (plat->clock_rate <0 ) { +if (!plat->clock_rate) {clk_disable (&clk); -return plat->clock_rate; +return -EINVAL ; };_stm32_serial_init (plat->base, plat->uart_info);
Signature · 1 line
2.7.4
PATCH 3/20 serial: stm32: Fix warnings when compiling with W=1
Hi,
Quoted 10 lines
From: Patrick DELAUNAY <[email protected]>
Sent: vendredi 21 juin 2019 15:27This patch solves the following warnings:
drivers/serial/serial_stm32.c: In function 'stm32_serial_probe':
warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]if (plat->clock_rate < 0) { ^
Quoted 7 lines
Signed-off-by Patrice Chotard <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
drivers/serial/serial_stm32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Applied to u-boot-stm32/master, thanks!
Patrick
PATCH 4/20 mmc: stm32_sdmmc2: avoid warnings when building with W=1 option
In reply to Patrick DelaunayThis patch solves warnings detected by setting W=1 when building.
Warnings type detected:
- [-Wmissing-prototypes]
- [-Wimplicit-fallthrough=]
---
drivers/mmc/stm32_sdmmc2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/stm32_sdmmc2.c +2 -1
@@ -669,6 +669,7 @@ static int stm32_sdmmc2_probe(struct udevice *dev)switch (dev_read_u32_default (dev,"bus-width" ,1 )) {case 8 : cfg->host_caps |=MMC_MODE_8BIT ; +/* fall through */ case 4 : cfg->host_caps |=MMC_MODE_4BIT ;break ;
@@ -692,7 +693,7 @@ clk_free:return ret; } -int stm32_sdmmc_bind (struct udevice *dev) +static int stm32_sdmmc_bind (struct udevice *dev) {struct stm32_sdmmc2_plat *plat =dev_get_platdata (dev);
Signature · 1 line
2.7.4
PATCH 4/20 mmc: stm32_sdmmc2: avoid warnings when building with W=1 option
Hi,
Quoted 9 lines
From: Patrick DELAUNAY <[email protected]>
Sent: vendredi 21 juin 2019 15:27This patch solves warnings detected by setting W=1 when building.
Warnings type detected:
- [-Wmissing-prototypes]
- [-Wimplicit-fallthrough=]
Quoted 7 lines
Signed-off-by Christophe Kerello <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
drivers/mmc/stm32_sdmmc2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Applied to u-boot-stm32/master, thanks!
Patrick
PATCH 5/20 stm32mp1: bsec: Fix warnings when compiling with W=1
In reply to Patrick DelaunayThis patch solves the following warnings:
arch/arm/mach-stm32mp/bsec.c: In function 'stm32mp_bsec_read':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (offset >= STM32_BSEC_OTP_OFFSET) {
^~
arch/arm/mach-stm32mp/bsec.c: In function 'stm32mp_bsec_write':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (offset >= STM32_BSEC_OTP_OFFSET) {
^~---
arch/arm/mach-stm32mp/bsec.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
arch/arm/mach-stm32mp/bsec.c +8 -6
@@ -358,12 +358,13 @@ static int stm32mp_bsec_read(struct udevice *dev, int offset,bool shadow = true;int nb_otp = size /sizeof (u32);int otp; +unsigned int offs = offset; -if (offset >=STM32_BSEC_OTP_OFFSET ) { - offset -=STM32_BSEC_OTP_OFFSET ; +if (offs >=STM32_BSEC_OTP_OFFSET ) { + offs -=STM32_BSEC_OTP_OFFSET ; shadow = false; } - otp = offset /sizeof (u32); + otp = offs /sizeof (u32);if (otp <0 || (otp + nb_otp -1 ) >BSEC_OTP_MAX_VALUE ) { dev_err(dev, "wrong value for otp, max value : %i\n",
@@ -393,12 +394,13 @@ static int stm32mp_bsec_write(struct udevice *dev, int offset,bool shadow = true;int nb_otp = size /sizeof (u32);int otp; +unsigned int offs = offset; -if (offset >=STM32_BSEC_OTP_OFFSET ) { - offset -=STM32_BSEC_OTP_OFFSET ; +if (offs >=STM32_BSEC_OTP_OFFSET ) { + offs -=STM32_BSEC_OTP_OFFSET ; shadow = false; } - otp = offset /sizeof (u32); + otp = offs /sizeof (u32);if (otp <0 || (otp + nb_otp -1 ) >BSEC_OTP_MAX_VALUE ) { dev_err(dev, "wrong value for otp, max value : %d\n",
Signature · 1 line
2.7.4
PATCH 5/20 stm32mp1: bsec: Fix warnings when compiling with W=1
Hi,
Quoted 15 lines
From: Patrick DELAUNAY <[email protected]>
Sent: vendredi 21 juin 2019 15:27This patch solves the following warnings:
arch/arm/mach-stm32mp/bsec.c: In function 'stm32mp_bsec_read':
warning: comparison between signed and unsigned integer expressions [-Wsign- compare]if (offset >= STM32_BSEC_OTP_OFFSET) { ^~ arch/arm/mach-stm32mp/bsec.c: In function 'stm32mp_bsec_write': warning: comparison between signed and unsigned integer expressions [-Wsign- compare] if (offset >= STM32_BSEC_OTP_OFFSET) { ^~
Quoted 8 lines
Signed-off-by Patrice Chotard <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
arch/arm/mach-stm32mp/bsec.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
Applied to u-boot-stm32/master, thanks!
Patrick
PATCH 6/20 adc: stm32-adc: Fix warnings when compiling with W=1
In reply to Patrick DelaunayThis patch solves the following warnings:
drivers/adc/stm32-adc.c: In function 'stm32_adc_chan_of_init':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (num_channels > adc->cfg->max_channels) {
^---
drivers/adc/stm32-adc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/adc/stm32-adc.c +7 -6
@@ -163,15 +163,16 @@ static int stm32_adc_chan_of_init(struct udevice *dev)struct adc_uclass_platdata *uc_pdata =dev_get_uclass_platdata (dev);struct stm32_adc *adc =dev_get_priv (dev);u32 chans[STM32_ADC_CH_MAX ]; -int i, num_channels, ret; +unsigned int i, num_channels; +int ret;/* Retrieve single ended channels listed in device tree */ - num_channels =dev_read_size (dev,"st,adc-channels" ); -if (num_channels <0 ) { -dev_err (dev,"can't get st,adc-channels: %d\n" , num_channels); -return num_channels; + ret =dev_read_size (dev,"st,adc-channels" ); +if (ret <0 ) { +dev_err (dev,"can't get st,adc-channels: %d\n" , ret); +return ret; } - num_channels /=sizeof (u32); + num_channels = ret /sizeof (u32);if (num_channels > adc->cfg->max_channels) {dev_err (dev,"too many st,adc-channels: %d\n" , num_channels);
Signature · 1 line
2.7.4
PATCH 6/20 adc: stm32-adc: Fix warnings when compiling with W=1
Quoted 9 lines · Patrick Delaunay
This patch solves the following warnings:
drivers/adc/stm32-adc.c: In function 'stm32_adc_chan_of_init':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]if (num_channels > adc->cfg->max_channels) { ^Signed-off-by Patrice Chotard <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>
Hi Patrick,
Thanks,
Fabrice
Quoted 33 lines
---
drivers/adc/stm32-adc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)drivers/adc/stm32-adc.c +7
-6@@ -163,15 +163,16 @@ static int stm32_adc_chan_of_init(struct udevice *dev)struct adc_uclass_platdata *uc_pdata =dev_get_uclass_platdata (dev);struct stm32_adc *adc =dev_get_priv (dev);u32 chans[STM32_ADC_CH_MAX ]; -int i, num_channels, ret; +unsigned int i, num_channels; +int ret;/* Retrieve single ended channels listed in device tree */ - num_channels =dev_read_size (dev,"st,adc-channels" ); -if (num_channels <0 ) { -dev_err (dev,"can't get st,adc-channels: %d\n" , num_channels); -return num_channels; + ret =dev_read_size (dev,"st,adc-channels" ); +if (ret <0 ) { +dev_err (dev,"can't get st,adc-channels: %d\n" , ret); +return ret; } - num_channels /=sizeof (u32); + num_channels = ret /sizeof (u32);if (num_channels > adc->cfg->max_channels) {dev_err (dev,"too many st,adc-channels: %d\n" , num_channels);
PATCH 6/20 adc: stm32-adc: Fix warnings when compiling with W=1
In reply to Patrick DelaunayHi,
Quoted 10 lines
From: Patrick DELAUNAY <[email protected]>
Sent: vendredi 21 juin 2019 15:27This patch solves the following warnings:
drivers/adc/stm32-adc.c: In function 'stm32_adc_chan_of_init':
warning: comparison between signed and unsigned integer expressions [-Wsign- compare]if (num_channels > adc->cfg->max_channels) { ^
Quoted 8 lines
Signed-off-by Patrice Chotard <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
drivers/adc/stm32-adc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
Applied to u-boot-stm32/master, thanks!
Patrick
PATCH 7/20 adc: stm32: Fix warnings when compiling with W=1
In reply to Patrick DelaunayThis patch solves the following warnings:
drivers/adc/stm32-adc-core.c: In function 'stm32h7_adc_clk_sel':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (i = 0; i < ARRAY_SIZE(stm32h7_adc_ckmodes_spec); i++) {
^
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (i = 0; i < ARRAY_SIZE(stm32h7_adc_ckmodes_spec); i++) {
^---
drivers/adc/stm32-adc-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/adc/stm32-adc-core.c +2 -1
@@ -60,7 +60,8 @@ static int stm32h7_adc_clk_sel(struct udevice *dev, {u32 ckmode, presc;unsigned long rate; -int i, div; +unsigned int i; +int div;/* stm32h7 bus clock is common for all ADC instances (mandatory) */ if (!clk_valid (&common->bclk)) {
Signature · 1 line
2.7.4
PATCH 7/20 adc: stm32: Fix warnings when compiling with W=1
Quoted 4 lines · Patrick Delaunay
This patch solves the following warnings:
drivers/adc/stm32-adc-core.c: In function 'stm32h7_adc_clk_sel':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Quoted 8 lines
for (i = 0; i < ARRAY_SIZE(stm32h7_adc_ckmodes_spec); i++) { ^ warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (i = 0; i < ARRAY_SIZE(stm32h7_adc_ckmodes_spec); i++) { ^Signed-off-by Patrice Chotard <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>
Hi Patrick,
Thanks,
Fabrice
Quoted 20 lines
---
drivers/adc/stm32-adc-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/adc/stm32-adc-core.c +2
-1@@ -60,7 +60,8 @@ static int stm32h7_adc_clk_sel(struct udevice *dev, {u32 ckmode, presc;unsigned long rate; -int i, div; +unsigned int i; +int div;/* stm32h7 bus clock is common for all ADC instances (mandatory) */ if (!clk_valid (&common->bclk)) {
PATCH 7/20 adc: stm32: Fix warnings when compiling with W=1
In reply to Patrick DelaunayHi,
Quoted 14 lines
From: Patrick DELAUNAY <[email protected]>
Sent: vendredi 21 juin 2019 15:27This patch solves the following warnings:
drivers/adc/stm32-adc-core.c: In function 'stm32h7_adc_clk_sel':
warning: comparison between signed and unsigned integer expressions [-Wsign- compare]for (i = 0; i < ARRAY_SIZE(stm32h7_adc_ckmodes_spec); i++) { ^ warning: comparison between signed and unsigned integer expressions [-Wsign- compare] for (i = 0; i < ARRAY_SIZE(stm32h7_adc_ckmodes_spec); i++) { ^
Quoted 8 lines
Signed-off-by Patrice Chotard <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
drivers/adc/stm32-adc-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Applied to u-boot-stm32/master, thanks!
Patrick
PATCH 8/20 gpio: stm32_gpio: Fix warnings when compiling with W=1
In reply to Patrick DelaunayThis patch solves the following warnings:
drivers/gpio/stm32_gpio.c: In function 'stm32_offset_to_index':
: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (idx == offset)
^~---
drivers/gpio/stm32f7_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/stm32f7_gpio.c +1 -1
@@ -27,7 +27,7 @@int stm32_offset_to_index (struct udevice *dev,unsigned int offset) {struct stm32_gpio_priv *priv =dev_get_priv (dev); -int idx =0 ; +unsigned int idx =0 ;int i;for (i =0 ; i <STM32_GPIOS_PER_BANK ; i++) {
Signature · 1 line
2.7.4
PATCH 8/20 gpio: stm32_gpio: Fix warnings when compiling with W=1
Hi,
Quoted 9 lines
From: Patrick DELAUNAY <[email protected]>
Sent: vendredi 21 juin 2019 15:27This patch solves the following warnings:
drivers/gpio/stm32_gpio.c: In function 'stm32_offset_to_index':
: comparison between signed and unsigned integer expressions [-Wsign-compare]if (idx == offset) ^~
Quoted 8 lines
Signed-off-by Patrice Chotard <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
drivers/gpio/stm32f7_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to u-boot-stm32/master, thanks!
Patrick
PATCH 9/20 i2c: stm32f7_i2c: Fix warnings when compiling with W=1
In reply to Patrick DelaunayThis patch solves the following warnings:
drivers/i2c/stm32f7_i2c.c: In function 'stm32_i2c_compute_solutions':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (scldel < scldel_min)
^
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (((sdadel >= sdadel_min) &&
^~
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
(sdadel <= sdadel_max)) &&
^~
drivers/i2c/stm32f7_i2c.c: In function 'stm32_i2c_choose_solution':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (clk_error < clk_error_prev) {
^---
drivers/i2c/stm32f7_i2c.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/i2c/stm32f7_i2c.c +7 -5
@@ -519,13 +519,13 @@ static int stm32_i2c_compute_solutions(struct stm32_i2c_setup *setup,/* Compute possible values for PRESC, SCLDEL and SDADEL */ for (p =0 ; p <STM32_PRESC_MAX ; p++) {for (l =0 ; l <STM32_SCLDEL_MAX ; l++) { -u32 scldel = (l +1 ) * (p +1 ) * i2cclk; +int scldel = (l +1 ) * (p +1 ) * i2cclk;if (scldel < scldel_min)continue ;for (a =0 ; a <STM32_SDADEL_MAX ; a++) { -u32 sdadel = (a * (p +1 ) +1 ) * i2cclk; +int sdadel = (a * (p +1 ) +1 ) * i2cclk; if (((sdadel >= sdadel_min) && (sdadel <= sdadel_max)) &&
@@ -613,10 +613,12 @@ static int stm32_i2c_choose_solution(struct stm32_i2c_setup *setup,if ((tscl >= clk_min) && (tscl <= clk_max) && (tscl_h >= i2c_specs[setup->speed].h_min) && (i2cclk < tscl_h)) { -int clk_error = tscl - i2cbus; +u32 clk_error; -if (clk_error <0 ) - clk_error = -clk_error; +if (tscl > i2cbus) + clk_error = tscl - i2cbus; +else + clk_error = i2cbus - tscl;if (clk_error < clk_error_prev) { clk_error_prev = clk_error;
Signature · 1 line
2.7.4
PATCH 9/20 i2c: stm32f7_i2c: Fix warnings when compiling with W=1
Hi,
Quoted 23 lines
From: Patrick DELAUNAY <[email protected]>
Sent: vendredi 21 juin 2019 15:27This patch solves the following warnings:
drivers/i2c/stm32f7_i2c.c: In function 'stm32_i2c_compute_solutions':
warning: comparison between signed and unsigned integer expressions [-Wsign- compare]
if (scldel <scldel_min)
^
warning: comparison between signed and unsigned integer expressions [-Wsign- compare]if (((sdadel >= sdadel_min) && ^~ warning: comparison between signed and unsigned integer expressions [-Wsign- compare] (sdadel <= sdadel_max)) && ^~ drivers/i2c/stm32f7_i2c.c: In function 'stm32_i2c_choose_solution': warning: comparison between signed and unsigned integer expressions [-Wsign- compare] if (clk_error < clk_error_prev) { ^
Quoted 8 lines
Signed-off-by Patrice Chotard <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
drivers/i2c/stm32f7_i2c.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
Applied to u-boot-stm32/master, thanks!
Patrick
PATCH 10/20 clk: clk_stm32mp1: Fix warnings when compiling with W=1
In reply to Patrick DelaunayThis patch solves the following warnings:
drivers/clk/clk_stm32mp1.c: In function 'stm32mp1_clk_get_parent':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (i = 0; i < ARRAY_SIZE(stm32mp1_clks); i++)
^
---
drivers/clk/clk_stm32mp1.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/clk/clk_stm32mp1.c +4 -3
@@ -805,10 +805,11 @@ static int stm32mp1_clk_get_parent(struct stm32mp1_clk_priv *priv,const struct stm32mp1_clk_sel *sel = priv->data->sel;int i;int s, p; +unsigned int idx; -for (i =0 ; i <ARRAY_SIZE (stm32mp1_clks); i++) -if (stm32mp1_clks[i][0 ] == id) -return stm32mp1_clks[i][1 ]; +for (idx =0 ; idx <ARRAY_SIZE (stm32mp1_clks); idx++) +if (stm32mp1_clks[idx][0 ] == id) +return stm32mp1_clks[idx][1 ]; i =stm32mp1_clk_get_id (priv, id);if (i <0 )
Signature · 1 line
2.7.4
PATCH 10/20 clk: clk_stm32mp1: Fix warnings when compiling with W=1
Hi,
Quoted 9 lines
From: Patrick DELAUNAY <[email protected]>
Sent: vendredi 21 juin 2019 15:27This patch solves the following warnings:
drivers/clk/clk_stm32mp1.c: In function 'stm32mp1_clk_get_parent':
warning: comparison between signed and unsigned integer expressions [-Wsign- compare]
for (i = 0; i <ARRAY_SIZE(stm32mp1_clks); i++)
Quoted 9 lines
^Signed-off-by Patrice Chotard <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
drivers/clk/clk_stm32mp1.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
Applied to u-boot-stm32/master, thanks!
Patrick
PATCH 11/20 power: regulator: stm32: Fix warnings when compiling with W=1
In reply to Patrick DelaunayThis patch solves the following warnings:
drivers/power/regulator/stm32-vrefbuf.c: In function 'stm32_vrefbuf_set_value':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (uV == stm32_vrefbuf_voltages[i]) {
^~---
drivers/power/regulator/stm32-vrefbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/regulator/stm32-vrefbuf.c +1 -1
@@ -30,7 +30,7 @@ struct stm32_vrefbuf {struct udevice *vdda_supply; }; -static const unsigned int stm32_vrefbuf_voltages[] = { +static const int stm32_vrefbuf_voltages[] = {/* Matches resp. VRS = 000b, 001b, 010b, 011b */ 2500000 ,2048000 ,1800000 ,1500000 , };
Signature · 1 line
2.7.4
PATCH 11/20 power: regulator: stm32: Fix warnings when compiling with W=1
Hi,
Quoted 11 lines
From: Patrick DELAUNAY <[email protected]>
Sent: vendredi 21 juin 2019 15:27This patch solves the following warnings:
drivers/power/regulator/stm32-vrefbuf.c: In function 'stm32_vrefbuf_set_value':
warning: comparison between signed and unsigned integer expressions [-Wsign- compare]if (uV == stm32_vrefbuf_voltages[i]) { ^~
Quoted 7 lines
Signed-off-by Patrice Chotard <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
drivers/power/regulator/stm32-vrefbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to u-boot-stm32/master, thanks!
Patrick
PATCH 12/20 misc: stm32_fuse: Fix warnings when compiling with W=1
In reply to Patrick DelaunayThis patch solves the following warnings:
warning: no previous prototype for 'fuse_read' [-Wmissing-prototypes]
int fuse_read(u32 bank, u32 word, u32 *val)
^~~~~~~~~
CC cmd/sf.o
warning: no previous prototype for 'fuse_prog' [-Wmissing-prototypes]
int fuse_prog(u32 bank, u32 word, u32 val)
^~~~~~~~~
warning: no previous prototype for 'fuse_sense' [-Wmissing-prototypes]
int fuse_sense(u32 bank, u32 word, u32 *val)
^~~~~~~~~~
warning: no previous prototype for 'fuse_override' [-Wmissing-prototypes]
int fuse_override(u32 bank, u32 word, u32 val)
^~~~~~~~~~~~~---
drivers/misc/stm32mp_fuse.c | 1 + 1 file changed, 1 insertion(+)
drivers/misc/stm32mp_fuse.c +1 -0
@@ -5,6 +5,7 @@#include <common.h> #include <command.h> +#include <fuse.h> #include <misc.h> #include <errno.h> #include <dm/device.h>
Signature · 1 line
2.7.4
PATCH 12/20 misc: stm32_fuse: Fix warnings when compiling with W=1
Hi,
Quoted 19 lines
From: Patrick DELAUNAY <[email protected]>
Sent: vendredi 21 juin 2019 15:27This patch solves the following warnings:
warning: no previous prototype for '
fuse_read' [-Wmissing-prototypes] intfuse_read(u32 bank, u32 word, u32 *val)^~~~~~~~~ CC cmd/sf.o warning: no previous prototype for 'fuse_prog' [-Wmissing-prototypes] int fuse_prog(u32 bank, u32 word, u32 val) ^~~~~~~~~ warning: no previous prototype for 'fuse_sense' [-Wmissing-prototypes] int fuse_sense(u32 bank, u32 word, u32 *val) ^~~~~~~~~~ warning: no previous prototype for 'fuse_override' [-Wmissing-prototypes] int fuse_override(u32 bank, u32 word, u32 val) ^~~~~~~~~~~~~
Quoted 7 lines
Signed-off-by Patrice Chotard <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
drivers/misc/stm32mp_fuse.c | 1 + 1 file changed, 1 insertion(+)
Applied to u-boot-stm32/master, thanks!
Patrick
PATCH 13/20 ram: stm32mp1_ram: Fix warnings when compiling with W=1
In reply to Patrick DelaunayThis patch solves the following warnings:
drivers/ram/stm32mp1/stm32mp1_ram.c: In function 'stm32mp1_ddr_clk_enable':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (idx = 0; idx < ARRAY_SIZE(clkname); idx++) {
^
drivers/ram/stm32mp1/stm32mp1_ram.c: In function 'stm32mp1_ddr_setup':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (idx = 0; idx < ARRAY_SIZE(param); idx++) {
^---
drivers/ram/stm32mp1/stm32mp1_ram.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/ram/stm32mp1/stm32mp1_ram.c +3 -2
@@ -26,7 +26,7 @@ int stm32mp1_ddr_clk_enable(struct ddr_info *priv, uint32_t mem_speed)unsigned long ddr_clk;struct clk clk;int ret; -int idx; +unsigned int idx;for (idx =0 ; idx <ARRAY_SIZE (clkname); idx++) { ret =clk_get_by_name (priv->dev, clkname[idx], &clk);
@@ -59,7 +59,8 @@ int stm32mp1_ddr_clk_enable(struct ddr_info *priv, uint32_t mem_speed)static __maybe_unused int stm32mp1_ddr_setup (struct udevice *dev) {struct ddr_info *priv =dev_get_priv (dev); -int ret, idx; +int ret; +unsigned int idx;struct clk axidcg;struct stm32mp1_ddr_config config;
Signature · 1 line
2.7.4
PATCH 13/20 ram: stm32mp1_ram: Fix warnings when compiling with W=1
Hi,
Quoted 15 lines
From: Patrick DELAUNAY <[email protected]>
Sent: vendredi 21 juin 2019 15:27This patch solves the following warnings:
drivers/ram/stm32mp1/stm32mp1_ram.c: In function 'stm32mp1_ddr_clk_enable':
warning: comparison between signed and unsigned integer expressions [-Wsign- compare]for (idx = 0; idx < ARRAY_SIZE(clkname); idx++) { ^ drivers/ram/stm32mp1/stm32mp1_ram.c: In function 'stm32mp1_ddr_setup': warning: comparison between signed and unsigned integer expressions [-Wsign- compare] for (idx = 0; idx < ARRAY_SIZE(param); idx++) { ^
Quoted 8 lines
Signed-off-by Patrice Chotard <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
drivers/ram/stm32mp1/stm32mp1_ram.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Applied to u-boot-stm32/master, thanks!
Patrick
PATCH 14/20 pinctrl: pinctrl_stm32: Fix warnings when compiling with W=1
In reply to Patrick DelaunayThis patch solves the following warnings:
warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
if (*idx < 0)
^
drivers/pinctrl/pinctrl_stm32.c: At top level:
warning: no previous prototype for 'stm32_pinctrl_probe' [-Wmissing-prototypes]
int stm32_pinctrl_probe(struct udevice *dev)
^~~~~~~~~~~~~~~~~~~---
drivers/pinctrl/pinctrl_stm32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/pinctrl_stm32.c +2 -2
@@ -136,7 +136,7 @@ static struct udevice *stm32_pinctrl_get_gpio_dev(struct udevice *dev,*/ *idx =stm32_offset_to_index (gpio_bank->gpio_dev, selector - pin_count); -if (*idx <0 ) +if (IS_ERR_VALUE (*idx))return NULL ;return gpio_bank->gpio_dev;
@@ -215,7 +215,7 @@ static int stm32_pinctrl_get_pin_muxing(struct udevice *dev,#endif -int stm32_pinctrl_probe (struct udevice *dev) +static int stm32_pinctrl_probe (struct udevice *dev) {struct stm32_pinctrl_priv *priv =dev_get_priv (dev);int ret;
Signature · 1 line
2.7.4
PATCH 14/20 pinctrl: pinctrl_stm32: Fix warnings when compiling with W=1
Hi,
Quoted 13 lines
From: Patrick DELAUNAY <[email protected]>
Sent: vendredi 21 juin 2019 15:27This patch solves the following warnings:
warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
if (*idx < 0) ^ drivers/pinctrl/pinctrl_stm32.c: At top level: warning: no previous prototype for 'stm32_pinctrl_probe' [-Wmissing-prototypes] int stm32_pinctrl_probe(struct udevice *dev) ^~~~~~~~~~~~~~~~~~~
Quoted 7 lines
Signed-off-by Patrice CHOTARD <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
drivers/pinctrl/pinctrl_stm32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Applied to u-boot-stm32/master, thanks!
Patrick
PATCH 15/20 power: stpmic1: Fix warnings when compiling with W=1
In reply to Patrick DelaunayThis patch solves the following warnings:
warning: this statement may fall through [-Wimplicit-fallthrough=]
---
drivers/power/regulator/stpmic1.c | 1 + 1 file changed, 1 insertion(+)
drivers/power/regulator/stpmic1.c +1 -0
@@ -422,6 +422,7 @@ static int stpmic1_ldo_set_mode(struct udevice *dev, int mode)case STPMIC1_LDO_MODE_SINK_SOURCE : ret &= ~STPMIC1_LDO12356_VOUT_MASK ; ret |=STPMIC1_LDO3_DDR_SEL <<STPMIC1_LDO12356_VOUT_SHIFT ; +/* fallthrough */ case STPMIC1_LDO_MODE_NORMAL : ret &= ~STPMIC1_LDO3_MODE ;break ;
Signature · 1 line
2.7.4
PATCH 15/20 power: stpmic1: Fix warnings when compiling with W=1
Hi,
Quoted 12 lines
From: Patrick DELAUNAY <[email protected]>
Sent: vendredi 21 juin 2019 15:27This patch solves the following warnings:
warning: this statement may fall through [-Wimplicit-fallthrough=]Signed-off-by Patrick Delaunay <[email protected]>---
drivers/power/regulator/stpmic1.c | 1 + 1 file changed, 1 insertion(+)
Applied to u-boot-stm32/master, thanks!
Patrick
PATCH 16/20 mtd: rawnand: stm32_fmc2: avoid warnings when building with W=1 option
In reply to Patrick DelaunayThis patch solves warnings detected by setting W=1 when building.
Warnings type detected:
- [-Wsign-compare]
- [-Wtype-limits]
---
drivers/mtd/nand/raw/stm32_fmc2_nand.c | 93 ++++++++++++---------------------- 1 file changed, 31 insertions(+), 62 deletions(-)
drivers/mtd/nand/raw/stm32_fmc2_nand.c +31 -62
@@ -627,21 +627,16 @@ static void stm32_fmc2_calc_timings(struct nand_chip *chip,struct stm32_fmc2_timings *tims = &nand->timings;unsigned long hclk =clk_get_rate (&fmc2->clk);unsigned long hclkp =FMC2_NSEC_PER_SEC / (hclk /1000 ); -int tar, tclr, thiz, twait, tset_mem, tset_att, thold_mem, thold_att; - - tar = hclkp; -if (tar < sdrt->tAR_min) - tar = sdrt->tAR_min; - tims->tar =DIV_ROUND_UP (tar, hclkp) -1 ; -if (tims->tar >FMC2_PCR_TIMING_MASK ) - tims->tar =FMC2_PCR_TIMING_MASK ; - - tclr = hclkp; -if (tclr < sdrt->tCLR_min) - tclr = sdrt->tCLR_min; - tims->tclr =DIV_ROUND_UP (tclr, hclkp) -1 ; -if (tims->tclr >FMC2_PCR_TIMING_MASK ) - tims->tclr =FMC2_PCR_TIMING_MASK ; +unsigned long timing, tar, tclr, thiz, twait; +unsigned long tset_mem, tset_att, thold_mem, thold_att; + + tar = max_t(unsigned long, hclkp, sdrt->tAR_min); + timing =DIV_ROUND_UP (tar, hclkp) -1 ; + tims->tar = min_t(unsigned long, timing, FMC2_PCR_TIMING_MASK); + + tclr = max_t(unsigned long, hclkp, sdrt->tCLR_min); + timing =DIV_ROUND_UP (tclr, hclkp) -1 ; + tims->tclr = min_t(unsigned long, timing, FMC2_PCR_TIMING_MASK); tims->thiz =FMC2_THIZ ; thiz = (tims->thiz +1 ) * hclkp;
@@ -651,18 +646,11 @@ static void stm32_fmc2_calc_timings(struct nand_chip *chip,* tWAIT > tWP * tWAIT > tREA + tIO */ - twait = hclkp; -if (twait < sdrt->tRP_min) - twait = sdrt->tRP_min; -if (twait < sdrt->tWP_min) - twait = sdrt->tWP_min; -if (twait < sdrt->tREA_max +FMC2_TIO ) - twait = sdrt->tREA_max +FMC2_TIO ; - tims->twait =DIV_ROUND_UP (twait, hclkp); -if (tims->twait ==0 ) - tims->twait =1 ; -else if (tims->twait >FMC2_PMEM_PATT_TIMING_MASK ) - tims->twait =FMC2_PMEM_PATT_TIMING_MASK ; + twait = max_t(unsigned long, hclkp, sdrt->tRP_min); + twait = max_t(unsigned long, twait, sdrt->tWP_min); + twait = max_t(unsigned long, twait, sdrt->tREA_max + FMC2_TIO); + timing =DIV_ROUND_UP (twait, hclkp); + tims->twait =clamp_val (timing,1 ,FMC2_PMEM_PATT_TIMING_MASK );/* * tSETUP_MEM > tCS - tWAIT
@@ -677,20 +665,15 @@ static void stm32_fmc2_calc_timings(struct nand_chip *chip,if (twait > thiz && (sdrt->tDS_min > twait - thiz) && (tset_mem < sdrt->tDS_min - (twait - thiz))) tset_mem = sdrt->tDS_min - (twait - thiz); - tims->tset_mem =DIV_ROUND_UP (tset_mem, hclkp); -if (tims->tset_mem ==0 ) - tims->tset_mem =1 ; -else if (tims->tset_mem >FMC2_PMEM_PATT_TIMING_MASK ) - tims->tset_mem =FMC2_PMEM_PATT_TIMING_MASK ; + timing =DIV_ROUND_UP (tset_mem, hclkp); + tims->tset_mem =clamp_val (timing,1 ,FMC2_PMEM_PATT_TIMING_MASK );/* * tHOLD_MEM > tCH * tHOLD_MEM > tREH - tSETUP_MEM * tHOLD_MEM > max(tRC, tWC) - (tSETUP_MEM + tWAIT) */ - thold_mem = hclkp; -if (thold_mem < sdrt->tCH_min) - thold_mem = sdrt->tCH_min; + thold_mem = max_t(unsigned long, hclkp, sdrt->tCH_min);if (sdrt->tREH_min > tset_mem && (thold_mem < sdrt->tREH_min - tset_mem)) thold_mem = sdrt->tREH_min - tset_mem;
@@ -700,11 +683,8 @@ static void stm32_fmc2_calc_timings(struct nand_chip *chip,if ((sdrt->tWC_min > tset_mem + twait) && (thold_mem < sdrt->tWC_min - (tset_mem + twait))) thold_mem = sdrt->tWC_min - (tset_mem + twait); - tims->thold_mem =DIV_ROUND_UP (thold_mem, hclkp); -if (tims->thold_mem ==0 ) - tims->thold_mem =1 ; -else if (tims->thold_mem >FMC2_PMEM_PATT_TIMING_MASK ) - tims->thold_mem =FMC2_PMEM_PATT_TIMING_MASK ; + timing =DIV_ROUND_UP (thold_mem, hclkp); + tims->thold_mem =clamp_val (timing,1 ,FMC2_PMEM_PATT_TIMING_MASK );/* * tSETUP_ATT > tCS - tWAIT
@@ -726,11 +706,8 @@ static void stm32_fmc2_calc_timings(struct nand_chip *chip,if (twait > thiz && (sdrt->tDS_min > twait - thiz) && (tset_att < sdrt->tDS_min - (twait - thiz))) tset_att = sdrt->tDS_min - (twait - thiz); - tims->tset_att =DIV_ROUND_UP (tset_att, hclkp); -if (tims->tset_att ==0 ) - tims->tset_att =1 ; -else if (tims->tset_att >FMC2_PMEM_PATT_TIMING_MASK ) - tims->tset_att =FMC2_PMEM_PATT_TIMING_MASK ; + timing =DIV_ROUND_UP (tset_att, hclkp); + tims->tset_att =clamp_val (timing,1 ,FMC2_PMEM_PATT_TIMING_MASK );/* * tHOLD_ATT > tALH
@@ -745,17 +722,11 @@ static void stm32_fmc2_calc_timings(struct nand_chip *chip,* tHOLD_ATT > tRC - (tSETUP_ATT + tWAIT) * tHOLD_ATT > tWC - (tSETUP_ATT + tWAIT) */ - thold_att = hclkp; -if (thold_att < sdrt->tALH_min) - thold_att = sdrt->tALH_min; -if (thold_att < sdrt->tCH_min) - thold_att = sdrt->tCH_min; -if (thold_att < sdrt->tCLH_min) - thold_att = sdrt->tCLH_min; -if (thold_att < sdrt->tCOH_min) - thold_att = sdrt->tCOH_min; -if (thold_att < sdrt->tDH_min) - thold_att = sdrt->tDH_min; + thold_att = max_t(unsigned long, hclkp, sdrt->tALH_min); + thold_att = max_t(unsigned long, thold_att, sdrt->tCH_min); + thold_att = max_t(unsigned long, thold_att, sdrt->tCLH_min); + thold_att = max_t(unsigned long, thold_att, sdrt->tCOH_min); + thold_att = max_t(unsigned long, thold_att, sdrt->tDH_min);if ((sdrt->tWB_max +FMC2_TIO +FMC2_TSYNC > tset_mem) && (thold_att < sdrt->tWB_max +FMC2_TIO +FMC2_TSYNC - tset_mem)) thold_att = sdrt->tWB_max +FMC2_TIO +FMC2_TSYNC - tset_mem;
@@ -774,11 +745,8 @@ static void stm32_fmc2_calc_timings(struct nand_chip *chip,if ((sdrt->tWC_min > tset_att + twait) && (thold_att < sdrt->tWC_min - (tset_att + twait))) thold_att = sdrt->tWC_min - (tset_att + twait); - tims->thold_att =DIV_ROUND_UP (thold_att, hclkp); -if (tims->thold_att ==0 ) - tims->thold_att =1 ; -else if (tims->thold_att >FMC2_PMEM_PATT_TIMING_MASK ) - tims->thold_att =FMC2_PMEM_PATT_TIMING_MASK ; + timing =DIV_ROUND_UP (thold_att, hclkp); + tims->thold_att =clamp_val (timing,1 ,FMC2_PMEM_PATT_TIMING_MASK ); } static int stm32_fmc2_setup_interface(struct mtd_info *mtd, int chipnr,
@@ -932,7 +900,8 @@ static int stm32_fmc2_probe(struct udevice *dev)struct nand_ecclayout *ecclayout;struct resource resource;struct reset_ctl reset; -int oob_index, chip_cs, mem_region, ret, i; +int oob_index, chip_cs, mem_region, ret; +unsigned int i;spin_lock_init (&fmc2->controller.lock);init_waitqueue_head (&fmc2->controller.wq);
Signature · 1 line
2.7.4
PATCH 16/20 mtd: rawnand: stm32_fmc2: avoid warnings when building with W=1 option
Hi,
Quoted 9 lines
From: Patrick DELAUNAY <[email protected]>
Sent: vendredi 21 juin 2019 15:27This patch solves warnings detected by setting W=1 when building.
Warnings type detected:
- [-Wsign-compare]
- [-Wtype-limits]
Quoted 7 lines
Signed-off-by Christophe Kerello <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
drivers/mtd/nand/raw/stm32_fmc2_nand.c | 93 ++++++++++++---------------------- 1 file changed, 31 insertions(+), 62 deletions(-)
Applied to u-boot-stm32/master, thanks!
Patrick
PATCH 17/20 spi: stm32_qspi: avoid warnings when building with W=1 option
In reply to Patrick DelaunayThis patch solves warnings detected by setting W=1 when building.
Warnings type detected:
- [-Wtype-limits]
- [-Wsign-compare]
---
drivers/spi/stm32_qspi.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-)
drivers/spi/stm32_qspi.c +13 -11
@@ -361,9 +361,9 @@ static int stm32_qspi_probe(struct udevice *bus) } priv->clock_rate =clk_get_rate (&clk); -if (priv->clock_rate <0 ) { +if (!priv->clock_rate) {clk_disable (&clk); -return priv->clock_rate; +return -EINVAL ; } ret =reset_get_by_index (bus,0 , &reset_ctl);
@@ -395,14 +395,15 @@ static int stm32_qspi_claim_bus(struct udevice *dev) {struct stm32_qspi_priv *priv =dev_get_priv (dev->parent);struct dm_spi_slave_platdata *slave_plat =dev_get_parent_platdata (dev); +int slave_cs = slave_plat->cs; -if (slave_plat->cs >=STM32_QSPI_MAX_CHIP ) +if (slave_cs >=STM32_QSPI_MAX_CHIP )return -ENODEV ; -if (priv->cs_used != slave_plat->cs) { -struct stm32_qspi_flash *flash = &priv->flash[slave_plat->cs]; +if (priv->cs_used != slave_cs) { +struct stm32_qspi_flash *flash = &priv->flash[slave_cs]; - priv->cs_used = slave_plat->cs; + priv->cs_used = slave_cs;if (flash->initialized) {/* Set the configuration: speed + cs */
@@ -444,11 +445,12 @@ static int stm32_qspi_set_speed(struct udevice *bus, uint speed)int ret;if (speed >0 ) { - prescaler =DIV_ROUND_UP (qspi_clk, speed) -1 ; -if (prescaler >255 ) - prescaler =255 ; -else if (prescaler <0 ) - prescaler =0 ; + prescaler =0 ; +if (qspi_clk) { + prescaler =DIV_ROUND_UP (qspi_clk, speed) -1 ; +if (prescaler >255 ) + prescaler =255 ; + } } csht =DIV_ROUND_UP ((5 * qspi_clk) / (prescaler +1 ),100000000 );
Signature · 1 line
2.7.4
PATCH 17/20 spi: stm32_qspi: avoid warnings when building with W=1 option
Hi,
Quoted 9 lines
From: Patrick DELAUNAY <[email protected]>
Sent: vendredi 21 juin 2019 15:27This patch solves warnings detected by setting W=1 when building.
Warnings type detected:
- [-Wtype-limits]
- [-Wsign-compare]
Quoted 7 lines
Signed-off-by Christophe Kerello <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
drivers/spi/stm32_qspi.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-)
Applied to u-boot-stm32/master, thanks!
Patrick
PATCH 18/20 cmd: pinmux: Fix warnings when compiling with W=1
In reply to Patrick DelaunayThis patch solves the following warnings:
cmd/pinmux.c: In function 'do_dev':cmd/pinmux.c:26:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (ret) {
^cmd/pinmux.c:30:2: note: here
case 1:
^~~~
---
cmd/pinmux.c | 1 + 1 file changed, 1 insertion(+)
cmd/pinmux.c +1 -0
@@ -27,6 +27,7 @@ static int do_dev(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])printf ("Can't get the pin-controller: %s!\n" , name);return CMD_RET_FAILURE ; } +/* fall through */ case 1 :if (!currdev) {printf ("Pin-controller device is not set!\n" );
Signature · 1 line
2.7.4
PATCH 18/20 cmd: pinmux: Fix warnings when compiling with W=1
Hi
Quoted 14 lines
From: Patrick DELAUNAY <[email protected]>
Sent: vendredi 21 juin 2019 15:27This patch solves the following warnings:
cmd/pinmux.c: In function 'do_dev':cmd/pinmux.c:26:6: warning: this statement may fall through [-Wimplicit- fallthrough=]if (ret) { ^
cmd/pinmux.c:30:2: note: here
case 1:
^~~~
Quoted 7 lines
Signed-off-by Patrice Chotard <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
cmd/pinmux.c | 1 + 1 file changed, 1 insertion(+)
Applied to u-boot-stm32/master, thanks!
Patrick
PATCH 19/20 psci: Fix warnings when compiling with W=1
In reply to Patrick DelaunayThis patch solves the following warnings:arch/arm/mach-stm32mp/psci.c:
warning: no previous prototype for ‘psci_set_state’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_arch_cpu_entry’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_features’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_version’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_affinity_info’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_migrate_info_type’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_cpu_on’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_cpu_off’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_system_reset’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_system_off’ [-Wmissing-prototypes]
---
arch/arm/include/asm/system.h | 14 ++++++++++++++ arch/arm/mach-imx/mx7/psci-mx7.c | 2 +- arch/arm/mach-stm32mp/psci.c | 18 +++++++++--------- arch/arm/mach-uniphier/arm32/psci.c | 4 ++-- 4 files changed, 26 insertions(+), 12 deletions(-)
arch/arm/include/asm/system.h +14 -0
@@ -516,6 +516,20 @@ enum {*/ void mmu_page_table_flush (unsigned long start,unsigned long stop); +#ifdef CONFIG_ARMV7_PSCI +u32 psci_version (void ); +s32 psci_features (u32 function_id,u32 psci_fid); +s32 psci_cpu_off (void ); +s32 psci_cpu_on (u32 function_id,u32 target_cpu,u32 pc, +u32 context_id); +s32 psci_affinity_info (u32 function_id,u32 target_affinity, +u32 lowest_affinity_level); +u32 psci_migrate_info_type (void ); +void __noreturn psci_system_off (void ); +void __noreturn psci_system_reset (void ); +s32 psci_features (u32 function_id,u32 psci_fid); +#endif +#endif /* __ASSEMBLY__ */ #define arch_align_stack (x) (x)
arch/arm/mach-imx/mx7/psci-mx7.c +1 -1
@@ -298,7 +298,7 @@ __secure s32 psci_affinity_info(u32 __always_unused function_id,return psci_state[cpu]; } -__secure s32 psci_migrate_info_type(u32 function_id) +__secure u32 psci_migrate_info_type(void) {/* Trusted OS is either not present or does not require migration */ return 2 ;
arch/arm/mach-stm32mp/psci.c +9 -9
@@ -30,7 +30,7 @@ u8 psci_state[STM32MP1_PSCI_NR_CPUS] __secure_data = {PSCI_AFFINITY_LEVEL_ON , PSCI_AFFINITY_LEVEL_OFF}; -void __secure psci_set_state(int cpu, u8 state) +static inline void psci_set_state (int cpu,u8 state) { psci_state[cpu] = state;dsb ();
@@ -67,7 +67,7 @@ void __secure psci_arch_cpu_entry(void)writel (0xFFFFFFFF ,TAMP_BACKUP_MAGIC_NUMBER ); } -int __secure psci_features(u32 function_id, u32 psci_fid) +s32 __secure psci_features(u32 function_id, u32 psci_fid) {switch (psci_fid) {case ARM_PSCI_0_2_FN_PSCI_VERSION :
@@ -82,12 +82,12 @@ int __secure psci_features(u32 function_id, u32 psci_fid)return ARM_PSCI_RET_NI ; } -unsigned int __secure psci_version(u32 function_id) +u32 __secure psci_version(void) {return ARM_PSCI_VER_1_0 ; } -int __secure psci_affinity_info(u32 function_id, u32 target_affinity, +s32 __secure psci_affinity_info(u32 function_id, u32 target_affinity,u32 lowest_affinity_level) {u32 cpu = target_affinity &MPIDR_AFF0 ;
@@ -104,7 +104,7 @@ int __secure psci_affinity_info(u32 function_id, u32 target_affinity,return psci_state[cpu]; } -int __secure psci_migrate_info_type(u32 function_id) +u32 __secure psci_migrate_info_type(void) {/* * in Power_State_Coordination_Interface_PDD_v1_1_DEN0022D.pdf
@@ -116,7 +116,7 @@ int __secure psci_migrate_info_type(u32 function_id)return 2 ; } -int __secure psci_cpu_on(u32 function_id, u32 target_cpu, u32 pc, +s32 __secure psci_cpu_on(u32 function_id, u32 target_cpu, u32 pc,u32 context_id) {u32 cpu = target_cpu &MPIDR_AFF0 ;
@@ -161,7 +161,7 @@ int __secure psci_cpu_on(u32 function_id, u32 target_cpu, u32 pc,return ARM_PSCI_RET_SUCCESS ; } -int __secure psci_cpu_off(u32 function_id) +s32 __secure psci_cpu_off(void) {u32 cpu;
@@ -181,7 +181,7 @@ int __secure psci_cpu_off(u32 function_id)wfi (); } -void __secure psci_system_reset(u32 function_id) +void __secure psci_system_reset(void) {/* System reset */ writel (RCC_MP_GRSTCSETR_MPSYSRST ,RCC_MP_GRSTCSETR );
@@ -190,7 +190,7 @@ void __secure psci_system_reset(u32 function_id)wfi (); } -void __secure psci_system_off(u32 function_id) +void __secure psci_system_off(void) {/* System Off is not managed, waiting user power off * TODO: handle I2C write in PMIC Main Control register bit 0 = SWOFF
arch/arm/mach-uniphier/arm32/psci.c +2 -2
@@ -130,7 +130,7 @@ void psci_arch_init(void) u32 uniphier_psci_holding_pen_release __secure_data = 0xffffffff; -int __secure psci_cpu_on(u32 function_id, u32 cpuid, u32 entry_point, +s32 __secure psci_cpu_on(u32 function_id, u32 cpuid, u32 entry_point,u32 context_id) {u32 cpu = cpuid &0xff ;
@@ -155,7 +155,7 @@ int __secure psci_cpu_on(u32 function_id, u32 cpuid, u32 entry_point,return PSCI_RET_SUCCESS ; } -void __secure psci_system_reset(u32 function_id) +void __secure psci_system_reset(void) {reset_cpu (0 ); }
Signature · 1 line
2.7.4
PATCH 19/20 psci: Fix warnings when compiling with W=1
Hi,
Quoted 18 lines
From: Patrick DELAUNAY <[email protected]>
Sent: vendredi 21 juin 2019 15:27This patch solves the following warnings:
arch/arm/mach-stm32mp/psci.c:warning: no previous prototype for ‘psci_set_state’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_arch_cpu_entry’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_features’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_version’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_affinity_info’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_migrate_info_type’ [-Wmissing- prototypes]
warning: no previous prototype for ‘psci_cpu_on’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_cpu_off’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_system_reset’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_system_off’ [-Wmissing-prototypes]
Quoted 1 line
Signed-off-by Patrick Delaunay <[email protected]>
After rebase this patch cause compilation issue with sunci platform: it need to be updated
+arch/arm/cpu/armv7/sunxi/psci.c:279:15: error: conflicting types for 'psci_cpu_off'
Quoted 156 lines
---
arch/arm/include/asm/system.h | 14 ++++++++++++++ arch/arm/mach-imx/mx7/psci-mx7.c | 2 +- arch/arm/mach-stm32mp/psci.c | 18 +++++++++--------- arch/arm/mach-uniphier/arm32/psci.c | 4 ++-- 4 files changed, 26 insertions(+), 12 deletions(-)arch/arm/include/asm/system.h index renamed from arch/arm/include/asm/system.h +0
-0aed2e3c..ac4fc11 100644
arch/arm/include/asm/system.h +13
-0@@ -516,6 +516,20 @@ enum {*/ void mmu_page_table_flush (unsigned long start,unsigned long stop); +#ifdef CONFIG_ARMV7_PSCI +u32 psci_version (void ); +s32 psci_features (u32 function_id,u32 psci_fid); +s32 psci_cpu_off (void ); +s32 psci_cpu_on (u32 function_id,u32 target_cpu,u32 pc, +u32 context_id); +s32 psci_affinity_info (u32 function_id,u32 target_affinity, +u32 lowest_affinity_level); +u32 psci_migrate_info_type (void ); +void __noreturn psci_system_off (void ); +void __noreturn psci_system_reset (void ); +s32 psci_features (u32 function_id,u32 psci_fid);#endif +#endif /* __ASSEMBLY__ */ #define arch_align_stack (x) (x)arch/arm/mach-imx/mx7/psci- renamed from arch/arm/mach-imx/mx7/psci-mx7.c +0
-0
mx7.c
index 34ba0a9..c98d2e9 100644arch/arm/mach-imx/mx7/psci-mx7.c +1
-1@@ -298,7 +298,7 @@ __secure s32 psci_affinity_info(u32 __always_unused function_id, return psci_state[cpu]; } -__secure s32 psci_migrate_info_type(u32 function_id) +__secure u32 psci_migrate_info_type(void) {/* Trusted OS is either not present or does not require migration */ arch/arm/mach-imx/mx7/psci-mx7.c +0
-0return 2 ;arch/arm/mach-stm32mp/psci.c +1
-1@@ -30,7 +30,7 @@ u8 psci_state[STM32MP1_PSCI_NR_CPUS] __secure_data = {PSCI_AFFINITY_LEVEL_ON ,PSCI_AFFINITY_LEVEL_OFF }; -void __secure psci_set_state(int cpu, u8 state) +static inline void psci_set_state (int cpu,u8 state) { psci_state[cpu] = state;arch/arm/mach-stm32mp/psci.c +3
-3dsb ();@@ -67,7 +67,7 @@ void __secure psci_arch_cpu_entry(void)writel (0xFFFFFFFF ,TAMP_BACKUP_MAGIC_NUMBER ); } -int __secure psci_features(u32 function_id, u32 psci_fid) +s32 __secure psci_features(u32 function_id, u32 psci_fid) {switch (psci_fid) {case ARM_PSCI_0_2_FN_PSCI_VERSION :@@ -82,12 +82,12 @@ int __secure psci_features(u32 function_id, u32 psci_fid)return ARM_PSCI_RET_NI ; } -unsigned int __secure psci_version(u32 function_id) +u32 __secure psci_version(void) {return ARM_PSCI_VER_1_0 ; } -int __secure psci_affinity_info(u32 function_id, u32 target_affinity, +s32 __secure psci_affinity_info(u32 function_id, u32 target_affinity,u32 lowest_affinity_level) { u32 cpu = target_affinity & MPIDR_AFF0; @@ -104,7 +104,7 @@ int
__securepsci_affinity_info(u32function_id, u32target_affinity,arch/arm/mach-stm32mp/psci.c +5
-5return psci_state[cpu]; } -int __secure psci_migrate_info_type(u32 function_id) +u32 __secure psci_migrate_info_type(void) {/* * in Power_State_Coordination_Interface_PDD_v1_1_DEN0022D.pdf @@ -116,7 +116,7 @@ int __secure psci_migrate_info_type(u32 function_id)return 2 ; } -int __secure psci_cpu_on(u32 function_id, u32 target_cpu, u32 pc, +s32 __secure psci_cpu_on(u32 function_id, u32 target_cpu, u32 pc,u32 context_id) {u32 cpu = target_cpu &MPIDR_AFF0 ;@@ -161,7 +161,7 @@ int __secure psci_cpu_on(u32 function_id, u32 target_cpu, u32 pc, return ARM_PSCI_RET_SUCCESS; } -int __secure psci_cpu_off(u32 function_id) +s32 __secure psci_cpu_off(void) {u32 cpu;@@ -181,7 +181,7 @@ int __secure psci_cpu_off(u32 function_id)wfi (); } -void __secure psci_system_reset(u32 function_id) +void __secure psci_system_reset(void) {/* System reset */ writel (RCC_MP_GRSTCSETR_MPSYSRST ,RCC_MP_GRSTCSETR );@@ -190,7 +190,7 @@ void __secure psci_system_reset(u32 function_id)wfi (); } -void __secure psci_system_off(u32 function_id) +void __secure psci_system_off(void) {/* System Off is not managed, waiting user power off * TODO: handle I2C write in PMIC Main Control register bit 0 = SWOFF arch/arm/mach- renamed from arch/arm/mach-uniphier/arm32/psci.c +0
-0
uniphier/arm32/psci.c
index 3f67edf..ef35923 100644arch/arm/mach-uniphier/arm32/psci.c +2
-2@@ -130,7 +130,7 @@ void psci_arch_init(void) u32 uniphier_psci_holding_pen_release __secure_data = 0xffffffff; -int __secure psci_cpu_on(u32 function_id, u32 cpuid, u32 entry_point, +s32 __secure psci_cpu_on(u32 function_id, u32 cpuid, u32 entry_point,u32 context_id) {u32 cpu = cpuid &0xff ;@@ -155,7 +155,7 @@ int __secure psci_cpu_on(u32 function_id, u32 cpuid, u32 entry_point, return PSCI_RET_SUCCESS; } -void __secure psci_system_reset(u32 function_id) +void __secure psci_system_reset(void) {reset_cpu (0 );}
--
2.7.4
PATCH 19/20 psci: Fix warnings when compiling with W=1
In reply to Patrick DelaunayHi,
Quoted 18 lines
From: Patrick DELAUNAY <[email protected]>
Sent: vendredi 21 juin 2019 15:27This patch solves the following warnings:
arch/arm/mach-stm32mp/psci.c:warning: no previous prototype for ‘psci_set_state’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_arch_cpu_entry’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_features’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_version’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_affinity_info’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_migrate_info_type’ [-Wmissing- prototypes]
warning: no previous prototype for ‘psci_cpu_on’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_cpu_off’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_system_reset’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_system_off’ [-Wmissing-prototypes]
Quoted 9 lines
Signed-off-by Patrick Delaunay <[email protected]>---
arch/arm/include/asm/system.h | 14 ++++++++++++++ arch/arm/mach-imx/mx7/psci-mx7.c | 2 +- arch/arm/mach-stm32mp/psci.c | 18 +++++++++--------- arch/arm/mach-uniphier/arm32/psci.c | 4 ++-- 4 files changed, 26 insertions(+), 12 deletions(-)
Applied to u-boot-stm32/master, thanks!
Patrick
PATCH 20/20 spi: stm32: Fix warnings when compiling with W=1
In reply to Patrick DelaunayThis patch solves the following warnings:
drivers/spi/stm32_spi.c: In function 'stm32_spi_write_txfifo':drivers/spi/stm32_spi.c:116:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (priv->tx_len >= sizeof(u32) &&
^~
drivers/spi/stm32_spi.c:122:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
} else if (priv->tx_len >= sizeof(u16) &&
^~
drivers/spi/stm32_spi.c: In function 'stm32_spi_read_rxfifo':
drivers/spi/stm32_spi.c:150:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
(priv->rx_len >= sizeof(u32) || (sr & SPI_SR_RXWNE))) {
^~
drivers/spi/stm32_spi.c:156:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
(priv->rx_len >= sizeof(u16) ||
^~
drivers/core/simple-bus.c:15:12: warning: no previous prototype for 'simple_bus_translate' [-Wmissing-prototypes]
fdt_addr_t simple_bus_translate(struct udevice *dev, fdt_addr_t addr)
^~~~~~~~~~~~~~~~~~~~
drivers/spi/stm32_spi.c: In function 'stm32_spi_set_speed':
drivers/spi/stm32_spi.c:335:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
div > STM32_MBR_DIV_MAX)
^
drivers/spi/stm32_spi.c:344:19: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
if ((mbrdiv - 1) < 0)
^
drivers/spi/stm32_spi.c: In function 'stm32_spi_probe':
drivers/spi/stm32_spi.c:531:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (i = 0; i < ARRAY_SIZE(priv->cs_gpios); i++) {
^---
drivers/spi/stm32_spi.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/spi/stm32_spi.c +6 -5
@@ -99,8 +99,8 @@ struct stm32_spi_priv {unsigned int cur_bpw;unsigned int cur_hz;unsigned int cur_xferlen;/* current transfer length in bytes */ -int tx_len;/* number of data to be written in bytes */ -int rx_len;/* number of data to be read in bytes */ +unsigned int tx_len;/* number of data to be written in bytes */ +unsigned int rx_len;/* number of data to be read in bytes */ const void *tx_buf;/* data to be written, or NULL */ void *rx_buf;/* data to be read, or NULL */ u32 cur_mode;
@@ -322,7 +322,8 @@ static int stm32_spi_set_fthlv(struct udevice *dev, u32 xfer_len)static int stm32_spi_set_speed (struct udevice *bus,uint hz) {struct stm32_spi_priv *priv =dev_get_priv (bus); -u32 div, mbrdiv; +u32 mbrdiv; +long div;debug ("%s: hz=%d\n" , __func__, hz);
@@ -341,7 +342,7 @@ static int stm32_spi_set_speed(struct udevice *bus, uint hz)else mbrdiv =fls (div) -1 ; -if ((mbrdiv -1 ) <0 ) +if (!mbrdiv)return -EINVAL ; clrsetbits_le32(priv->base + STM32_SPI_CFG1, SPI_CFG1_MBR,
@@ -481,7 +482,7 @@ static int stm32_spi_probe(struct udevice *dev)struct stm32_spi_priv *priv =dev_get_priv (dev);unsigned long clk_rate;int ret; -int i; +unsigned int i; priv->base =dev_remap_addr (dev);if (!priv->base)
Signature · 1 line
2.7.4
PATCH 20/20 spi: stm32: Fix warnings when compiling with W=1
Hi,
Quoted 41 lines
From: Patrick DELAUNAY <[email protected]>
Sent: vendredi 21 juin 2019 15:27This patch solves the following warnings:
drivers/spi/stm32_spi.c: In function 'stm32_spi_write_txfifo':drivers/spi/stm32_spi.c:116:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (priv->tx_len>= sizeof(u32) &&^~ drivers/spi/stm32_spi.c:122:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] } else if (priv->tx_len >= sizeof(u16) && ^~ drivers/spi/stm32_spi.c: In function 'stm32_spi_read_rxfifo': drivers/spi/stm32_spi.c:150:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] (priv->rx_len >= sizeof(u32) || (sr & SPI_SR_RXWNE))) { ^~ drivers/spi/stm32_spi.c:156:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] (priv->rx_len >= sizeof(u16) || ^~ drivers/core/simple-bus.c:15:12: warning: no previous prototype for 'simple_bus_translate' [-Wmissing-prototypes] fdt_addr_t simple_bus_translate(struct udevice *dev, fdt_addr_t addr) ^~~~~~~~~~~~~~~~~~~~ drivers/spi/stm32_spi.c: In function 'stm32_spi_set_speed': drivers/spi/stm32_spi.c:335:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] div > STM32_MBR_DIV_MAX) ^ drivers/spi/stm32_spi.c:344:19: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] if ((mbrdiv - 1) < 0) ^ drivers/spi/stm32_spi.c: In function 'stm32_spi_probe': drivers/spi/stm32_spi.c:531:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (i = 0; i < ARRAY_SIZE(priv->cs_gpios); i++) { ^
Quoted 8 lines
Signed-off-by Patrice Chotard <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
drivers/spi/stm32_spi.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
Applied to u-boot-stm32/master, thanks!
Patrick