Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp550442ybl; Fri, 10 Jan 2020 03:00:03 -0800 (PST) X-Google-Smtp-Source: APXvYqztawD3zKlg5oaVPnQpZW6OaXOqfL5fEfz6fCFZfZAeTerODodwXMEQX77cWzQ0ASZGvH// X-Received: by 2002:a9d:588d:: with SMTP id x13mr1964930otg.6.1578654003697; Fri, 10 Jan 2020 03:00:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578654003; cv=none; d=google.com; s=arc-20160816; b=N6lVU6iJZqcapf+0rUOtb9CecW2aQBX+0ZPoCsvAZuPIsKMmFlir5Y92YanPRhh7FY hRLLs95emWDshxreyzlmrMzdV96bLBWwqPtMzs19z5pK4D07sUPMkytOKpFkZsHE//7h ZcfdHPjD7nKKAZZC8+Nw/0muU2oTv2prCDEZo/JALYalHkPfeagdhDZgv1QG8q2SX2eY H0yIaA7Fy7OH5lz0ez3iG5QzXpFKymr3UryqsgkLUAWGzo0SoWxPTslPjNEfoJKa/tZj 6wS3//EkI8B+5JfJwQWwV6jS4/kbIrwWtFH0AnWsZQeXYOv7+oMO+dsocDXMsPdqfl83 ALIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=HfMz9bNRFvvWk1tgEk59Z50Q/W6O/1HM4Vp9o7bim3Q=; b=t7+MpeEFl/WH0676smsA6UemffIQuP3UP4IKHRVPShsZfNK40w8dtxxpviu4fTGn/c dCLc2nsBcO7Gxta88hFI7pi0U+MA+ICDoqtcSr1OhUY+9ERbGL6X3RI1BiztUBM/WLSf gvdjHzWFc1CNJBaGHchCumsb1S6cUiTA1N1humqtUoytjo1lUyMZrF0VVpg2ELFnIea9 4cTX5MaaZON7Von8bX6UBdgjTI3ptd5Fy3h3V+m1R1HGCG40i13MmSYYrYyE2Sl0Ga09 C69AixkihwFSff0D+zIxyPR8j0gnauv3HSUcttx5FhZBUYtsiYn7bm7X5NOeLhi/FxE7 rbHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l131si830510oig.120.2020.01.10.02.59.52; Fri, 10 Jan 2020 03:00:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727717AbgAJK57 (ORCPT + 99 others); Fri, 10 Jan 2020 05:57:59 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:52467 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727659AbgAJK54 (ORCPT ); Fri, 10 Jan 2020 05:57:56 -0500 Received: from 79.184.255.90.ipv4.supernova.orange.pl (79.184.255.90) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.320) id 9409162859ea356d; Fri, 10 Jan 2020 11:57:54 +0100 From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Len Brown , Zhang Rui Subject: [PATCH 6/8] intel_idle: Annotate initialization code and data structures Date: Fri, 10 Jan 2020 11:51:22 +0100 Message-ID: <9485725.GhrZopcvGO@kreacher> In-Reply-To: <14127826.m9lEolTOYu@kreacher> References: <14127826.m9lEolTOYu@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki 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 --- drivers/idle/intel_idle.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) Index: linux-pm/drivers/idle/intel_idle.c =================================================================== --- linux-pm.orig/drivers/idle/intel_idle.c +++ linux-pm/drivers/idle/intel_idle.c @@ -1148,7 +1148,7 @@ static const struct x86_cpu_id intel_mwa {} }; -static bool intel_idle_max_cstate_reached(int cstate) +static bool __init intel_idle_max_cstate_reached(int cstate) { if (cstate + 1 > max_cstate) { pr_info("max_cstate %d reached\n", max_cstate); @@ -1164,7 +1164,7 @@ static bool no_acpi __read_mostly; module_param(no_acpi, bool, 0444); MODULE_PARM_DESC(no_acpi, "Do not use ACPI _CST for building the idle states list"); -static struct acpi_processor_power acpi_state_table; +static struct acpi_processor_power acpi_state_table __initdata; /** * intel_idle_cst_usable - Check if the _CST information can be used. @@ -1172,7 +1172,7 @@ static struct acpi_processor_power acpi_ * Check if all of the C-states listed by _CST in the max_cstate range are * ACPI_CSTATE_FFH, which means that they should be entered via MWAIT. */ -static bool intel_idle_cst_usable(void) +static bool __init intel_idle_cst_usable(void) { int cstate, limit; @@ -1189,7 +1189,7 @@ static bool intel_idle_cst_usable(void) return true; } -static bool intel_idle_acpi_cst_extract(void) +static bool __init intel_idle_acpi_cst_extract(void) { unsigned int cpu; @@ -1224,7 +1224,7 @@ static bool intel_idle_acpi_cst_extract( return false; } -static void intel_idle_init_cstates_acpi(struct cpuidle_driver *drv) +static void __init intel_idle_init_cstates_acpi(struct cpuidle_driver *drv) { int cstate, limit = min_t(int, CPUIDLE_STATE_MAX, acpi_state_table.count); @@ -1268,7 +1268,7 @@ static void intel_idle_init_cstates_acpi } } -static bool intel_idle_off_by_default(u32 mwait_hint) +static bool __init intel_idle_off_by_default(u32 mwait_hint) { int cstate, limit; @@ -1302,7 +1302,7 @@ static inline bool intel_idle_off_by_def * Tune IVT multi-socket targets * Assumption: num_sockets == (max_package_num + 1) */ -static void ivt_idle_state_table_update(void) +static void __init ivt_idle_state_table_update(void) { /* IVT uses a different table for 1-2, 3-4, and > 4 sockets */ int cpu, package_num, num_sockets = 1; @@ -1329,10 +1329,11 @@ static void ivt_idle_state_table_update( * Translate IRTL (Interrupt Response Time Limit) MSR to usec */ -static unsigned int irtl_ns_units[] = { - 1, 32, 1024, 32768, 1048576, 33554432, 0, 0 }; +static const unsigned int irtl_ns_units[] __initconst = { + 1, 32, 1024, 32768, 1048576, 33554432, 0, 0 +}; -static unsigned long long irtl_2_usec(unsigned long long irtl) +static unsigned long long __init irtl_2_usec(unsigned long long irtl) { unsigned long long ns; @@ -1349,7 +1350,7 @@ static unsigned long long irtl_2_usec(un * On BXT, we trust the IRTL to show the definitive maximum latency * We use the same value for target_residency. */ -static void bxt_idle_state_table_update(void) +static void __init bxt_idle_state_table_update(void) { unsigned long long msr; unsigned int usec; @@ -1396,7 +1397,7 @@ static void bxt_idle_state_table_update( * On SKL-H (model 0x5e) disable C8 and C9 if: * C10 is enabled and SGX disabled */ -static void sklh_idle_state_table_update(void) +static void __init sklh_idle_state_table_update(void) { unsigned long long msr; unsigned int eax, ebx, ecx, edx; @@ -1433,7 +1434,7 @@ static void sklh_idle_state_table_update skl_cstates[6].flags |= CPUIDLE_FLAG_UNUSABLE; /* C9-SKL */ } -static void intel_idle_init_cstates_icpu(struct cpuidle_driver *drv) +static void __init intel_idle_init_cstates_icpu(struct cpuidle_driver *drv) { int cstate;