Skip to contentSkip to conversation

cpufreq: intel_pstate: Make intel_pstate_kobject local

PATCH NAK Stratos Karafotis 3 participants 4 messages Jun 9, 2014 – Jun 10, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 7/7 cpufreq: intel_pstate: Make intel_pstate_kobject local

Since we never remove sysfs entry, we can make the intel_pstate_kobject local.

---
 drivers/cpufreq/intel_pstate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/intel_pstate.c +1 -1
index fa44f0f..9533fff 100644
@@ -387,10 +387,10 @@ static struct attribute *intel_pstate_attributes[] = {
 static struct attribute_group intel_pstate_attr_group = {
 	.attrs = intel_pstate_attributes,
 };
-static struct kobject *intel_pstate_kobject;
 
 static void intel_pstate_sysfs_expose_params(void)
 {
+	struct kobject *intel_pstate_kobject;
 	int rc;
 
 	intel_pstate_kobject = kobject_create_and_add("intel_pstate",
Signature · 1 line
1.9.3
#1 lore raw
Quoted 3 lines · Stratos Karafotis

Since we never remove sysfs entry, we can make the intel_pstate_kobject local.

For even more savings, this function and intel_pstate_debug_expose_params() can be annotated with __init and freed after bootstrap.

Quoted 21 lines
---
 drivers/cpufreq/intel_pstate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/intel_pstate.c +1 -1
index fa44f0f..9533fff 100644
@@ -387,10 +387,10 @@ static struct attribute *intel_pstate_attributes[] = {
 static struct attribute_group intel_pstate_attr_group = {
 	.attrs = intel_pstate_attributes,
 };
-static struct kobject *intel_pstate_kobject;
 
 static void intel_pstate_sysfs_expose_params(void)
 {
+	struct kobject *intel_pstate_kobject;
 	int rc;
 
 	intel_pstate_kobject = kobject_create_and_add("intel_pstate",
#2 lore raw
Quoted 9 lines · David Rientjes
Quoted 3 lines · Stratos Karafotis

Since we never remove sysfs entry, we can make the intel_pstate_kobject local.

For even more savings, this function and intel_pstate_debug_expose_params() can be annotated with __init and freed after bootstrap.

Thanks for your comment, David!
I will do this in v2.

Stratos

Acked-by on v1 7/7
#3 lore raw
In reply to Stratos Karafotis
Quoted 4 lines · Stratos Karafotis

Since we never remove sysfs entry, we can make the intel_pstate_kobject local.

Quoted 20 lines
  drivers/cpufreq/intel_pstate.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/intel_pstate.c +1 -1
index fa44f0f..9533fff 100644
@@ -387,10 +387,10 @@ static struct attribute *intel_pstate_attributes[] = {
  static struct attribute_group intel_pstate_attr_group = {
  	.attrs = intel_pstate_attributes,
  };
-static struct kobject *intel_pstate_kobject;
 
  static void intel_pstate_sysfs_expose_params(void)
  {
+	struct kobject *intel_pstate_kobject;
  	int rc;
 
  	intel_pstate_kobject = kobject_create_and_add("intel_pstate",