Paul Menzel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38785 )
Change subject: mb/pcengines/apu2: Remove unnecessary initialization ......................................................................
mb/pcengines/apu2: Remove unnecessary initialization
The variable is never read before being assigned a value at the end of the function.
Change-Id: I3b42dcd564480005b2c520316933940d87b6e418 Signed-off-by: Paul Menzel pmenzel@molgen.mpg.de --- M src/mainboard/pcengines/apu2/mainboard.c 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/85/38785/1
diff --git a/src/mainboard/pcengines/apu2/mainboard.c b/src/mainboard/pcengines/apu2/mainboard.c index 9bf58a7..bd2ca39 100644 --- a/src/mainboard/pcengines/apu2/mainboard.c +++ b/src/mainboard/pcengines/apu2/mainboard.c @@ -192,7 +192,7 @@ unsigned long *current) { struct smbios_type17 *t; - int len = 0; + int len;
t = (struct smbios_type17 *)*current; memset(t, 0, sizeof(struct smbios_type17));
Michał Żygowski has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38785 )
Change subject: mb/pcengines/apu2: Remove unnecessary initialization ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/38785/1/src/mainboard/pcengines/apu... File src/mainboard/pcengines/apu2/mainboard.c:
https://review.coreboot.org/c/coreboot/+/38785/1/src/mainboard/pcengines/apu... PS1, Line 231: return len; if you do: ``` *current += t->length + smbios_string_table_len(t->eos);
return t->length + smbios_string_table_len(t->eos); ``` you may completely remove the len variable
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38785 )
Change subject: mb/pcengines/apu2: Remove unnecessary initialization ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/38785/1/src/mainboard/pcengines/apu... File src/mainboard/pcengines/apu2/mainboard.c:
https://review.coreboot.org/c/coreboot/+/38785/1/src/mainboard/pcengines/apu... PS1, Line 231: return len;
if you do: […]
True, but in this case, I would keep it to not duplicate the calculation twice, and a variable makes sense.
Michał Żygowski has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38785 )
Change subject: mb/pcengines/apu2: Remove unnecessary initialization ......................................................................
Patch Set 1: Code-Review+2
Michał Żygowski has submitted this change. ( https://review.coreboot.org/c/coreboot/+/38785 )
Change subject: mb/pcengines/apu2: Remove unnecessary initialization ......................................................................
mb/pcengines/apu2: Remove unnecessary initialization
The variable is never read before being assigned a value at the end of the function.
Change-Id: I3b42dcd564480005b2c520316933940d87b6e418 Signed-off-by: Paul Menzel pmenzel@molgen.mpg.de Reviewed-on: https://review.coreboot.org/c/coreboot/+/38785 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Michał Żygowski michal.zygowski@3mdeb.com --- M src/mainboard/pcengines/apu2/mainboard.c 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Michał Żygowski: Looks good to me, approved
diff --git a/src/mainboard/pcengines/apu2/mainboard.c b/src/mainboard/pcengines/apu2/mainboard.c index 9bf58a7..bd2ca39 100644 --- a/src/mainboard/pcengines/apu2/mainboard.c +++ b/src/mainboard/pcengines/apu2/mainboard.c @@ -192,7 +192,7 @@ unsigned long *current) { struct smbios_type17 *t; - int len = 0; + int len;
t = (struct smbios_type17 *)*current; memset(t, 0, sizeof(struct smbios_type17));
9elements QA has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38785 )
Change subject: mb/pcengines/apu2: Remove unnecessary initialization ......................................................................
Patch Set 2:
Automatic boot test returned (PASS/FAIL/TOTAL): 3/0/3 Emulation targets: EMULATION_QEMU_X86_Q35 using payload TianoCore : SUCCESS : https://lava.9esec.io/r/580 EMULATION_QEMU_X86_Q35 using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/579 EMULATION_QEMU_X86_I440FX using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/578
Please note: This test is under development and might not be accurate at all!