[openwrt/openwrt] firmware-utils/ptgen: remove unused variable assignment

LEDE Commits lede-commits at lists.infradead.org
Sun Mar 14 22:00:57 GMT 2021


dangole pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/00a326a7360e5e172962e65392e85308e847997e

commit 00a326a7360e5e172962e65392e85308e847997e
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Sun Mar 14 19:04:20 2021 +0000

    firmware-utils/ptgen: remove unused variable assignment
    
    Discovered by coverty:
    
     CID 1473630:  Code maintainability issues  (UNUSED_VALUE)
    
     Assigning value from "type_to_guid_and_name(type, &name)" to
     "part_guid" here, but that stored value is overwritten before it can
     be used.
    
    Remove the now redundant assignment of part_guid which is also set
    conditionally later on.
    
    Fixes: 4a078bd135 ("firmware-utils/ptgen: fix partition guid and name")
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 tools/firmware-utils/src/ptgen.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/firmware-utils/src/ptgen.c b/tools/firmware-utils/src/ptgen.c
index 1eed21393d..d911b9d1f0 100644
--- a/tools/firmware-utils/src/ptgen.c
+++ b/tools/firmware-utils/src/ptgen.c
@@ -630,7 +630,6 @@ int main (int argc, char **argv)
 			break;
 		case 't':
 			type = (char)strtoul(optarg, NULL, 16);
-			part_guid = type_to_guid_and_name(type, &name);
 			break;
 		case 'a':
 			active = (int)strtoul(optarg, NULL, 0);



More information about the lede-commits mailing list