* [v2 UBOOT PATCH 1/3] xilinx: common: Fix static checker warnings
@ 2022-09-26 6:25 Venkatesh Yadav Abbarapu
2022-09-26 6:45 ` Abbarapu, Venkatesh
0 siblings, 1 reply; 2+ messages in thread
From: Venkatesh Yadav Abbarapu @ 2022-09-26 6:25 UTC (permalink / raw)
To: u-boot; +Cc: michal.simek, git
Avoid signed extension for uuid and byte.
Eliminate the below smatch warnings:
board/xilinx/common/board.c:128 xilinx_eeprom_legacy_cleanup()
warn: impossible condition '(byte == 255) => ((-128)-127 == 255)'
board/xilinx/common/board.c:466 board_late_init_xilinx()
warn: argument 3 to %02x specifier has type 'char'
board/xilinx/common/board.c:466 board_late_init_xilinx()
warn: argument 4 to %02x specifier has type 'char'
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
---
board/xilinx/common/board.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c
index 9b4aded466..2b6ead5269 100644
--- a/board/xilinx/common/board.c
+++ b/board/xilinx/common/board.c
@@ -119,7 +119,7 @@ struct xilinx_legacy_format {
static void xilinx_eeprom_legacy_cleanup(char *eeprom, int size)
{
int i;
- char byte;
+ unsigned char byte;
for (i = 0; i < size; i++) {
byte = eeprom[i];
@@ -458,8 +458,8 @@ int board_late_init_xilinx(void)
desc->serial);
if (desc->uuid[0]) {
- char uuid[UUID_STR_LEN + 1];
- char *t = desc->uuid;
+ unsigned char uuid[UUID_STR_LEN + 1];
+ unsigned char *t = desc->uuid;
memset(uuid, 0, UUID_STR_LEN + 1);
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [v2 UBOOT PATCH 1/3] xilinx: common: Fix static checker warnings
2022-09-26 6:25 [v2 UBOOT PATCH 1/3] xilinx: common: Fix static checker warnings Venkatesh Yadav Abbarapu
@ 2022-09-26 6:45 ` Abbarapu, Venkatesh
0 siblings, 0 replies; 2+ messages in thread
From: Abbarapu, Venkatesh @ 2022-09-26 6:45 UTC (permalink / raw)
To: Abbarapu, Venkatesh, u-boot; +Cc: Simek, Michal, git
Please ignore this patch.
Thanks
Venkatesh
> -----Original Message-----
> From: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
> Sent: Monday, September 26, 2022 11:55 AM
> To: u-boot@lists.denx.de
> Cc: Simek, Michal <michal.simek@amd.com>; git@xilinx.com
> Subject: [v2 UBOOT PATCH 1/3] xilinx: common: Fix static checker warnings
>
> Avoid signed extension for uuid and byte.
>
> Eliminate the below smatch warnings:
> board/xilinx/common/board.c:128 xilinx_eeprom_legacy_cleanup()
> warn: impossible condition '(byte == 255) => ((-128)-127 == 255)'
>
> board/xilinx/common/board.c:466 board_late_init_xilinx()
> warn: argument 3 to %02x specifier has type 'char'
> board/xilinx/common/board.c:466 board_late_init_xilinx()
> warn: argument 4 to %02x specifier has type 'char'
>
> Signed-off-by: Venkatesh Yadav Abbarapu
> <venkatesh.abbarapu@amd.com>
> ---
> board/xilinx/common/board.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c
> index 9b4aded466..2b6ead5269 100644
> --- a/board/xilinx/common/board.c
> +++ b/board/xilinx/common/board.c
> @@ -119,7 +119,7 @@ struct xilinx_legacy_format { static void
> xilinx_eeprom_legacy_cleanup(char *eeprom, int size) {
> int i;
> - char byte;
> + unsigned char byte;
>
> for (i = 0; i < size; i++) {
> byte = eeprom[i];
> @@ -458,8 +458,8 @@ int board_late_init_xilinx(void)
> desc->serial);
>
> if (desc->uuid[0]) {
> - char uuid[UUID_STR_LEN + 1];
> - char *t = desc->uuid;
> + unsigned char uuid[UUID_STR_LEN + 1];
> + unsigned char *t = desc->uuid;
>
> memset(uuid, 0, UUID_STR_LEN + 1);
>
> --
> 2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-26 11:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-26 6:25 [v2 UBOOT PATCH 1/3] xilinx: common: Fix static checker warnings Venkatesh Yadav Abbarapu
2022-09-26 6:45 ` Abbarapu, Venkatesh
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.