Skip to content

Commit 095928a

Browse files
committed
intel_idle: Annotate initialization code and data structures
Annotate the functions that are only used at the initialization time with __init and the data structures used by them with __initdata or __initconst. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 0755a9b commit 095928a

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

‎drivers/idle/intel_idle.c‎

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ static const struct x86_cpu_id intel_mwait_ids[] __initconst = {
11481148
{}
11491149
};
11501150

1151-
static bool intel_idle_max_cstate_reached(int cstate)
1151+
static bool __init intel_idle_max_cstate_reached(int cstate)
11521152
{
11531153
if (cstate + 1 > max_cstate) {
11541154
pr_info("max_cstate %d reached\n", max_cstate);
@@ -1164,15 +1164,15 @@ static bool no_acpi __read_mostly;
11641164
module_param(no_acpi, bool, 0444);
11651165
MODULE_PARM_DESC(no_acpi, "Do not use ACPI _CST for building the idle states list");
11661166

1167-
static struct acpi_processor_power acpi_state_table;
1167+
static struct acpi_processor_power acpi_state_table __initdata;
11681168

11691169
/**
11701170
* intel_idle_cst_usable - Check if the _CST information can be used.
11711171
*
11721172
* Check if all of the C-states listed by _CST in the max_cstate range are
11731173
* ACPI_CSTATE_FFH, which means that they should be entered via MWAIT.
11741174
*/
1175-
static bool intel_idle_cst_usable(void)
1175+
static bool __init intel_idle_cst_usable(void)
11761176
{
11771177
int cstate, limit;
11781178

@@ -1189,7 +1189,7 @@ static bool intel_idle_cst_usable(void)
11891189
return true;
11901190
}
11911191

1192-
static bool intel_idle_acpi_cst_extract(void)
1192+
static bool __init intel_idle_acpi_cst_extract(void)
11931193
{
11941194
unsigned int cpu;
11951195

@@ -1224,7 +1224,7 @@ static bool intel_idle_acpi_cst_extract(void)
12241224
return false;
12251225
}
12261226

1227-
static void intel_idle_init_cstates_acpi(struct cpuidle_driver *drv)
1227+
static void __init intel_idle_init_cstates_acpi(struct cpuidle_driver *drv)
12281228
{
12291229
int cstate, limit = min_t(int, CPUIDLE_STATE_MAX, acpi_state_table.count);
12301230

@@ -1268,7 +1268,7 @@ static void intel_idle_init_cstates_acpi(struct cpuidle_driver *drv)
12681268
}
12691269
}
12701270

1271-
static bool intel_idle_off_by_default(u32 mwait_hint)
1271+
static bool __init intel_idle_off_by_default(u32 mwait_hint)
12721272
{
12731273
int cstate, limit;
12741274

@@ -1302,7 +1302,7 @@ static inline bool intel_idle_off_by_default(u32 mwait_hint) { return false; }
13021302
* Tune IVT multi-socket targets
13031303
* Assumption: num_sockets == (max_package_num + 1)
13041304
*/
1305-
static void ivt_idle_state_table_update(void)
1305+
static void __init ivt_idle_state_table_update(void)
13061306
{
13071307
/* IVT uses a different table for 1-2, 3-4, and > 4 sockets */
13081308
int cpu, package_num, num_sockets = 1;
@@ -1329,10 +1329,11 @@ static void ivt_idle_state_table_update(void)
13291329
* Translate IRTL (Interrupt Response Time Limit) MSR to usec
13301330
*/
13311331

1332-
static unsigned int irtl_ns_units[] = {
1333-
1, 32, 1024, 32768, 1048576, 33554432, 0, 0 };
1332+
static const unsigned int irtl_ns_units[] __initconst = {
1333+
1, 32, 1024, 32768, 1048576, 33554432, 0, 0
1334+
};
13341335

1335-
static unsigned long long irtl_2_usec(unsigned long long irtl)
1336+
static unsigned long long __init irtl_2_usec(unsigned long long irtl)
13361337
{
13371338
unsigned long long ns;
13381339

@@ -1349,7 +1350,7 @@ static unsigned long long irtl_2_usec(unsigned long long irtl)
13491350
* On BXT, we trust the IRTL to show the definitive maximum latency
13501351
* We use the same value for target_residency.
13511352
*/
1352-
static void bxt_idle_state_table_update(void)
1353+
static void __init bxt_idle_state_table_update(void)
13531354
{
13541355
unsigned long long msr;
13551356
unsigned int usec;
@@ -1396,7 +1397,7 @@ static void bxt_idle_state_table_update(void)
13961397
* On SKL-H (model 0x5e) disable C8 and C9 if:
13971398
* C10 is enabled and SGX disabled
13981399
*/
1399-
static void sklh_idle_state_table_update(void)
1400+
static void __init sklh_idle_state_table_update(void)
14001401
{
14011402
unsigned long long msr;
14021403
unsigned int eax, ebx, ecx, edx;
@@ -1433,7 +1434,7 @@ static void sklh_idle_state_table_update(void)
14331434
skl_cstates[6].flags |= CPUIDLE_FLAG_UNUSABLE; /* C9-SKL */
14341435
}
14351436

1436-
static void intel_idle_init_cstates_icpu(struct cpuidle_driver *drv)
1437+
static void __init intel_idle_init_cstates_icpu(struct cpuidle_driver *drv)
14371438
{
14381439
int cstate;
14391440

0 commit comments

Comments
 (0)