Match data stores hardware attributes which do not change at runtime, so
it does not need to be mutable. Make it const.
Reviewed-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Xiang W <wxjstz@126.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Samuel Holland <samuel@sholland.org>
struct fdt_match {
const char *compatible;
- void *data;
+ const void *data;
};
#define FDT_MAX_PHANDLE_ARGS 16
return 0;
}
-static unsigned long clint_offset = CLINT_MSWI_OFFSET;
+static const unsigned long clint_offset = CLINT_MSWI_OFFSET;
static const struct fdt_match ipi_mswi_match[] = {
{ .compatible = "riscv,clint0", .data = &clint_offset },
}
static const struct fdt_match gpio_poweroff_match[] = {
- { .compatible = "gpio-poweroff", .data = (void *)FALSE },
+ { .compatible = "gpio-poweroff", .data = (const void *)FALSE },
{ },
};
};
static const struct fdt_match gpio_reset_match[] = {
- { .compatible = "gpio-restart", .data = (void *)TRUE },
+ { .compatible = "gpio-restart", .data = (const void *)TRUE },
{ },
};
return 0;
}
-static unsigned long clint_offset = CLINT_MTIMER_OFFSET;
+static const unsigned long clint_offset = CLINT_MTIMER_OFFSET;
static const struct fdt_match timer_mtimer_match[] = {
{ .compatible = "riscv,clint0", .data = &clint_offset },