Skip to contentSkip to conversation

drivers/cpuidle/: make code static

PATCH Applied [email protected] 2 participants 2 messages Mar 6, 2007 – Mar 7, 2007

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

PATCH 2/6 drivers/cpuidle/: make code static

From: Adrian Bunk <[email protected]>

This patch makes the following needlessly global code static:
- driver.c: __cpuidle_find_driver()
- governor.c: __cpuidle_find_governor()
- ladder.c: struct ladder_governor

Cc Len Brown <[email protected]>
Cc Venkatesh Pallipadi <[email protected]>
Cc Adam Belay <[email protected]>
Cc Shaohua Li <[email protected]>

---

 drivers/cpuidle/cpuidle.h          |    2 --
 drivers/cpuidle/driver.c           |    2 +-
 drivers/cpuidle/governor.c         |    2 +-
 drivers/cpuidle/governors/ladder.c |    2 +-
 4 files changed, 3 insertions(+), 5 deletions(-)
drivers/cpuidle/cpuidle.h renamed from drivers/cpuidle/cpuidle.h~drivers-cpuidle-make-code-static +0 -2
diff -puN drivers/cpuidle/cpuidle.h~drivers-cpuidle-make-code-static drivers/cpuidle/cpuidle.h
@@ -23,13 +23,11 @@ extern void cpuidle_rescan_device(struct
 /* drivers */
 extern int cpuidle_attach_driver(struct cpuidle_device *dev);
 extern void cpuidle_detach_driver(struct cpuidle_device *dev);
-extern struct cpuidle_driver * __cpuidle_find_driver(const char *str);
 extern int cpuidle_switch_driver(struct cpuidle_driver *drv);
 
 /* governors */
 extern int cpuidle_attach_governor(struct cpuidle_device *dev);
 extern void cpuidle_detach_governor(struct cpuidle_device *dev);
-extern struct cpuidle_governor * __cpuidle_find_governor(const char *str);
 extern int cpuidle_switch_governor(struct cpuidle_governor *gov);
 
 /* sysfs */
drivers/cpuidle/driver.c renamed from drivers/cpuidle/driver.c~drivers-cpuidle-make-code-static +1 -1
diff -puN drivers/cpuidle/driver.c~drivers-cpuidle-make-code-static drivers/cpuidle/driver.c
@@ -73,7 +73,7 @@ void cpuidle_detach_driver(struct cpuidl
  *
  * Must be called with cpuidle_lock aquired.
  */
-struct cpuidle_driver * __cpuidle_find_driver(const char *str)
+static struct cpuidle_driver * __cpuidle_find_driver(const char *str)
 {
 	struct cpuidle_driver *drv;
 
drivers/cpuidle/governor.c renamed from drivers/cpuidle/governor.c~drivers-cpuidle-make-code-static +1 -1
diff -puN drivers/cpuidle/governor.c~drivers-cpuidle-make-code-static drivers/cpuidle/governor.c
@@ -72,7 +72,7 @@ void cpuidle_detach_governor(struct cpui
  *
  * Must be called with cpuidle_lock aquired.
  */
-struct cpuidle_governor * __cpuidle_find_governor(const char *str)
+static struct cpuidle_governor * __cpuidle_find_governor(const char *str)
 {
 	struct cpuidle_governor *gov;
 
drivers/cpuidle/governors/ladder.c renamed from drivers/cpuidle/governors/ladder.c~drivers-cpuidle-make-code-static +1 -1
diff -puN drivers/cpuidle/governors/ladder.c~drivers-cpuidle-make-code-static drivers/cpuidle/governors/ladder.c
@@ -199,7 +199,7 @@ static void ladder_exit_device(struct cp
 	kfree(dev->governor_data);
 }
 
-struct cpuidle_governor ladder_governor = {
+static struct cpuidle_governor ladder_governor = {
 	.name =		"ladder",
 	.init =		ladder_init_device,
 	.exit =		ladder_exit_device,

_

reviewer Applied
#1 lore raw

Applied.

thanks,
-Len

Quoted 76 lines · On Tuesday 06 March 2007 05:29, [email protected] wrote:

From: Adrian Bunk <[email protected]>

This patch makes the following needlessly global code static:
- driver.c: __cpuidle_find_driver()
- governor.c: __cpuidle_find_governor()
- ladder.c: struct ladder_governor

Cc Len Brown <[email protected]>
Cc Venkatesh Pallipadi <[email protected]>
Cc Adam Belay <[email protected]>
Cc Shaohua Li <[email protected]>

---

 drivers/cpuidle/cpuidle.h          |    2 --
 drivers/cpuidle/driver.c           |    2 +-
 drivers/cpuidle/governor.c         |    2 +-
 drivers/cpuidle/governors/ladder.c |    2 +-
 4 files changed, 3 insertions(+), 5 deletions(-)

diff -puN drivers/cpuidle/cpuidle.h~drivers-cpuidle-make-code-static drivers/cpuidle/cpuidle.h

drivers/cpuidle/cpuidle.h renamed from drivers/cpuidle/cpuidle.h~drivers-cpuidle-make-code-static +0 -2
@@ -23,13 +23,11 @@ extern void cpuidle_rescan_device(struct
 /* drivers */
 extern int cpuidle_attach_driver(struct cpuidle_device *dev);
 extern void cpuidle_detach_driver(struct cpuidle_device *dev);
-extern struct cpuidle_driver * __cpuidle_find_driver(const char *str);
 extern int cpuidle_switch_driver(struct cpuidle_driver *drv);
 
 /* governors */
 extern int cpuidle_attach_governor(struct cpuidle_device *dev);
 extern void cpuidle_detach_governor(struct cpuidle_device *dev);
-extern struct cpuidle_governor * __cpuidle_find_governor(const char *str);
 extern int cpuidle_switch_governor(struct cpuidle_governor *gov);
 
 /* sysfs */

diff -puN drivers/cpuidle/driver.c~drivers-cpuidle-make-code-static drivers/cpuidle/driver.c

drivers/cpuidle/driver.c renamed from drivers/cpuidle/driver.c~drivers-cpuidle-make-code-static +1 -1
@@ -73,7 +73,7 @@ void cpuidle_detach_driver(struct cpuidl
  *
  * Must be called with cpuidle_lock aquired.
  */
-struct cpuidle_driver * __cpuidle_find_driver(const char *str)
+static struct cpuidle_driver * __cpuidle_find_driver(const char *str)
 {
 	struct cpuidle_driver *drv;
 

diff -puN drivers/cpuidle/governor.c~drivers-cpuidle-make-code-static drivers/cpuidle/governor.c

drivers/cpuidle/governor.c renamed from drivers/cpuidle/governor.c~drivers-cpuidle-make-code-static +1 -1
@@ -72,7 +72,7 @@ void cpuidle_detach_governor(struct cpui
  *
  * Must be called with cpuidle_lock aquired.
  */
-struct cpuidle_governor * __cpuidle_find_governor(const char *str)
+static struct cpuidle_governor * __cpuidle_find_governor(const char *str)
 {
 	struct cpuidle_governor *gov;
 

diff -puN drivers/cpuidle/governors/ladder.c~drivers-cpuidle-make-code-static drivers/cpuidle/governors/ladder.c

drivers/cpuidle/governors/ladder.c renamed from drivers/cpuidle/governors/ladder.c~drivers-cpuidle-make-code-static +1 -1
@@ -199,7 +199,7 @@ static void ladder_exit_device(struct cp
 	kfree(dev->governor_data);
 }
 
-struct cpuidle_governor ladder_governor = {
+static struct cpuidle_governor ladder_governor = {
 	.name =		"ladder",
 	.init =		ladder_init_device,
 	.exit =		ladder_exit_device,

_