mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-24 05:30:37 +09:00
cmd: pxe_utils: Replace ifdef by IS_ENABLED
Replace all the macro ifdef by IS_ENABLED. All of these configs are set in the defconfig files and not in the include board headers files. Signed-off-by: Kory Maincent <kory.maincent@bootlin.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: keep the preprocessor case unchanged] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
parent
d3a3d44fe2
commit
ff0287ec28
@ -492,16 +492,16 @@ static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label)
|
|||||||
env_get("gatewayip"), env_get("netmask"));
|
env_get("gatewayip"), env_get("netmask"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_CMD_NET
|
if (IS_ENABLED(CONFIG_CMD_NET)) {
|
||||||
if (label->ipappend & 0x2) {
|
if (label->ipappend & 0x2) {
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
strcpy(mac_str, " BOOTIF=");
|
strcpy(mac_str, " BOOTIF=");
|
||||||
err = format_mac_pxe(mac_str + 8, sizeof(mac_str) - 8);
|
err = format_mac_pxe(mac_str + 8, sizeof(mac_str) - 8);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
mac_str[0] = '\0';
|
mac_str[0] = '\0';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((label->ipappend & 0x3) || label->append) {
|
if ((label->ipappend & 0x3) || label->append) {
|
||||||
char bootargs[CONFIG_SYS_CBSIZE] = "";
|
char bootargs[CONFIG_SYS_CBSIZE] = "";
|
||||||
@ -649,15 +649,13 @@ static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label)
|
|||||||
/* Try bootm for legacy and FIT format image */
|
/* Try bootm for legacy and FIT format image */
|
||||||
if (genimg_get_format(buf) != IMAGE_FORMAT_INVALID)
|
if (genimg_get_format(buf) != IMAGE_FORMAT_INVALID)
|
||||||
do_bootm(cmdtp, 0, bootm_argc, bootm_argv);
|
do_bootm(cmdtp, 0, bootm_argc, bootm_argv);
|
||||||
#ifdef CONFIG_CMD_BOOTI
|
|
||||||
/* Try booting an AArch64 Linux kernel image */
|
/* Try booting an AArch64 Linux kernel image */
|
||||||
else
|
else if (IS_ENABLED(CONFIG_CMD_BOOTI))
|
||||||
do_booti(cmdtp, 0, bootm_argc, bootm_argv);
|
do_booti(cmdtp, 0, bootm_argc, bootm_argv);
|
||||||
#elif defined(CONFIG_CMD_BOOTZ)
|
|
||||||
/* Try booting a Image */
|
/* Try booting a Image */
|
||||||
else
|
else if (IS_ENABLED(CONFIG_CMD_BOOTZ))
|
||||||
do_bootz(cmdtp, 0, bootm_argc, bootm_argv);
|
do_bootz(cmdtp, 0, bootm_argc, bootm_argv);
|
||||||
#endif
|
|
||||||
unmap_sysmem(buf);
|
unmap_sysmem(buf);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
@ -1424,20 +1422,20 @@ void handle_pxe_menu(struct cmd_tbl *cmdtp, struct pxe_menu *cfg)
|
|||||||
struct menu *m;
|
struct menu *m;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
#ifdef CONFIG_CMD_BMP
|
if (IS_ENABLED(CONFIG_CMD_BMP)) {
|
||||||
/* display BMP if available */
|
/* display BMP if available */
|
||||||
if (cfg->bmp) {
|
if (cfg->bmp) {
|
||||||
if (get_relfile(cmdtp, cfg->bmp, image_load_addr)) {
|
if (get_relfile(cmdtp, cfg->bmp, image_load_addr)) {
|
||||||
if (CONFIG_IS_ENABLED(CMD_CLS))
|
if (CONFIG_IS_ENABLED(CMD_CLS))
|
||||||
run_command("cls", 0);
|
run_command("cls", 0);
|
||||||
bmp_display(image_load_addr,
|
bmp_display(image_load_addr,
|
||||||
BMP_ALIGN_CENTER, BMP_ALIGN_CENTER);
|
BMP_ALIGN_CENTER, BMP_ALIGN_CENTER);
|
||||||
} else {
|
} else {
|
||||||
printf("Skipping background bmp %s for failure\n",
|
printf("Skipping background bmp %s for failure\n",
|
||||||
cfg->bmp);
|
cfg->bmp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
m = pxe_menu_to_menu(cfg);
|
m = pxe_menu_to_menu(cfg);
|
||||||
if (!m)
|
if (!m)
|
||||||
|
Loading…
Reference in New Issue
Block a user