Skip to contentSkip to conversation

lib: rsa: cosmetic: fix building warning

PATCH In review Haijun Qin 3 participants 4 messages Dec 6, 2022 – Jan 12, 2023

lore
Share & tools
lore

Haijun Qin

author
#0 lore raw

PATCH 1/1 lib: rsa: cosmetic: fix building warning

add initialization of variable 'node',this can aviod the building warning:

'node' may be used uninitialized [-Wmaybe-uninitialized]

---
 lib/rsa/rsa-sign.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/rsa/rsa-sign.c +1 -1
index b2a21199e4..d20bdb58a5 100644
@@ -608,7 +608,7 @@ int rsa_add_verify_data(struct image_sign_info *info, void *keydest)
 	BIGNUM *modulus, *r_squared;
 	uint64_t exponent;
 	uint32_t n0_inv;
-	int parent, node;
+	int parent, node = -FDT_ERR_NOTFOUND;
 	char name[100];
 	int ret;
 	int bits;

base-commit: d2c5607edde2544e059fa871927877213f6bd532

Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Haijun Qin

add initialization of variable 'node',this can aviod the building warning:

'node' may be used uninitialized [-Wmaybe-uninitialized]

---
 lib/rsa/rsa-sign.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

What toolchain is this?

Quoted 19 lines
lib/rsa/rsa-sign.c +1 -1
index b2a21199e4..d20bdb58a5 100644
@@ -608,7 +608,7 @@ int rsa_add_verify_data(struct image_sign_info *info, void *keydest)
        BIGNUM *modulus, *r_squared;
        uint64_t exponent;
        uint32_t n0_inv;
-       int parent, node;
+       int parent, node = -FDT_ERR_NOTFOUND;
        char name[100];
        int ret;
        int bits;

base-commit: d2c5607edde2544e059fa871927877213f6bd532 --
2.17.1

author
#2 lore raw

Hi,Simon

The toolchain source code we use comes from here(https://github.com/riscv-collab/riscv-gnu-toolchain), but we have made some changes.

Quoted 36 lines · Haijun Qin
Quoted 10 lines

add initialization of variable 'node',this can aviod the building warning:

'node' may be used uninitialized [-Wmaybe-uninitialized]

---
 lib/rsa/rsa-sign.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

What toolchain is this?

Quoted 19 lines
lib/rsa/rsa-sign.c +1 -1
index b2a21199e4..d20bdb58a5 100644
@@ -608,7 +608,7 @@ int rsa_add_verify_data(struct image_sign_info *info, void *keydest)
        BIGNUM *modulus, *r_squared;
        uint64_t exponent;
        uint32_t n0_inv;
-       int parent, node;
+       int parent, node = -FDT_ERR_NOTFOUND;
        char name[100];
        int ret;
        int bits;

base-commit: d2c5607edde2544e059fa871927877213f6bd532 --
2.17.1