LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 1/4] introduce __cpuinitconst
@ 2008-01-11  8:56 Jan Beulich
  2008-01-11 21:00 ` Adrian Bunk
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2008-01-11  8:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: len.brown, Andi Kleen

The patch doesn't change all instances where 'const' could have been
added as a result of the base structure changes, only where the change
has a real effect (the module loader doesn't enforce read-only section
attributes at present, so only built-in files make a real difference).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Andi Kleen <ak@suse.de>

---
 drivers/acpi/processor_idle.c |    2 +-
 include/linux/init.h          |    2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

--- 2.6.24-rc7-initconst.orig/drivers/acpi/processor_idle.c
+++ 2.6.24-rc7-initconst/drivers/acpi/processor_idle.c
@@ -118,7 +118,7 @@ static int set_max_cstate(const struct d
 
 /* Actually this shouldn't be __cpuinitdata, would be better to fix the
    callers to only run once -AK */
-static struct dmi_system_id __cpuinitdata processor_power_dmi_table[] = {
+static struct dmi_system_id __cpuinitconst processor_power_dmi_table[] = {
 	{ set_max_cstate, "IBM ThinkPad R40e", {
 	  DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
 	  DMI_MATCH(DMI_BIOS_VERSION,"1SET70WW")}, (void *)1},
--- 2.6.24-rc7-initconst.orig/include/linux/init.h
+++ 2.6.24-rc7-initconst/include/linux/init.h
@@ -269,11 +269,13 @@ void __init parse_early_param(void);
 #ifdef CONFIG_HOTPLUG_CPU
 #define __cpuinit
 #define __cpuinitdata
+#define __cpuinitconst const
 #define __cpuexit
 #define __cpuexitdata
 #else
 #define __cpuinit	__init
 #define __cpuinitdata __initdata
+#define __cpuinitconst __initdata
 #define __cpuexit __exit
 #define __cpuexitdata	__exitdata
 #endif




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/4] introduce __cpuinitconst
  2008-01-11  8:56 [PATCH 1/4] introduce __cpuinitconst Jan Beulich
@ 2008-01-11 21:00 ` Adrian Bunk
  2008-01-14  8:12   ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Adrian Bunk @ 2008-01-11 21:00 UTC (permalink / raw)
  To: Jan Beulich; +Cc: linux-kernel, len.brown, Andi Kleen

On Fri, Jan 11, 2008 at 08:56:16AM +0000, Jan Beulich wrote:
> The patch doesn't change all instances where 'const' could have been
> added as a result of the base structure changes, only where the change
> has a real effect (the module loader doesn't enforce read-only section
> attributes at present, so only built-in files make a real difference).
> 
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
> Cc: Len Brown <len.brown@intel.com>
> Cc: Andi Kleen <ak@suse.de>
> 
> ---
>  drivers/acpi/processor_idle.c |    2 +-
>  include/linux/init.h          |    2 ++
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> --- 2.6.24-rc7-initconst.orig/drivers/acpi/processor_idle.c
> +++ 2.6.24-rc7-initconst/drivers/acpi/processor_idle.c
> @@ -118,7 +118,7 @@ static int set_max_cstate(const struct d
>  
>  /* Actually this shouldn't be __cpuinitdata, would be better to fix the
>     callers to only run once -AK */
> -static struct dmi_system_id __cpuinitdata processor_power_dmi_table[] = {
> +static struct dmi_system_id __cpuinitconst processor_power_dmi_table[] = {
>  	{ set_max_cstate, "IBM ThinkPad R40e", {
>  	  DMI_MATCH(DMI_BIOS_VENDOR,"IBM"),
>  	  DMI_MATCH(DMI_BIOS_VERSION,"1SET70WW")}, (void *)1},
> --- 2.6.24-rc7-initconst.orig/include/linux/init.h
> +++ 2.6.24-rc7-initconst/include/linux/init.h
> @@ -269,11 +269,13 @@ void __init parse_early_param(void);
>  #ifdef CONFIG_HOTPLUG_CPU
>  #define __cpuinit
>  #define __cpuinitdata
> +#define __cpuinitconst const
>  #define __cpuexit
>  #define __cpuexitdata
>  #else
>  #define __cpuinit	__init
>  #define __cpuinitdata __initdata
> +#define __cpuinitconst __initdata
>  #define __cpuexit __exit
>  #define __cpuexitdata	__exitdata
>  #endif

__cpuinitconstdata ?

I know it's a bit long, but it would be more logically when looking at 
the other ones.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/4] introduce __cpuinitconst
  2008-01-11 21:00 ` Adrian Bunk
@ 2008-01-14  8:12   ` Jan Beulich
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2008-01-14  8:12 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: len.brown, Andi Kleen, linux-kernel

>> --- 2.6.24-rc7-initconst.orig/include/linux/init.h
>> +++ 2.6.24-rc7-initconst/include/linux/init.h
>> @@ -269,11 +269,13 @@ void __init parse_early_param(void);
>>  #ifdef CONFIG_HOTPLUG_CPU
>>  #define __cpuinit
>>  #define __cpuinitdata
>> +#define __cpuinitconst const
>>  #define __cpuexit
>>  #define __cpuexitdata
>>  #else
>>  #define __cpuinit	__init
>>  #define __cpuinitdata __initdata
>> +#define __cpuinitconst __initdata
>>  #define __cpuexit __exit
>>  #define __cpuexitdata	__exitdata
>>  #endif
>
>__cpuinitconstdata ?
>
>I know it's a bit long, but it would be more logically when looking at 
>the other ones.

I considered it, but didn't use it because as you say it's a bit long and
additionally nothing but data can be 'const'.

Jan


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-01-14  8:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-11  8:56 [PATCH 1/4] introduce __cpuinitconst Jan Beulich
2008-01-11 21:00 ` Adrian Bunk
2008-01-14  8:12   ` Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).