(b) I'm confused by how some parts of it are relevant to the goal,
particularly these hunks:
--- a/sys/lib/libsa/bootcfg.c Tue May 06 17:12:33 2025 +0000
+++ b/sys/lib/libsa/bootcfg.c Tue May 06 18:16:12 2025 +0000
...
@@ -227,8 +227,6 @@ perform_bootcfg(const char *conf, bootcf
bootcfg_info.consdev = value;
} else if (!strncmp(key, "root", 4)) {
bootcfg_info.root = value;
- } else if (!strncmp(key, BOOTCFG_CMD_LOAD, 4)) {
- command(BOOTCFG_CMD_LOAD, value);
} else if (!strncmp(key, "format", 6)) {
printf("value:%c\n", *value);
switch (*value) {
@@ -251,8 +249,6 @@ perform_bootcfg(const char *conf, bootcf
}
} else if (!strncmp(key, "clear", 5)) {
bootcfg_info.clear = !!atoi(value);
- } else if (!strncmp(key, BOOTCFG_CMD_USERCONF, 8)) {
- command(BOOTCFG_CMD_USERCONF, value);
} else {
command(key, value);
}
Were these branches already dead code? Are they _now_ dead code on
x86, but possibly would have been still live on non-x86 bootloaders?
Looks to me like duplicated code, since they fall thru to the
trailing else clause. Keeping the original doesn't hurt, but you
end up with
...
else if (match(key, KEY))
cmd(key, value)
else if
...
else
cmd(key, value);
Presumably this gets optimized by the compiler. :)
+---------------------+--------------------------+----------------------+
| Paul Goyette (.sig) | PGP Key fingerprint: | E-mail addresses: |
| (Retired) | 1B11 1849 721C 56C8 F63A | p...@whooppee.com |
| Software Developer | 6E2E 05FD 15CE 9F2D 5102 | pgoye...@netbsd.org |
| & Network Engineer | | pgoyett...@gmail.com |
+---------------------+--------------------------+----------------------+