From: Jan Beulich Date: Mon, 13 May 2019 08:09:28 +0000 (+0200) Subject: core-parking: adjust data/code placement X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~2306 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0e306f590ce7c713ac4ad018fd8c0b46ed8a018c;p=xen.git core-parking: adjust data/code placement Use __init{data,}, __read_mostly, and const as far as possible. Take the liberty and also shorten the policy structure's tag name. Signed-off-by: Jan Beulich Acked-by: Andrew Cooper --- diff --git a/xen/common/core_parking.c b/xen/common/core_parking.c index 803c6c7911..7ae5d6278e 100644 --- a/xen/common/core_parking.c +++ b/xen/common/core_parking.c @@ -31,15 +31,15 @@ static unsigned int core_parking_performance(unsigned int event); static uint32_t cur_idle_nums; static unsigned int core_parking_cpunum[NR_CPUS] = {[0 ... NR_CPUS-1] = -1}; -static struct core_parking_policy { +static const struct cp_policy { char name[30]; unsigned int (*next)(unsigned int event); -} *core_parking_policy; +} *__read_mostly core_parking_policy; static enum core_parking_controller { POWER_FIRST, PERFORMANCE_FIRST -} core_parking_controller = POWER_FIRST; +} core_parking_controller __initdata = POWER_FIRST; static int __init setup_core_parking_option(const char *str) { @@ -205,17 +205,17 @@ uint32_t get_cur_idle_nums(void) return cur_idle_nums; } -static struct core_parking_policy power_first = { +static const struct cp_policy power_first = { .name = "power", .next = core_parking_power, }; -static struct core_parking_policy performance_first = { +static const struct cp_policy performance_first = { .name = "performance", .next = core_parking_performance, }; -static int register_core_parking_policy(struct core_parking_policy *policy) +static int __init register_core_parking_policy(const struct cp_policy *policy) { if ( !policy || !policy->next ) return -EINVAL;