* [PATCH 1/4] xilinx: common: Add missing prototype for board_get_usable_ram_top
2023-01-06 12:00 [PATCH 0/4] Fix sparse warnings Ashok Reddy Soma
@ 2023-01-06 12:00 ` Ashok Reddy Soma
2023-01-06 12:44 ` Michal Simek
2023-01-06 12:00 ` [PATCH 2/4] gpio: zynqmp: Remove unused variable ret Ashok Reddy Soma
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Ashok Reddy Soma @ 2023-01-06 12:00 UTC (permalink / raw)
To: u-boot
Cc: michal.simek, peng.fan, jh80.chung, Algapally Santosh Sagar,
Ashok Reddy Soma
From: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Add missing prototype to fix the sparse warning, warning: no previous
prototype for 'board_get_usable_ram_top' [-Wmissing-prototypes].
Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
---
board/xilinx/common/board.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/board/xilinx/common/board.h b/board/xilinx/common/board.h
index 69e642429b..ef7f3f3dce 100644
--- a/board/xilinx/common/board.h
+++ b/board/xilinx/common/board.h
@@ -11,4 +11,8 @@ int board_late_init_xilinx(void);
int xilinx_read_eeprom(void);
+#if defined(CONFIG_LMB)
+phys_size_t board_get_usable_ram_top(phys_size_t total_size);
+#endif
+
#endif /* BOARD_XILINX_COMMON_BOARD_H */
--
2.17.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/4] xilinx: common: Add missing prototype for board_get_usable_ram_top
2023-01-06 12:00 ` [PATCH 1/4] xilinx: common: Add missing prototype for board_get_usable_ram_top Ashok Reddy Soma
@ 2023-01-06 12:44 ` Michal Simek
0 siblings, 0 replies; 10+ messages in thread
From: Michal Simek @ 2023-01-06 12:44 UTC (permalink / raw)
To: Ashok Reddy Soma, u-boot; +Cc: peng.fan, jh80.chung, Algapally Santosh Sagar
On 1/6/23 13:00, Ashok Reddy Soma wrote:
> From: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
>
> Add missing prototype to fix the sparse warning, warning: no previous
> prototype for 'board_get_usable_ram_top' [-Wmissing-prototypes].
>
> Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
> Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
> ---
>
> board/xilinx/common/board.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/board/xilinx/common/board.h b/board/xilinx/common/board.h
> index 69e642429b..ef7f3f3dce 100644
> --- a/board/xilinx/common/board.h
> +++ b/board/xilinx/common/board.h
> @@ -11,4 +11,8 @@ int board_late_init_xilinx(void);
>
> int xilinx_read_eeprom(void);
>
> +#if defined(CONFIG_LMB)
> +phys_size_t board_get_usable_ram_top(phys_size_t total_size);
it is already in include/init.h.
M
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/4] gpio: zynqmp: Remove unused variable ret
2023-01-06 12:00 [PATCH 0/4] Fix sparse warnings Ashok Reddy Soma
2023-01-06 12:00 ` [PATCH 1/4] xilinx: common: Add missing prototype for board_get_usable_ram_top Ashok Reddy Soma
@ 2023-01-06 12:00 ` Ashok Reddy Soma
2023-01-06 12:42 ` Michal Simek
2023-01-06 12:00 ` [PATCH 3/4] xilinx: versal: Add missing prototype Ashok Reddy Soma
` (2 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Ashok Reddy Soma @ 2023-01-06 12:00 UTC (permalink / raw)
To: u-boot
Cc: michal.simek, peng.fan, jh80.chung, Algapally Santosh Sagar,
Ashok Reddy Soma
From: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
There is a unused variable ret, due to which we are getting sparse warning
as below.
warning: variable 'ret' set but not used [-Wunused-but-set-variable].
Remove variable ret.
Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
---
drivers/gpio/zynqmp_gpio_modepin.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpio/zynqmp_gpio_modepin.c b/drivers/gpio/zynqmp_gpio_modepin.c
index 078fd83395..52eda9ceb4 100644
--- a/drivers/gpio/zynqmp_gpio_modepin.c
+++ b/drivers/gpio/zynqmp_gpio_modepin.c
@@ -45,9 +45,8 @@ static int modepin_gpio_set_value(struct udevice *dev, unsigned int offset,
{
u32 ret_payload[PAYLOAD_ARG_CNT];
u32 out_val = 0;
- int ret;
- ret = get_gpio_modepin(ret_payload);
+ get_gpio_modepin(ret_payload);
if (value)
out_val = OUTVAL(offset) | ret_payload[1];
else
--
2.17.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 2/4] gpio: zynqmp: Remove unused variable ret
2023-01-06 12:00 ` [PATCH 2/4] gpio: zynqmp: Remove unused variable ret Ashok Reddy Soma
@ 2023-01-06 12:42 ` Michal Simek
0 siblings, 0 replies; 10+ messages in thread
From: Michal Simek @ 2023-01-06 12:42 UTC (permalink / raw)
To: Ashok Reddy Soma, u-boot; +Cc: peng.fan, jh80.chung, Algapally Santosh Sagar
On 1/6/23 13:00, Ashok Reddy Soma wrote:
> From: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
>
> There is a unused variable ret, due to which we are getting sparse warning
> as below.
> warning: variable 'ret' set but not used [-Wunused-but-set-variable].
>
> Remove variable ret.
>
> Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
> Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
> ---
>
> drivers/gpio/zynqmp_gpio_modepin.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/zynqmp_gpio_modepin.c b/drivers/gpio/zynqmp_gpio_modepin.c
> index 078fd83395..52eda9ceb4 100644
> --- a/drivers/gpio/zynqmp_gpio_modepin.c
> +++ b/drivers/gpio/zynqmp_gpio_modepin.c
> @@ -45,9 +45,8 @@ static int modepin_gpio_set_value(struct udevice *dev, unsigned int offset,
> {
> u32 ret_payload[PAYLOAD_ARG_CNT];
> u32 out_val = 0;
> - int ret;
>
> - ret = get_gpio_modepin(ret_payload);
> + get_gpio_modepin(ret_payload);
:-) what about return error if get_gpio_modepin fails?
M
> if (value)
> out_val = OUTVAL(offset) | ret_payload[1];
> else
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/4] xilinx: versal: Add missing prototype
2023-01-06 12:00 [PATCH 0/4] Fix sparse warnings Ashok Reddy Soma
2023-01-06 12:00 ` [PATCH 1/4] xilinx: common: Add missing prototype for board_get_usable_ram_top Ashok Reddy Soma
2023-01-06 12:00 ` [PATCH 2/4] gpio: zynqmp: Remove unused variable ret Ashok Reddy Soma
@ 2023-01-06 12:00 ` Ashok Reddy Soma
2023-01-06 12:38 ` Michal Simek
2023-01-06 12:00 ` [PATCH 4/4] drivers: mmc: Change datatype to fix a warning Ashok Reddy Soma
2023-01-06 12:45 ` [PATCH 0/4] Fix sparse warnings Michal Simek
4 siblings, 1 reply; 10+ messages in thread
From: Ashok Reddy Soma @ 2023-01-06 12:00 UTC (permalink / raw)
To: u-boot
Cc: michal.simek, peng.fan, jh80.chung, Algapally Santosh Sagar,
Ashok Reddy Soma
From: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Add missing prototype to fix the sparse warning, warning: no
previous prototype for 'do_go_exec' [-Wmissing-prototypes].
Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
---
board/xilinx/versal/board.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/board/xilinx/versal/board.c b/board/xilinx/versal/board.c
index f9f5457ed2..d8562ce47a 100644
--- a/board/xilinx/versal/board.c
+++ b/board/xilinx/versal/board.c
@@ -22,6 +22,7 @@
#include <dm/uclass.h>
#include <versalpl.h>
#include "../common/board.h"
+#include <command.h>
DECLARE_GLOBAL_DATA_PTR;
--
2.17.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 3/4] xilinx: versal: Add missing prototype
2023-01-06 12:00 ` [PATCH 3/4] xilinx: versal: Add missing prototype Ashok Reddy Soma
@ 2023-01-06 12:38 ` Michal Simek
0 siblings, 0 replies; 10+ messages in thread
From: Michal Simek @ 2023-01-06 12:38 UTC (permalink / raw)
To: Ashok Reddy Soma, u-boot; +Cc: peng.fan, jh80.chung, Algapally Santosh Sagar
Add missing header in subject?
On 1/6/23 13:00, Ashok Reddy Soma wrote:
> From: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
>
> Add missing prototype to fix the sparse warning, warning: no
> previous prototype for 'do_go_exec' [-Wmissing-prototypes].
>
> Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
> Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
> ---
>
> board/xilinx/versal/board.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/board/xilinx/versal/board.c b/board/xilinx/versal/board.c
> index f9f5457ed2..d8562ce47a 100644
> --- a/board/xilinx/versal/board.c
> +++ b/board/xilinx/versal/board.c
> @@ -22,6 +22,7 @@
> #include <dm/uclass.h>
> #include <versalpl.h>
> #include "../common/board.h"
> +#include <command.h>
alphabetic order please.
M
>
> DECLARE_GLOBAL_DATA_PTR;
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 4/4] drivers: mmc: Change datatype to fix a warning
2023-01-06 12:00 [PATCH 0/4] Fix sparse warnings Ashok Reddy Soma
` (2 preceding siblings ...)
2023-01-06 12:00 ` [PATCH 3/4] xilinx: versal: Add missing prototype Ashok Reddy Soma
@ 2023-01-06 12:00 ` Ashok Reddy Soma
2023-01-06 12:41 ` Michal Simek
2023-01-06 12:45 ` [PATCH 0/4] Fix sparse warnings Michal Simek
4 siblings, 1 reply; 10+ messages in thread
From: Ashok Reddy Soma @ 2023-01-06 12:00 UTC (permalink / raw)
To: u-boot
Cc: michal.simek, peng.fan, jh80.chung, Algapally Santosh Sagar,
Ashok Reddy Soma
From: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
tuning_loop_counter is of char type. Change to int to fix below warning.
warning: comparison is always false due to limited range of data type.
Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
---
drivers/mmc/zynq_sdhci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c
index 7dcf6ad842..be4075c97a 100644
--- a/drivers/mmc/zynq_sdhci.c
+++ b/drivers/mmc/zynq_sdhci.c
@@ -249,7 +249,7 @@ static int arasan_sdhci_execute_tuning(struct mmc *mmc, u8 opcode)
u32 ctrl;
struct sdhci_host *host;
struct arasan_sdhci_priv *priv = dev_get_priv(mmc->dev);
- char tuning_loop_counter = SDHCI_TUNING_LOOP_COUNT;
+ int tuning_loop_counter = SDHCI_TUNING_LOOP_COUNT;
dev_dbg(mmc->dev, "%s\n", __func__);
--
2.17.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 4/4] drivers: mmc: Change datatype to fix a warning
2023-01-06 12:00 ` [PATCH 4/4] drivers: mmc: Change datatype to fix a warning Ashok Reddy Soma
@ 2023-01-06 12:41 ` Michal Simek
0 siblings, 0 replies; 10+ messages in thread
From: Michal Simek @ 2023-01-06 12:41 UTC (permalink / raw)
To: Ashok Reddy Soma, u-boot; +Cc: peng.fan, jh80.chung, Algapally Santosh Sagar
mmc: zynq_sdhci: Fix wrong tuning_loop_counter datatype
On 1/6/23 13:00, Ashok Reddy Soma wrote:
> From: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
>
> tuning_loop_counter is of char type. Change to int to fix below warning.
> warning: comparison is always false due to limited range of data type.
Conceptually description should be done a way that you say I fixed this issue
because datatype wasn't correct.
And this was reported by spare.
And you are doing it because it is not correct not because there is a warning.
Warning just points to it.
M
>
> Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
> Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
> ---
>
> drivers/mmc/zynq_sdhci.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c
> index 7dcf6ad842..be4075c97a 100644
> --- a/drivers/mmc/zynq_sdhci.c
> +++ b/drivers/mmc/zynq_sdhci.c
> @@ -249,7 +249,7 @@ static int arasan_sdhci_execute_tuning(struct mmc *mmc, u8 opcode)
> u32 ctrl;
> struct sdhci_host *host;
> struct arasan_sdhci_priv *priv = dev_get_priv(mmc->dev);
> - char tuning_loop_counter = SDHCI_TUNING_LOOP_COUNT;
> + int tuning_loop_counter = SDHCI_TUNING_LOOP_COUNT;
>
> dev_dbg(mmc->dev, "%s\n", __func__);
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/4] Fix sparse warnings
2023-01-06 12:00 [PATCH 0/4] Fix sparse warnings Ashok Reddy Soma
` (3 preceding siblings ...)
2023-01-06 12:00 ` [PATCH 4/4] drivers: mmc: Change datatype to fix a warning Ashok Reddy Soma
@ 2023-01-06 12:45 ` Michal Simek
4 siblings, 0 replies; 10+ messages in thread
From: Michal Simek @ 2023-01-06 12:45 UTC (permalink / raw)
To: Ashok Reddy Soma, u-boot; +Cc: peng.fan, jh80.chung
On 1/6/23 13:00, Ashok Reddy Soma wrote:
> Run and fix sparse warnings in below files
> -drivers/mmc/zynq_sdhci.c
> -board/xilinx/common/board.h
> -drivers/gpio/zynqmp_gpio_modepin.c
> -board/xilinx/versal/board.c
>
>
> Algapally Santosh Sagar (4):
> xilinx: common: Add missing prototype for board_get_usable_ram_top
> gpio: zynqmp: Remove unused variable ret
> xilinx: versal: Add missing prototype
> drivers: mmc: Change datatype to fix a warning
>
> board/xilinx/common/board.h | 4 ++++
> board/xilinx/versal/board.c | 1 +
> drivers/gpio/zynqmp_gpio_modepin.c | 3 +--
> drivers/mmc/zynq_sdhci.c | 2 +-
> 4 files changed, 7 insertions(+), 3 deletions(-)
>
Please do it against upstream.
M
^ permalink raw reply [flat|nested] 10+ messages in thread