cpuidle: remove useless array definition in cpuidle_structure
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Mon, 26 Mar 2012 12:51:27 +0000 (14:51 +0200)
committerLen Brown <len.brown@intel.com>
Fri, 30 Mar 2012 05:55:22 +0000 (01:55 -0400)
All the modules name are ro-data, it is never copied to the array.

eg.

static struct cpuidle_driver intel_idle_driver = {
        .name = "intel_idle",
        .owner = THIS_MODULE,
};

It safe to assign the pointer of this ro-data to a const char *.
By this way we save 12 bytes.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
Tested-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
Signed-off-by: Len Brown <len.brown@intel.com>
include/linux/cpuidle.h

index ca4e4983773f8d28f42b076b3d18d0399a4c7427..f7f1d9040da3f4183e44e60658f7108f3ac940be 100644 (file)
@@ -120,7 +120,7 @@ static inline int cpuidle_get_last_residency(struct cpuidle_device *dev)
  ****************************/
 
 struct cpuidle_driver {
-       char                    name[CPUIDLE_NAME_LEN];
+       const char              *name;
        struct module           *owner;
 
        unsigned int            power_specified:1;