
From: Simon Glass <sjg@chromium.org> Using this macro, even bracketed with 'if (IS_ENABLED(CONFIG_IDE))' causes a compile error if CONFIG_IDE is not enabled. Update the macros to resolve this, so we can avoid #ifdefs in the C code. Signed-off-by: Simon Glass <sjg@chromium.org> --- include/ide.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/ide.h b/include/ide.h index 2c25e74ede0..705d7cd5970 100644 --- a/include/ide.h +++ b/include/ide.h @@ -9,7 +9,9 @@ #include <blk.h> -#define IDE_BUS(dev) (dev / (CONFIG_SYS_IDE_MAXDEVICE / CONFIG_SYS_IDE_MAXBUS)) +#define IDE_BUS(dev) ((dev) / \ + (IF_ENABLED_INT(CONFIG_IDE, CONFIG_SYS_IDE_MAXDEVICE) / \ + IF_ENABLED_INT(CONFIG_IDE, CONFIG_SYS_IDE_MAXBUS))) /** * ide_set_reset() - Assert or de-assert reset for the IDE device -- 2.43.0