Skip to content

Commit

Permalink
ARC: slightly refactor macros for boot logging
Browse files Browse the repository at this point in the history
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
  • Loading branch information
Vineet Gupta committed Jul 9, 2015
1 parent 9138d41 commit b631788
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions arch/arc/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,10 @@ static const struct cpuinfo_data arc_cpu_tbl[] = {
{ {0x00, NULL } }
};

#define IS_AVAIL1(v, str) ((v) ? str : "")
#define IS_USED(cfg) (IS_ENABLED(cfg) ? "" : "(not used) ")
#define IS_AVAIL2(v, str, cfg) IS_AVAIL1(v, str), IS_AVAIL1(v, IS_USED(cfg))
#define IS_AVAIL1(v, s) ((v) ? s : "")
#define IS_USED_RUN(v) ((v) ? "" : "(not used) ")
#define IS_USED_CFG(cfg) IS_USED_RUN(IS_ENABLED(cfg))
#define IS_AVAIL2(v, s, cfg) IS_AVAIL1(v, s), IS_AVAIL1(v, IS_USED_CFG(cfg))

static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len)
{
Expand Down Expand Up @@ -226,7 +227,7 @@ static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len)
n += scnprintf(buf + n, len - n, "mpy[opt %d] ", opt);
}
n += scnprintf(buf + n, len - n, "%s",
IS_USED(CONFIG_ARC_HAS_HW_MPY));
IS_USED_CFG(CONFIG_ARC_HAS_HW_MPY));
}

n += scnprintf(buf + n, len - n, "%s%s%s%s%s%s%s%s\n",
Expand Down

0 comments on commit b631788

Please sign in to comment.