* [PATCH 01/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
2009-12-14 0:00 [PATCH 00/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2 re.emese
@ 2009-12-14 0:00 ` re.emese
2009-12-14 0:00 ` [PATCH 02/10] " re.emese
` (13 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: re.emese @ 2009-12-14 0:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Emese Revfy, lenb, jbarnes, torvalds
From: Emese Revfy <re.emese@gmail.com>
Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
drivers/acpi/sleep.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 5f2c379..1851ae2 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -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,
--
1.6.5.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 02/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
2009-12-14 0:00 [PATCH 00/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2 re.emese
2009-12-14 0:00 ` [PATCH 01/10] " re.emese
@ 2009-12-14 0:00 ` re.emese
2009-12-14 0:00 ` [PATCH 03/10] " re.emese
` (12 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: re.emese @ 2009-12-14 0:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Emese Revfy, linux, nicolas.ferre, akpm, torvalds
From: Emese Revfy <re.emese@gmail.com>
Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
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(-)
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 6156689..fca5b29 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -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,
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c
index b1d3f9f..6e126ce 100644
--- a/arch/arm/mach-omap1/pm.c
+++ b/arch/arm/mach-omap1/pm.c
@@ -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,
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c
index cba05b9..19585b9 100644
--- a/arch/arm/mach-omap2/pm24xx.c
+++ b/arch/arm/mach-omap2/pm24xx.c
@@ -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,
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 81ed252..4cac25d 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -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,
diff --git a/arch/arm/mach-pnx4008/pm.c b/arch/arm/mach-pnx4008/pm.c
index b3d8d53..6e68ebc 100644
--- a/arch/arm/mach-pnx4008/pm.c
+++ b/arch/arm/mach-pnx4008/pm.c
@@ -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,
};
diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c
index 7693355..9beb00a 100644
--- a/arch/arm/mach-pxa/pm.c
+++ b/arch/arm/mach-pxa/pm.c
@@ -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,
diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
index 67229a1..c55dd8f 100644
--- a/arch/arm/mach-pxa/sharpsl_pm.c
+++ b/arch/arm/mach-pxa/sharpsl_pm.c
@@ -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,
diff --git a/arch/arm/mach-sa1100/pm.c b/arch/arm/mach-sa1100/pm.c
index c83fdc8..ab9fc44 100644
--- a/arch/arm/mach-sa1100/pm.c
+++ b/arch/arm/mach-sa1100/pm.c
@@ -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,
};
diff --git a/arch/arm/plat-s3c/pm.c b/arch/arm/plat-s3c/pm.c
index 7674706..4af2ef1 100644
--- a/arch/arm/plat-s3c/pm.c
+++ b/arch/arm/plat-s3c/pm.c
@@ -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,
--
1.6.5.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 03/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
2009-12-14 0:00 [PATCH 00/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2 re.emese
2009-12-14 0:00 ` [PATCH 01/10] " re.emese
2009-12-14 0:00 ` [PATCH 02/10] " re.emese
@ 2009-12-14 0:00 ` re.emese
2009-12-14 0:00 ` [PATCH 04/10] " re.emese
` (11 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: re.emese @ 2009-12-14 0:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Emese Revfy, akpm, hskinnemoen, nicolas.ferre, torvalds
From: Emese Revfy <re.emese@gmail.com>
Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
arch/avr32/mach-at32ap/pm.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/avr32/mach-at32ap/pm.c b/arch/avr32/mach-at32ap/pm.c
index f021edf..32d680e 100644
--- a/arch/avr32/mach-at32ap/pm.c
+++ b/arch/avr32/mach-at32ap/pm.c
@@ -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,
};
--
1.6.5.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 04/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
2009-12-14 0:00 [PATCH 00/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2 re.emese
` (2 preceding siblings ...)
2009-12-14 0:00 ` [PATCH 03/10] " re.emese
@ 2009-12-14 0:00 ` re.emese
2009-12-14 0:00 ` [PATCH 1/3] Constify struct platform_hibernation_ops " re.emese
` (10 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: re.emese @ 2009-12-14 0:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Emese Revfy, vapier, cooloney, torvalds
From: Emese Revfy <re.emese@gmail.com>
Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
arch/blackfin/mach-common/pm.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/blackfin/mach-common/pm.c b/arch/blackfin/mach-common/pm.c
index 8837be4..b2fb413 100644
--- a/arch/blackfin/mach-common/pm.c
+++ b/arch/blackfin/mach-common/pm.c
@@ -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,
};
--
1.6.5.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 1/3] Constify struct platform_hibernation_ops for 2.6.32-git-053fe57ac v2
2009-12-14 0:00 [PATCH 00/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2 re.emese
` (3 preceding siblings ...)
2009-12-14 0:00 ` [PATCH 04/10] " re.emese
@ 2009-12-14 0:00 ` re.emese
2009-12-14 0:00 ` [PATCH 1/1] Constify struct pci_raw_ops " re.emese
` (9 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: re.emese @ 2009-12-14 0:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Emese Revfy, lenb, jbarnes, torvalds
From: Emese Revfy <re.emese@gmail.com>
Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
drivers/acpi/sleep.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 5f2c379..3f5957a 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -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,
--
1.6.5.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 1/1] Constify struct pci_raw_ops for 2.6.32-git-053fe57ac v2
2009-12-14 0:00 [PATCH 00/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2 re.emese
` (4 preceding siblings ...)
2009-12-14 0:00 ` [PATCH 1/3] Constify struct platform_hibernation_ops " re.emese
@ 2009-12-14 0:00 ` re.emese
2009-12-14 0:00 ` [PATCH 05/10] Constify struct platform_suspend_ops " re.emese
` (8 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: re.emese @ 2009-12-14 0:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Emese Revfy, hpa, mingo, tglx, torvalds
From: Emese Revfy <re.emese@gmail.com>
Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
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(-)
diff --git a/arch/x86/include/asm/pci_x86.h b/arch/x86/include/asm/pci_x86.h
index b4bf9a9..1f8effd 100644
--- a/arch/x86/include/asm/pci_x86.h
+++ b/arch/x86/include/asm/pci_x86.h
@@ -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 */
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index d2552c6..ba2c9d5 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -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)
diff --git a/arch/x86/pci/direct.c b/arch/x86/pci/direct.c
index 347d882..4baf6b6 100644
--- a/arch/x86/pci/direct.c
+++ b/arch/x86/pci/direct.c
@@ -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;
diff --git a/arch/x86/pci/mmconfig_32.c b/arch/x86/pci/mmconfig_32.c
index 90d5fd4..a7e23fc 100644
--- a/arch/x86/pci/mmconfig_32.c
+++ b/arch/x86/pci/mmconfig_32.c
@@ -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,
};
diff --git a/arch/x86/pci/mmconfig_64.c b/arch/x86/pci/mmconfig_64.c
index e783841..915a493 100644
--- a/arch/x86/pci/mmconfig_64.c
+++ b/arch/x86/pci/mmconfig_64.c
@@ -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,
};
diff --git a/arch/x86/pci/numaq_32.c b/arch/x86/pci/numaq_32.c
index 8eb295e..86bd657 100644
--- a/arch/x86/pci/numaq_32.c
+++ b/arch/x86/pci/numaq_32.c
@@ -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
};
diff --git a/arch/x86/pci/olpc.c b/arch/x86/pci/olpc.c
index b889d82..5a58a0a 100644
--- a/arch/x86/pci/olpc.c
+++ b/arch/x86/pci/olpc.c
@@ -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,
};
diff --git a/arch/x86/pci/pcbios.c b/arch/x86/pci/pcbios.c
index 1c975cc..5fa1cff 100644
--- a/arch/x86/pci/pcbios.c
+++ b/arch/x86/pci/pcbios.c
@@ -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;
--
1.6.5.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 05/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
2009-12-14 0:00 [PATCH 00/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2 re.emese
` (5 preceding siblings ...)
2009-12-14 0:00 ` [PATCH 1/1] Constify struct pci_raw_ops " re.emese
@ 2009-12-14 0:00 ` re.emese
2009-12-14 5:17 ` Pavel Machek
2009-12-14 0:00 ` [PATCH 2/3] Constify struct platform_hibernation_ops " re.emese
` (7 subsequent siblings)
14 siblings, 1 reply; 18+ messages in thread
From: re.emese @ 2009-12-14 0:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Emese Revfy, len.brown, pavel, akpm, torvalds
From: Emese Revfy <re.emese@gmail.com>
Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
include/linux/suspend.h | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 5e781d8..3a2553d 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -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 */
--
1.6.5.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [PATCH 05/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
2009-12-14 0:00 ` [PATCH 05/10] Constify struct platform_suspend_ops " re.emese
@ 2009-12-14 5:17 ` Pavel Machek
2009-12-14 22:47 ` Emese Revfy
0 siblings, 1 reply; 18+ messages in thread
From: Pavel Machek @ 2009-12-14 5:17 UTC (permalink / raw)
To: re.emese; +Cc: linux-kernel, len.brown, akpm, torvalds
On Mon 2009-12-14 01:00:21, re.emese@gmail.com wrote:
> From: Emese Revfy <re.emese@gmail.com>
>
>
> Signed-off-by: Emese Revfy <re.emese@gmail.com>
It definitely needs an explanation, and it has none.
> index 5e781d8..3a2553d 100644
> --- a/include/linux/suspend.h
> +++ b/include/linux/suspend.h
> @@ -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);
> };
>
I'm not sure what this is good for. Are you afraid that I'd do
*(char *)ops->end = 0x90 , or what?
> @@ -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
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 18+ messages in thread* Re: [PATCH 05/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
2009-12-14 5:17 ` Pavel Machek
@ 2009-12-14 22:47 ` Emese Revfy
0 siblings, 0 replies; 18+ messages in thread
From: Emese Revfy @ 2009-12-14 22:47 UTC (permalink / raw)
To: Pavel Machek; +Cc: linux-kernel, len.brown, akpm, torvalds
Pavel Machek wrote:
> On Mon 2009-12-14 01:00:21, re.emese@gmail.com wrote:
>> From: Emese Revfy <re.emese@gmail.com>
>>
>>
>> Signed-off-by: Emese Revfy <re.emese@gmail.com>
>
> 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
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 2/3] Constify struct platform_hibernation_ops for 2.6.32-git-053fe57ac v2
2009-12-14 0:00 [PATCH 00/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2 re.emese
` (6 preceding siblings ...)
2009-12-14 0:00 ` [PATCH 05/10] Constify struct platform_suspend_ops " re.emese
@ 2009-12-14 0:00 ` re.emese
2009-12-14 0:00 ` [PATCH 06/10] Constify struct platform_suspend_ops " re.emese
` (6 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: re.emese @ 2009-12-14 0:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Emese Revfy, pavel, len.brown, rjw, akpm, torvalds
From: Emese Revfy <re.emese@gmail.com>
Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
include/linux/suspend.h | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 5e781d8..cb4cc7d 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -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 */
--
1.6.5.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 06/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
2009-12-14 0:00 [PATCH 00/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2 re.emese
` (7 preceding siblings ...)
2009-12-14 0:00 ` [PATCH 2/3] Constify struct platform_hibernation_ops " re.emese
@ 2009-12-14 0:00 ` re.emese
2009-12-14 0:00 ` [PATCH 3/3] Constify struct platform_hibernation_ops " re.emese
` (5 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: re.emese @ 2009-12-14 0:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Emese Revfy, ralf, torvalds
From: Emese Revfy <re.emese@gmail.com>
Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
arch/mips/alchemy/devboards/pm.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/mips/alchemy/devboards/pm.c b/arch/mips/alchemy/devboards/pm.c
index 632f986..fd0378d 100644
--- a/arch/mips/alchemy/devboards/pm.c
+++ b/arch/mips/alchemy/devboards/pm.c
@@ -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,
--
1.6.5.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 3/3] Constify struct platform_hibernation_ops for 2.6.32-git-053fe57ac v2
2009-12-14 0:00 [PATCH 00/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2 re.emese
` (8 preceding siblings ...)
2009-12-14 0:00 ` [PATCH 06/10] Constify struct platform_suspend_ops " re.emese
@ 2009-12-14 0:00 ` re.emese
2009-12-14 0:00 ` [PATCH 07/10] Constify struct platform_suspend_ops " re.emese
` (4 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: re.emese @ 2009-12-14 0:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Emese Revfy, pavel, len.brown, jirislaby, torvalds
From: Emese Revfy <re.emese@gmail.com>
Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
kernel/power/hibernate.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index bbfe472..2766523 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -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
--
1.6.5.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 07/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
2009-12-14 0:00 [PATCH 00/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2 re.emese
` (9 preceding siblings ...)
2009-12-14 0:00 ` [PATCH 3/3] Constify struct platform_hibernation_ops " re.emese
@ 2009-12-14 0:00 ` re.emese
2009-12-14 0:00 ` [PATCH 08/10] " re.emese
` (3 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: re.emese @ 2009-12-14 0:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Emese Revfy, lethal, damm, torvalds
From: Emese Revfy <re.emese@gmail.com>
Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
arch/sh/boards/mach-hp6xx/pm.c | 2 +-
arch/sh/kernel/cpu/shmobile/pm.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/sh/boards/mach-hp6xx/pm.c b/arch/sh/boards/mach-hp6xx/pm.c
index d936c1a..304a252 100644
--- a/arch/sh/boards/mach-hp6xx/pm.c
+++ b/arch/sh/boards/mach-hp6xx/pm.c
@@ -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,
};
diff --git a/arch/sh/kernel/cpu/shmobile/pm.c b/arch/sh/kernel/cpu/shmobile/pm.c
index ca029a4..f2aa37d 100644
--- a/arch/sh/kernel/cpu/shmobile/pm.c
+++ b/arch/sh/kernel/cpu/shmobile/pm.c
@@ -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,
};
--
1.6.5.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 08/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
2009-12-14 0:00 [PATCH 00/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2 re.emese
` (10 preceding siblings ...)
2009-12-14 0:00 ` [PATCH 07/10] Constify struct platform_suspend_ops " re.emese
@ 2009-12-14 0:00 ` re.emese
2009-12-14 0:00 ` [PATCH 09/10] " re.emese
` (2 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: re.emese @ 2009-12-14 0:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Emese Revfy, pavel, len.brown, torvalds
From: Emese Revfy <re.emese@gmail.com>
Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
kernel/power/suspend.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 6f10dfc..08e1e7b 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -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;
--
1.6.5.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 09/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
2009-12-14 0:00 [PATCH 00/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2 re.emese
` (11 preceding siblings ...)
2009-12-14 0:00 ` [PATCH 08/10] " re.emese
@ 2009-12-14 0:00 ` re.emese
2009-12-14 0:00 ` [PATCH 10/10] " re.emese
2009-12-14 5:15 ` [PATCH 00/10] " Pavel Machek
14 siblings, 0 replies; 18+ messages in thread
From: re.emese @ 2009-12-14 0:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Emese Revfy, benh, paulus, torvalds
From: Emese Revfy <re.emese@gmail.com>
Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
drivers/macintosh/via-pmu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index 6f308a4..b5f7ff7 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -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,
};
--
1.6.5.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 10/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
2009-12-14 0:00 [PATCH 00/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2 re.emese
` (12 preceding siblings ...)
2009-12-14 0:00 ` [PATCH 09/10] " re.emese
@ 2009-12-14 0:00 ` re.emese
2009-12-14 5:15 ` [PATCH 00/10] " Pavel Machek
14 siblings, 0 replies; 18+ messages in thread
From: re.emese @ 2009-12-14 0:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Emese Revfy, benh, galak, paulus, torvalds
From: Emese Revfy <re.emese@gmail.com>
Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
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(-)
diff --git a/arch/powerpc/platforms/52xx/lite5200_pm.c b/arch/powerpc/platforms/52xx/lite5200_pm.c
index b5c753d..8f01abe 100644
--- a/arch/powerpc/platforms/52xx/lite5200_pm.c
+++ b/arch/powerpc/platforms/52xx/lite5200_pm.c
@@ -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,
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pm.c b/arch/powerpc/platforms/52xx/mpc52xx_pm.c
index a55b0b6..478c18e 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pm.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pm.c
@@ -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,
diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c
index 08e65fc..643d3ac 100644
--- a/arch/powerpc/platforms/83xx/suspend.c
+++ b/arch/powerpc/platforms/83xx/suspend.c
@@ -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,
--
1.6.5.3
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [PATCH 00/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2
2009-12-14 0:00 [PATCH 00/10] Constify struct platform_suspend_ops for 2.6.32-git-053fe57ac v2 re.emese
` (13 preceding siblings ...)
2009-12-14 0:00 ` [PATCH 10/10] " re.emese
@ 2009-12-14 5:15 ` Pavel Machek
14 siblings, 0 replies; 18+ messages in thread
From: Pavel Machek @ 2009-12-14 5:15 UTC (permalink / raw)
To: re.emese; +Cc: linux-kernel, lenb, torvalds, linux, akpm
On Mon 2009-12-14 01:00:16, re.emese@gmail.com wrote:
> From: Emese Revfy <re.emese@gmail.com>
>
> 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
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 18+ messages in thread