|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen staging] core-parking: adjust data/code placement
commit 0e306f590ce7c713ac4ad018fd8c0b46ed8a018c
Author: Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Mon May 13 10:09:28 2019 +0200
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon May 13 10:09:28 2019 +0200
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 <jbeulich@xxxxxxxx>
Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
xen/common/core_parking.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
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;
--
generated by git-patchbot for /home/xen/git/xen.git#staging
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |