@@ -424,8 +424,8 @@ static void reboot_recovery(char *cmd_parameter, char *response)
static void __maybe_unused oem_format(char *cmd_parameter, char *response)
{
char cmdbuf[32];
- const int mmc_dev = config_opt_enabled(CONFIG_FASTBOOT_FLASH_MMC,
- CONFIG_FASTBOOT_FLASH_MMC_DEV, -1);
+ const int mmc_dev = IS_ENABLED(CONFIG_FASTBOOT_FLASH_MMC,
+ (CONFIG_FASTBOOT_FLASH_MMC_DEV), (-1));
if (!env_get("partitions")) {
fastboot_fail("partitions not set", response);
@@ -447,8 +447,8 @@ static void __maybe_unused oem_format(char *cmd_parameter, char *response)
static void __maybe_unused oem_partconf(char *cmd_parameter, char *response)
{
char cmdbuf[32];
- const int mmc_dev = config_opt_enabled(CONFIG_FASTBOOT_FLASH_MMC,
- CONFIG_FASTBOOT_FLASH_MMC_DEV, -1);
+ const int mmc_dev = IS_ENABLED(CONFIG_FASTBOOT_FLASH_MMC,
+ (CONFIG_FASTBOOT_FLASH_MMC_DEV), (-1));
if (!cmd_parameter) {
fastboot_fail("Expected command parameter", response);
@@ -473,8 +473,8 @@ static void __maybe_unused oem_partconf(char *cmd_parameter, char *response)
static void __maybe_unused oem_bootbus(char *cmd_parameter, char *response)
{
char cmdbuf[32];
- const int mmc_dev = config_opt_enabled(CONFIG_FASTBOOT_FLASH_MMC,
- CONFIG_FASTBOOT_FLASH_MMC_DEV, -1);
+ const int mmc_dev = IS_ENABLED(CONFIG_FASTBOOT_FLASH_MMC,
+ (CONFIG_FASTBOOT_FLASH_MMC_DEV), (-1));
if (!cmd_parameter) {
fastboot_fail("Expected command parameter", response);
@@ -96,8 +96,8 @@ int __weak fastboot_set_reboot_flag(enum fastboot_reboot_reason reason)
[FASTBOOT_REBOOT_REASON_FASTBOOTD] = "boot-fastboot",
[FASTBOOT_REBOOT_REASON_RECOVERY] = "boot-recovery"
};
- const int mmc_dev = config_opt_enabled(CONFIG_FASTBOOT_FLASH_MMC,
- CONFIG_FASTBOOT_FLASH_MMC_DEV, -1);
+ const int mmc_dev = IS_ENABLED(CONFIG_FASTBOOT_FLASH_MMC,
+ (CONFIG_FASTBOOT_FLASH_MMC_DEV), (-1));
if (!IS_ENABLED(CONFIG_FASTBOOT_FLASH_MMC))
return -EINVAL;
@@ -36,17 +36,6 @@
#define CONFIG_VAL(option) __config_val(option)
-/*
- * This uses a similar mechanism to config_enabled() above. If cfg is enabled,
- * it resolves to the value of opt_cfg, otherwise it resolves to def_val
- */
-#define config_opt_enabled(cfg, opt_cfg, def_val) _config_opt_enabled(cfg, opt_cfg, def_val)
-#define _config_opt_enabled(cfg_val, opt_value, def_val) \
- __config_opt_enabled(__ARG_PLACEHOLDER_##cfg_val, opt_value, def_val)
-#define __config_opt_enabled(arg1_or_junk, arg2, def_val) \
- ___config_opt_enabled(arg1_or_junk arg2, def_val)
-#define ___config_opt_enabled(__ignored, val, ...) val
-
/*
* Count number of arguments to a variadic macro. Currently only need
* it for 1, 2 or 3 arguments.
@@ -736,7 +736,8 @@ static void sanitize_tftp_block_size_option(enum proto_t protocol)
switch (protocol) {
case TFTPGET:
- max_defrag = config_opt_enabled(CONFIG_IP_DEFRAG, CONFIG_NET_MAXDEFRAG, 0);
+ max_defrag = IS_ENABLED(CONFIG_IP_DEFRAG,
+ (CONFIG_NET_MAXDEFRAG), (0));
if (max_defrag) {
/* Account for IP, UDP and TFTP headers. */
cap = max_defrag - (20 + 8 + 4);
This is include used in three places. It does not appear in Linux. Use IS_ENABLED() instead since it provides a similar feature, albeit needing brackets. Signed-off-by: Simon Glass <sjg@chromium.org> --- (no changes since v1) drivers/fastboot/fb_command.c | 12 ++++++------ drivers/fastboot/fb_common.c | 4 ++-- include/linux/kconfig.h | 11 ----------- net/tftp.c | 3 ++- 4 files changed, 10 insertions(+), 20 deletions(-)