Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
Subsystems (18)
PATCH 1/1 Constify struct pci_raw_ops for 2.6.32-git-053fe57ac v2
In reply to [email protected]From: Emese Revfy <[email protected]>
--- arch/x86/include/asm/pci_x86.h | 10 +++++----- arch/x86/pci/common.c | 4 ++-- arch/x86/pci/direct.c | 6 +++--- arch/x86/pci/mmconfig_32.c | 2 +- arch/x86/pci/mmconfig_64.c | 2 +- arch/x86/pci/numaq_32.c | 2 +- arch/x86/pci/olpc.c | 2 +- arch/x86/pci/pcbios.c | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-)
arch/x86/include/asm/pci_x86.h +5 -5
@@ -89,16 +89,16 @@ extern int (*pcibios_enable_irq)(struct pci_dev *dev);extern void (*pcibios_disable_irq)(struct pci_dev *dev);struct pci_raw_ops { -int (*read)(unsigned int domain,unsigned int bus,unsigned int devfn, +int (*const read)(unsigned int domain,unsigned int bus,unsigned int devfn,int reg,int len,u32 *val); -int (*write)(unsigned int domain,unsigned int bus,unsigned int devfn, +int (*const write)(unsigned int domain,unsigned int bus,unsigned int devfn,int reg,int len,u32 val); }; -extern struct pci_raw_ops *raw_pci_ops; -extern struct pci_raw_ops *raw_pci_ext_ops; +extern const struct pci_raw_ops *raw_pci_ops; +extern const struct pci_raw_ops *raw_pci_ext_ops; -extern struct pci_raw_ops pci_direct_conf1; +extern const struct pci_raw_ops pci_direct_conf1;extern bool port_cf9_safe;/* arch_initcall level */
arch/x86/pci/common.c +2 -2
@@ -31,8 +31,8 @@ int noioapicreroute = 1;int pcibios_last_bus =-1 ;unsigned long pirq_table_addr;struct pci_bus *pci_root_bus; -struct pci_raw_ops *raw_pci_ops; -struct pci_raw_ops *raw_pci_ext_ops; +const struct pci_raw_ops *raw_pci_ops; +const struct pci_raw_ops *raw_pci_ext_ops;int raw_pci_read (unsigned int domain,unsigned int bus,unsigned int devfn,int reg,int len,u32 *val)
arch/x86/pci/direct.c +3 -3
@@ -79,7 +79,7 @@ static int pci_conf1_write(unsigned int seg, unsigned int bus,#undef PCI_CONF1_ADDRESS -struct pci_raw_ops pci_direct_conf1 = { +const struct pci_raw_ops pci_direct_conf1 = { .read = pci_conf1_read, .write = pci_conf1_write, };
@@ -173,7 +173,7 @@ static int pci_conf2_write(unsigned int seg, unsigned int bus,#undef PCI_CONF2_ADDRESS -struct pci_raw_ops pci_direct_conf2 = { +const struct pci_raw_ops pci_direct_conf2 = { .read = pci_conf2_read, .write = pci_conf2_write, };
@@ -189,7 +189,7 @@ struct pci_raw_ops pci_direct_conf2 = {* This should be close to trivial, but it isn't, because there are buggy * chipsets (yes, you guessed it, by Intel and Compaq) that have no class ID. */ -static int __init pci_sanity_check (struct pci_raw_ops *o) +static int __init pci_sanity_check (const struct pci_raw_ops *o) {u32 x =0 ;int year, devfn;
arch/x86/pci/mmconfig_32.c +1 -1
@@ -117,7 +117,7 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus,return 0 ; } -static struct pci_raw_ops pci_mmcfg = { +static const struct pci_raw_ops pci_mmcfg = { .read = pci_mmcfg_read, .write = pci_mmcfg_write, };
arch/x86/pci/mmconfig_64.c +1 -1
@@ -81,7 +81,7 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus,return 0 ; } -static struct pci_raw_ops pci_mmcfg = { +static const struct pci_raw_ops pci_mmcfg = { .read = pci_mmcfg_read, .write = pci_mmcfg_write, };
arch/x86/pci/numaq_32.c +1 -1
@@ -112,7 +112,7 @@ static int pci_conf1_mq_write(unsigned int seg, unsigned int bus,#undef PCI_CONF1_MQ_ADDRESS -static struct pci_raw_ops pci_direct_conf1_mq = { +static const struct pci_raw_ops pci_direct_conf1_mq = { .read = pci_conf1_mq_read, .write = pci_conf1_mq_write };
arch/x86/pci/olpc.c +1 -1
@@ -297,7 +297,7 @@ static int pci_olpc_write(unsigned int seg, unsigned int bus,return 0 ; } -static struct pci_raw_ops pci_olpc_conf = { +static const struct pci_raw_ops pci_olpc_conf = { .read = pci_olpc_read, .write = pci_olpc_write, };
arch/x86/pci/pcbios.c +2 -2
@@ -278,7 +278,7 @@ static int pci_bios_write(unsigned int seg, unsigned int bus,* Function table for BIOS32 access */ -static struct pci_raw_ops pci_bios_access = { +static const struct pci_raw_ops pci_bios_access = { .read = pci_bios_read, .write = pci_bios_write };
@@ -287,7 +287,7 @@ static struct pci_raw_ops pci_bios_access = {* Try to find PCI BIOS. */ -static struct pci_raw_ops *__devinit pci_find_bios (void ) +static const struct pci_raw_ops *__devinit pci_find_bios (void ) {union bios32 *check;unsigned char sum;
Signature · 1 line
1.6.5.3
PATCH 7/10 Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
In reply to [email protected]From: Emese Revfy <[email protected]>
--- arch/sh/boards/mach-hp6xx/pm.c | 2 +- arch/sh/kernel/cpu/shmobile/pm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/sh/boards/mach-hp6xx/pm.c +1 -1
@@ -143,7 +143,7 @@ static int hp6x0_pm_enter(suspend_state_t state)return 0 ; } -static struct platform_suspend_ops hp6x0_pm_ops = { +static const struct platform_suspend_ops hp6x0_pm_ops = { .enter = hp6x0_pm_enter, .valid = suspend_valid_only_mem, };
arch/sh/kernel/cpu/shmobile/pm.c +1 -1
@@ -140,7 +140,7 @@ static int sh_pm_enter(suspend_state_t state)return 0 ; } -static struct platform_suspend_ops sh_pm_ops = { +static const struct platform_suspend_ops sh_pm_ops = { .enter = sh_pm_enter, .valid = suspend_valid_only_mem, };
Signature · 1 line
1.6.5.3
PATCH 10/10 Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
In reply to [email protected]From: Emese Revfy <[email protected]>
--- arch/powerpc/platforms/52xx/lite5200_pm.c | 2 +- arch/powerpc/platforms/52xx/mpc52xx_pm.c | 2 +- arch/powerpc/platforms/83xx/suspend.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/platforms/52xx/lite5200_pm.c +1 -1
@@ -235,7 +235,7 @@ static void lite5200_pm_end(void) lite5200_pm_target_state =PM_SUSPEND_ON ; } -static struct platform_suspend_ops lite5200_pm_ops = { +static const struct platform_suspend_ops lite5200_pm_ops = { .valid = lite5200_pm_valid, .begin = lite5200_pm_begin, .prepare = lite5200_pm_prepare,
arch/powerpc/platforms/52xx/mpc52xx_pm.c +1 -1
@@ -180,7 +180,7 @@ void mpc52xx_pm_finish(void)iounmap (mbar); } -static struct platform_suspend_ops mpc52xx_pm_ops = { +static const struct platform_suspend_ops mpc52xx_pm_ops = { .valid = mpc52xx_pm_valid, .prepare = mpc52xx_pm_prepare, .enter = mpc52xx_pm_enter,
arch/powerpc/platforms/83xx/suspend.c +1 -1
@@ -273,7 +273,7 @@ static int mpc83xx_is_pci_agent(void)return ret; } -static struct platform_suspend_ops mpc83xx_suspend_ops = { +static const struct platform_suspend_ops mpc83xx_suspend_ops = { .valid = mpc83xx_suspend_valid, .begin = mpc83xx_suspend_begin, .enter = mpc83xx_suspend_enter,
Signature · 1 line
1.6.5.3
PATCH 9/10 Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
In reply to [email protected]From: Emese Revfy <[email protected]>
--- drivers/macintosh/via-pmu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/macintosh/via-pmu.c +1 -1
@@ -2232,7 +2232,7 @@ static int pmu_sleep_valid(suspend_state_t state) && (pmac_call_feature (PMAC_FTR_SLEEP_STATE ,NULL ,0 ,-1 ) >=0 ); } -static struct platform_suspend_ops pmu_pm_ops = { +static const struct platform_suspend_ops pmu_pm_ops = { .enter = powerbook_sleep, .valid = pmu_sleep_valid, };
Signature · 1 line
1.6.5.3
PATCH 5/10 Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
In reply to [email protected]From: Emese Revfy <[email protected]>
--- include/linux/suspend.h | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-)
include/linux/suspend.h +11 -11
@@ -104,15 +104,15 @@ typedef int __bitwise suspend_state_t;* which require special recovery actions in that situation. */ struct platform_suspend_ops { -int (*valid)(suspend_state_t state); -int (*begin)(suspend_state_t state); -int (*prepare)(void ); -int (*prepare_late)(void ); -int (*enter)(suspend_state_t state); -void (*wake)(void ); -void (*finish)(void ); -void (*end)(void ); -void (*recover)(void ); +int (*const valid)(suspend_state_t state); +int (*const begin)(suspend_state_t state); +int (*const prepare)(void ); +int (*const prepare_late)(void ); +int (*const enter)(suspend_state_t state); +void (*const wake)(void ); +void (*const finish)(void ); +void (*const end)(void ); +void (*const recover)(void ); };#ifdef CONFIG_SUSPEND
@@ -120,7 +120,7 @@ struct platform_suspend_ops {* suspend_set_ops - set platform dependent suspend operations * @ops: The new suspend operations to set. */ -extern void suspend_set_ops (struct platform_suspend_ops *ops); +extern void suspend_set_ops (const struct platform_suspend_ops *ops);extern int suspend_valid_only_mem (suspend_state_t state);/**
@@ -145,7 +145,7 @@ extern int pm_suspend(suspend_state_t state);#else /* !CONFIG_SUSPEND */ #define suspend_valid_only_mem NULL -static inline void suspend_set_ops (struct platform_suspend_ops *ops) {} +static inline void suspend_set_ops (const struct platform_suspend_ops *ops) {}static inline int pm_suspend (suspend_state_t state) {return -ENOSYS ; }#endif /* !CONFIG_SUSPEND */
Signature · 1 line
1.6.5.3
PATCH 6/10 Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
In reply to [email protected]From: Emese Revfy <[email protected]>
--- arch/mips/alchemy/devboards/pm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/mips/alchemy/devboards/pm.c +1 -1
@@ -78,7 +78,7 @@ static void db1x_pm_end(void) } -static struct platform_suspend_ops db1x_pm_ops = { +static const struct platform_suspend_ops db1x_pm_ops = { .valid = suspend_valid_only_mem, .begin = db1x_pm_begin, .enter = db1x_pm_enter,
Signature · 1 line
1.6.5.3
PATCH 2/10 Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
In reply to [email protected]From: Emese Revfy <[email protected]>
--- arch/arm/mach-at91/pm.c | 2 +- arch/arm/mach-omap1/pm.c | 2 +- arch/arm/mach-omap2/pm24xx.c | 2 +- arch/arm/mach-omap2/pm34xx.c | 2 +- arch/arm/mach-pnx4008/pm.c | 2 +- arch/arm/mach-pxa/pm.c | 2 +- arch/arm/mach-pxa/sharpsl_pm.c | 2 +- arch/arm/mach-sa1100/pm.c | 2 +- arch/arm/plat-s3c/pm.c | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-)
arch/arm/mach-at91/pm.c +1 -1
@@ -294,7 +294,7 @@ static void at91_pm_end(void) } -static struct platform_suspend_ops at91_pm_ops ={ +static const struct platform_suspend_ops at91_pm_ops ={ .valid = at91_pm_valid_state, .begin = at91_pm_begin, .enter = at91_pm_enter,
arch/arm/mach-omap1/pm.c +1 -1
@@ -647,7 +647,7 @@ static struct irqaction omap_wakeup_irq = { -static struct platform_suspend_ops omap_pm_ops ={ +static const struct platform_suspend_ops omap_pm_ops ={ .prepare = omap_pm_prepare, .enter = omap_pm_enter, .finish = omap_pm_finish,
arch/arm/mach-omap2/pm24xx.c +1 -1
@@ -326,7 +326,7 @@ static void omap2_pm_finish(void)enable_hlt (); } -static struct platform_suspend_ops omap_pm_ops = { +static const struct platform_suspend_ops omap_pm_ops = { .prepare = omap2_pm_prepare, .enter = omap2_pm_enter, .finish = omap2_pm_finish,
arch/arm/mach-omap2/pm34xx.c +1 -1
@@ -637,7 +637,7 @@ static void omap3_pm_end(void)return ; } -static struct platform_suspend_ops omap_pm_ops = { +static const struct platform_suspend_ops omap_pm_ops = { .begin = omap3_pm_begin, .end = omap3_pm_end, .prepare = omap3_pm_prepare,
arch/arm/mach-pnx4008/pm.c +1 -1
@@ -116,7 +116,7 @@ static int pnx4008_pm_valid(suspend_state_t state) (state ==PM_SUSPEND_MEM ); } -static struct platform_suspend_ops pnx4008_pm_ops = { +static const struct platform_suspend_ops pnx4008_pm_ops = { .enter = pnx4008_pm_enter, .valid = pnx4008_pm_valid, };
arch/arm/mach-pxa/pm.c +1 -1
@@ -95,7 +95,7 @@ void pxa_pm_finish(void) pxa_cpu_pm_fns->finish (); } -static struct platform_suspend_ops pxa_pm_ops = { +static const struct platform_suspend_ops pxa_pm_ops = { .valid = pxa_pm_valid, .enter = pxa_pm_enter, .prepare = pxa_pm_prepare,
arch/arm/mach-pxa/sharpsl_pm.c +1 -1
@@ -892,7 +892,7 @@ static void sharpsl_apm_get_power_status(struct apm_power_info *info) }#ifdef CONFIG_PM -static struct platform_suspend_ops sharpsl_pm_ops = { +static const struct platform_suspend_ops sharpsl_pm_ops = { .prepare = pxa_pm_prepare, .finish = pxa_pm_finish, .enter = corgi_pxa_pm_enter,
arch/arm/mach-sa1100/pm.c +1 -1
@@ -120,7 +120,7 @@ unsigned long sleep_phys_sp(void *sp)return virt_to_phys (sp); } -static struct platform_suspend_ops sa11x0_pm_ops = { +static const struct platform_suspend_ops sa11x0_pm_ops = { .enter = sa11x0_pm_enter, .valid = suspend_valid_only_mem, };
arch/arm/plat-s3c/pm.c +1 -1
@@ -355,7 +355,7 @@ static void s3c_pm_finish(void)s3c_pm_check_cleanup (); } -static struct platform_suspend_ops s3c_pm_ops = { +static const struct platform_suspend_ops s3c_pm_ops = { .enter = s3c_pm_enter, .prepare = s3c_pm_prepare, .finish = s3c_pm_finish,
Signature · 1 line
1.6.5.3
PATCH 3/3 Constify struct platform_hibernation_ops for 2.6.32-git-053fe57ac v2
In reply to [email protected]From: Emese Revfy <[email protected]>
--- kernel/power/hibernate.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/power/hibernate.c +2 -2
@@ -49,14 +49,14 @@ enum {static int hibernation_mode =HIBERNATION_SHUTDOWN ; -static struct platform_hibernation_ops *hibernation_ops; +static const struct platform_hibernation_ops *hibernation_ops;/** * hibernation_set_ops - set the global hibernate operations * @ops: the hibernation operations to use in subsequent hibernation transitions */ -void hibernation_set_ops (struct platform_hibernation_ops *ops) +void hibernation_set_ops (const struct platform_hibernation_ops *ops) { if (ops && !(ops->begin && ops->end && ops->pre_snapshot && ops->prepare && ops->finish && ops->enter && ops->pre_restore
Signature · 1 line
1.6.5.3
PATCH 2/3 Constify struct platform_hibernation_ops for 2.6.32-git-053fe57ac v2
In reply to [email protected]From: Emese Revfy <[email protected]>
--- include/linux/suspend.h | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-)
include/linux/suspend.h +12 -12
@@ -215,16 +215,16 @@ extern void mark_free_pages(struct zone *zone);* platforms which require special recovery actions in that situation. */ struct platform_hibernation_ops { -int (*begin)(void ); -void (*end)(void ); -int (*pre_snapshot)(void ); -void (*finish)(void ); -int (*prepare)(void ); -int (*enter)(void ); -void (*leave)(void ); -int (*pre_restore)(void ); -void (*restore_cleanup)(void ); -void (*recover)(void ); +int (*const begin)(void ); +void (*const end)(void ); +int (*const pre_snapshot)(void ); +void (*const finish)(void ); +int (*const prepare)(void ); +int (*const enter)(void ); +void (*const leave)(void ); +int (*const pre_restore)(void ); +void (*const restore_cleanup)(void ); +void (*const recover)(void ); };#ifdef CONFIG_HIBERNATION
@@ -243,7 +243,7 @@ extern void swsusp_set_page_free(struct page *);extern void swsusp_unset_page_free (struct page *);extern unsigned long get_safe_page (gfp_t gfp_mask); -extern void hibernation_set_ops (struct platform_hibernation_ops *ops); +extern void hibernation_set_ops (const struct platform_hibernation_ops *ops);extern int hibernate (void );extern bool system_entering_hibernation (void );#else /* CONFIG_HIBERNATION */
@@ -251,7 +251,7 @@ static inline int swsusp_page_is_forbidden(struct page *p) { return 0; }static inline void swsusp_set_page_free (struct page *p) {}static inline void swsusp_unset_page_free (struct page *p) {} -static inline void hibernation_set_ops (struct platform_hibernation_ops *ops) {} +static inline void hibernation_set_ops (const struct platform_hibernation_ops *ops) {}static inline int hibernate (void ) {return -ENOSYS ; }static inline bool system_entering_hibernation (void ) {return false; }#endif /* CONFIG_HIBERNATION */
Signature · 1 line
1.6.5.3
PATCH 4/10 Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
In reply to [email protected]From: Emese Revfy <[email protected]>
--- arch/blackfin/mach-common/pm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/blackfin/mach-common/pm.c +1 -1
@@ -255,7 +255,7 @@ static int bfin_pm_enter(suspend_state_t state)return 0 ; } -struct platform_suspend_ops bfin_pm_ops = { +const struct platform_suspend_ops bfin_pm_ops = { .enter = bfin_pm_enter, .valid = bfin_pm_valid, };
Signature · 1 line
1.6.5.3
PATCH 8/10 Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
In reply to [email protected]From: Emese Revfy <[email protected]>
--- kernel/power/suspend.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/power/suspend.c +2 -2
@@ -23,13 +23,13 @@ const char *const pm_states[PM_SUSPEND_MAX] = { [PM_SUSPEND_MEM] = "mem", }; -static struct platform_suspend_ops *suspend_ops; +static const struct platform_suspend_ops *suspend_ops;/** * suspend_set_ops - Set the global suspend method table. * @ops: Pointer to ops structure. */ -void suspend_set_ops (struct platform_suspend_ops *ops) +void suspend_set_ops (const struct platform_suspend_ops *ops) {mutex_lock (&pm_mutex); suspend_ops = ops;
Signature · 1 line
1.6.5.3
cover Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
From: Emese Revfy <[email protected]>
Hello everyone!
The following patch series attempts to constify several structures that hold function pointers. This is only the initial batch, there are about over 150 candidate structures, some of which can be constified as well, I plan to submit them in the future.
The list of constified structures in this series (* marks this thread):acpi_dock_opsaddress_space_operationsbacklight_opsblock_device_operationsdma_map_opsextent_io_opsfile_lock_operationsfile_operationshv_opsintel_dvo_dev_opsitem_operationsiwl_opskgdb_archkgdb_iokset_uevent_opslock_manager_operationsmicrocode_opsmtrr_opsneigh_opsnlmsvc_bindingpci_raw_opsplatform_hibernation_ops
* platform_suspend_opssnd_ac97_build_opssysfs_opsusb_mon_operationswd_ops
There are certain exceptions where a given instance of the structure cannot be const, they are marked with a comment in the patch.
The patches compile fine with an allyesconfig kernel on i386 and x86_64.
Please let me know if any of these structures should not be constified and any other issues you see with them.
Changelog:
----------
v1 -> v2
- updated to linus-git-053fe57
- extended comments with a reference to code that prevents constification
- split up patches by subsystem as suggested by Greg KH, Jiri Slaby
- added all Acked-by's received so far
- removed patch for super_operations for now
- removed patch for ptmx_fops
Thanks,
Emese
arch/arm/mach-at91/pm.c | 2 +- arch/arm/mach-omap1/pm.c | 2 +- arch/arm/mach-omap2/pm24xx.c | 2 +- arch/arm/mach-omap2/pm34xx.c | 2 +- arch/arm/mach-pnx4008/pm.c | 2 +- arch/arm/mach-pxa/pm.c | 2 +- arch/arm/mach-pxa/sharpsl_pm.c | 2 +- arch/arm/mach-sa1100/pm.c | 2 +- arch/arm/plat-s3c/pm.c | 2 +- arch/avr32/mach-at32ap/pm.c | 2 +- arch/blackfin/mach-common/pm.c | 2 +- arch/mips/alchemy/devboards/pm.c | 2 +- arch/powerpc/platforms/52xx/lite5200_pm.c | 2 +- arch/powerpc/platforms/52xx/mpc52xx_pm.c | 2 +- arch/powerpc/platforms/83xx/suspend.c | 2 +- arch/sh/boards/mach-hp6xx/pm.c | 2 +- arch/sh/kernel/cpu/shmobile/pm.c | 2 +- drivers/acpi/sleep.c | 4 ++-- drivers/macintosh/via-pmu.c | 2 +- include/linux/suspend.h | 22 +++++++++++----------- kernel/power/suspend.c | 4 ++-- 21 files changed, 33 insertions(+), 33 deletions(-)
PATCH 3/10 Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
From: Emese Revfy <[email protected]>
--- arch/avr32/mach-at32ap/pm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/avr32/mach-at32ap/pm.c +1 -1
@@ -176,7 +176,7 @@ out:return 0 ; } -static struct platform_suspend_ops avr32_pm_ops = { +static const struct platform_suspend_ops avr32_pm_ops = { .valid = avr32_pm_valid_state, .enter = avr32_pm_enter, };
Signature · 1 line
1.6.5.3
PATCH 1/3 Constify struct platform_hibernation_ops for 2.6.32-git-053fe57ac v2
In reply to [email protected]From: Emese Revfy <[email protected]>
--- drivers/acpi/sleep.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/sleep.c +2 -2
@@ -552,7 +552,7 @@ static void acpi_pm_enable_gpes(void)acpi_enable_all_runtime_gpes (); } -static struct platform_hibernation_ops acpi_hibernation_ops = { +static const struct platform_hibernation_ops acpi_hibernation_ops = { .begin = acpi_hibernation_begin, .end = acpi_pm_end, .pre_snapshot = acpi_hibernation_pre_snapshot,
@@ -605,7 +605,7 @@ static int acpi_hibernation_pre_snapshot_old(void)* The following callbacks are used if the pre-ACPI 2.0 suspend ordering has * been requested. */ -static struct platform_hibernation_ops acpi_hibernation_ops_old = { +static const struct platform_hibernation_ops acpi_hibernation_ops_old = { .begin = acpi_hibernation_begin_old, .end = acpi_pm_end, .pre_snapshot = acpi_hibernation_pre_snapshot_old,
Signature · 1 line
1.6.5.3
PATCH 1/10 Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
In reply to [email protected]From: Emese Revfy <[email protected]>
--- drivers/acpi/sleep.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/sleep.c +2 -2
@@ -297,7 +297,7 @@ static int acpi_suspend_state_valid(suspend_state_t pm_state) } } -static struct platform_suspend_ops acpi_suspend_ops = { +static const struct platform_suspend_ops acpi_suspend_ops = { .valid = acpi_suspend_state_valid, .begin = acpi_suspend_begin, .prepare_late = acpi_pm_prepare,
@@ -325,7 +325,7 @@ static int acpi_suspend_begin_old(suspend_state_t pm_state)* The following callbacks are used if the pre-ACPI 2.0 suspend ordering has * been requested. */ -static struct platform_suspend_ops acpi_suspend_ops_old = { +static const struct platform_suspend_ops acpi_suspend_ops_old = { .valid = acpi_suspend_state_valid, .begin = acpi_suspend_begin_old, .prepare_late = acpi_pm_disable_gpes,
Signature · 1 line
1.6.5.3
Quoted 8 lines · On Mon 2009-12-14 01:00:16, [email protected] wrote:
From: Emese Revfy <[email protected]>
Hello everyone!
The following patch series attempts to constify several structures that hold function pointers. This is only the initial batch, there are about over 150 candidate structures, some of which can be constified as well, I plan to submit them in the future.
I seem to get each mail twice, including the introduction one, with different subject each time (and probably same message-id for different mails).
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 4 lines · On Mon 2009-12-14 01:00:21, [email protected] wrote:
From: Emese Revfy <[email protected]>
Signed-off-by Emese Revfy <[email protected]>
It definitely needs an explanation, and it has none.
Quoted 17 lines
index 5e781d8..3a2553d 100644
include/linux/suspend.h +1
-9@@ -104,15 +104,15 @@ typedef int __bitwise suspend_state_t;* which require special recovery actions in that situation. */ struct platform_suspend_ops { -int (*valid)(suspend_state_t state); -int (*begin)(suspend_state_t state); -int (*prepare)(void ); -int (*prepare_late)(void ); -int (*enter)(suspend_state_t state); -void (*wake)(void ); -void (*finish)(void ); -void (*end)(void ); -void (*recover)(void ); +int (*const valid)(suspend_state_t state);
include/linux/suspend.h typedef int __bitwise suspend_state_t; · line 117
Quoted 10 lines
include/linux/suspend.h +8
-0+int (*const begin)(suspend_state_t state); +int (*const prepare)(void ); +int (*const prepare_late)(void ); +int (*const enter)(suspend_state_t state); +void (*const wake)(void ); +void (*const finish)(void ); +void (*const end)(void ); +void (*const recover)(void ); };
I'm not sure what this is good for. Are you afraid that I'd do *(char *)ops->end = 0x90 , or what?
include/linux/suspend.h struct platform_suspend_ops { · line 125
Quoted 8 lines
include/linux/suspend.h +1
-1@@ -120,7 +120,7 @@ struct platform_suspend_ops {* suspend_set_ops - set platform dependent suspend operations * @ops: The new suspend operations to set. */ -extern void suspend_set_ops (struct platform_suspend_ops *ops); +extern void suspend_set_ops (const struct platform_suspend_ops *ops);extern int suspend_valid_only_mem (suspend_state_t state);
These I can at least understand, and are probably ok.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 7 lines · Pavel Machek
Quoted 4 lines · On Mon 2009-12-14 01:00:21, [email protected] wrote:
From: Emese Revfy <[email protected]>
Signed-off-by Emese Revfy <[email protected]>It definitely needs an explanation, and it has none.
Sorry, you are right, I am just new to git. The next series will include the explanation.
--
Emese