* Re: [PATCH 06/31] Constify struct e1000_mac_operations for 2.6.32 v1
[not found] ` <4B198A33.7080705@gmail.com>
@ 2009-12-04 22:39 ` Waskiewicz Jr, Peter P
2009-12-05 0:03 ` Emese Revfy
[not found] ` <4B19A337.6060808@gmail.com>
2 siblings, 0 replies; 28+ messages in thread
From: Waskiewicz Jr, Peter P @ 2009-12-04 22:39 UTC (permalink / raw)
To: Emese Revfy
Cc: Kirsher, Jeffrey T, Brandeburg, Jesse, Allan, Bruce W,
Waskiewicz Jr, Peter P, Ronciak, John,
torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
davem, netdev
On Fri, 4 Dec 2009, Emese Revfy wrote:
> From: Emese Revfy <re.emese@gmail.com>
>
> Constify struct e1000_mac_operations with some exceptions.
>
> Signed-off-by: Emese Revfy <re.emese@gmail.com>
Any networking patches need to be sent to the netdev list and Dave Miller.
I've added those to the CC, and will do the same for the other two e1000
patches in your series.
Cheers,
-PJ
> ---
> drivers/net/e1000e/82571.c | 3 ++-
> drivers/net/e1000e/e1000.h | 2 +-
> drivers/net/e1000e/es2lan.c | 3 ++-
> drivers/net/e1000e/ich8lan.c | 2 +-
> drivers/net/igb/e1000_82575.c | 2 +-
> drivers/net/igb/e1000_hw.h | 2 +-
> 6 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
> index d1e0563..16ffb11 100644
> --- a/drivers/net/e1000e/82571.c
> +++ b/drivers/net/e1000e/82571.c
> @@ -212,6 +212,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
> {
> struct e1000_hw *hw = &adapter->hw;
> struct e1000_mac_info *mac = &hw->mac;
> + /* cannot be const */
> struct e1000_mac_operations *func = &mac->ops;
> u32 swsm = 0;
> u32 swsm2 = 0;
> @@ -1656,7 +1657,7 @@ static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw)
> temp = er32(ICRXDMTC);
> }
>
> -static struct e1000_mac_operations e82571_mac_ops = {
> +static const struct e1000_mac_operations e82571_mac_ops = {
> /* .check_mng_mode: mac type dependent */
> /* .check_for_link: media type dependent */
> .id_led_init = e1000e_id_led_init,
> diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
> index 3e187b0..933f5da 100644
> --- a/drivers/net/e1000e/e1000.h
> +++ b/drivers/net/e1000e/e1000.h
> @@ -375,7 +375,7 @@ struct e1000_info {
> u32 pba;
> u32 max_hw_frame_size;
> s32 (*get_variants)(struct e1000_adapter *);
> - struct e1000_mac_operations *mac_ops;
> + const struct e1000_mac_operations *mac_ops;
> struct e1000_phy_operations *phy_ops;
> struct e1000_nvm_operations *nvm_ops;
> };
> diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
> index ae5d736..06d47e0 100644
> --- a/drivers/net/e1000e/es2lan.c
> +++ b/drivers/net/e1000e/es2lan.c
> @@ -207,6 +207,7 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter)
> {
> struct e1000_hw *hw = &adapter->hw;
> struct e1000_mac_info *mac = &hw->mac;
> + /* cannot be const */
> struct e1000_mac_operations *func = &mac->ops;
>
> /* Set media type */
> @@ -1365,7 +1366,7 @@ static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw)
> temp = er32(ICRXDMTC);
> }
>
> -static struct e1000_mac_operations es2_mac_ops = {
> +static const struct e1000_mac_operations es2_mac_ops = {
> .id_led_init = e1000e_id_led_init,
> .check_mng_mode = e1000e_check_mng_mode_generic,
> /* check_for_link dependent on media type */
> diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
> index eff3f47..3e0065b 100644
> --- a/drivers/net/e1000e/ich8lan.c
> +++ b/drivers/net/e1000e/ich8lan.c
> @@ -3451,7 +3451,7 @@ static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw)
> }
> }
>
> -static struct e1000_mac_operations ich8_mac_ops = {
> +static const struct e1000_mac_operations ich8_mac_ops = {
> .id_led_init = e1000e_id_led_init,
> .check_mng_mode = e1000_check_mng_mode_ich8lan,
> .check_for_link = e1000_check_for_copper_link_ich8lan,
> diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
> index f8f5772..3d5794f 100644
> --- a/drivers/net/igb/e1000_82575.c
> +++ b/drivers/net/igb/e1000_82575.c
> @@ -1400,7 +1400,7 @@ void igb_vmdq_set_replication_pf(struct e1000_hw *hw, bool enable)
> wr32(E1000_VT_CTL, vt_ctl);
> }
>
> -static struct e1000_mac_operations e1000_mac_ops_82575 = {
> +static const struct e1000_mac_operations e1000_mac_ops_82575 = {
> .reset_hw = igb_reset_hw_82575,
> .init_hw = igb_init_hw_82575,
> .check_for_link = igb_check_for_link_82575,
> diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
> index 119869b..d58b7e5 100644
> --- a/drivers/net/igb/e1000_hw.h
> +++ b/drivers/net/igb/e1000_hw.h
> @@ -310,7 +310,7 @@ struct e1000_nvm_operations {
>
> struct e1000_info {
> s32 (*get_invariants)(struct e1000_hw *);
> - struct e1000_mac_operations *mac_ops;
> + const struct e1000_mac_operations *mac_ops;
> struct e1000_phy_operations *phy_ops;
> struct e1000_nvm_operations *nvm_ops;
> };
>
>
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 07/31] Constify struct e1000_nvm_operations for 2.6.32 v1
[not found] ` <4B198A7E.4080407@gmail.com>
@ 2009-12-04 22:40 ` Waskiewicz Jr, Peter P
2009-12-05 0:03 ` Emese Revfy
1 sibling, 0 replies; 28+ messages in thread
From: Waskiewicz Jr, Peter P @ 2009-12-04 22:40 UTC (permalink / raw)
To: Emese Revfy
Cc: Kirsher, Jeffrey T, Brandeburg, Jesse, Allan, Bruce W,
Waskiewicz Jr, Peter P, Ronciak, John,
torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
davem, netdev
On Fri, 4 Dec 2009, Emese Revfy wrote:
> From: Emese Revfy <re.emese@gmail.com>
>
> Constify struct e1000_nvm_operations.
>
> Signed-off-by: Emese Revfy <re.emese@gmail.com>
Added Dave Miller and netdev.
> ---
> drivers/net/e1000e/82571.c | 2 +-
> drivers/net/e1000e/e1000.h | 2 +-
> drivers/net/e1000e/es2lan.c | 2 +-
> drivers/net/e1000e/hw.h | 16 ++++++++--------
> drivers/net/e1000e/ich8lan.c | 2 +-
> drivers/net/igb/e1000_82575.c | 2 +-
> drivers/net/igb/e1000_hw.h | 12 ++++++------
> 7 files changed, 19 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
> index d1e0563..2a2355f 100644
> --- a/drivers/net/e1000e/82571.c
> +++ b/drivers/net/e1000e/82571.c
> @@ -1725,7 +1725,7 @@ static struct e1000_phy_operations e82_phy_ops_bm = {
> .cfg_on_link_up = NULL,
> };
>
> -static struct e1000_nvm_operations e82571_nvm_ops = {
> +static const struct e1000_nvm_operations e82571_nvm_ops = {
> .acquire_nvm = e1000_acquire_nvm_82571,
> .read_nvm = e1000e_read_nvm_eerd,
> .release_nvm = e1000_release_nvm_82571,
> diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
> index 3e187b0..bcdcfb1 100644
> --- a/drivers/net/e1000e/e1000.h
> +++ b/drivers/net/e1000e/e1000.h
> @@ -377,7 +377,7 @@ struct e1000_info {
> s32 (*get_variants)(struct e1000_adapter *);
> struct e1000_mac_operations *mac_ops;
> struct e1000_phy_operations *phy_ops;
> - struct e1000_nvm_operations *nvm_ops;
> + const struct e1000_nvm_operations *nvm_ops;
> };
>
> /* hardware capability, feature, and workaround flags */
> diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
> index ae5d736..a980900 100644
> --- a/drivers/net/e1000e/es2lan.c
> +++ b/drivers/net/e1000e/es2lan.c
> @@ -1400,7 +1400,7 @@ static struct e1000_phy_operations es2_phy_ops = {
> .cfg_on_link_up = e1000_cfg_on_link_up_80003es2lan,
> };
>
> -static struct e1000_nvm_operations es2_nvm_ops = {
> +static const struct e1000_nvm_operations es2_nvm_ops = {
> .acquire_nvm = e1000_acquire_nvm_80003es2lan,
> .read_nvm = e1000e_read_nvm_eerd,
> .release_nvm = e1000_release_nvm_80003es2lan,
> diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
> index aaea41e..f7f181f 100644
> --- a/drivers/net/e1000e/hw.h
> +++ b/drivers/net/e1000e/hw.h
> @@ -776,13 +776,13 @@ struct e1000_phy_operations {
>
> /* Function pointers for the NVM. */
> struct e1000_nvm_operations {
> - s32 (*acquire_nvm)(struct e1000_hw *);
> - s32 (*read_nvm)(struct e1000_hw *, u16, u16, u16 *);
> - void (*release_nvm)(struct e1000_hw *);
> - s32 (*update_nvm)(struct e1000_hw *);
> - s32 (*valid_led_default)(struct e1000_hw *, u16 *);
> - s32 (*validate_nvm)(struct e1000_hw *);
> - s32 (*write_nvm)(struct e1000_hw *, u16, u16, u16 *);
> + s32 (* const acquire_nvm)(struct e1000_hw *);
> + s32 (* const read_nvm)(struct e1000_hw *, u16, u16, u16 *);
> + void (* const release_nvm)(struct e1000_hw *);
> + s32 (* const update_nvm)(struct e1000_hw *);
> + s32 (* const valid_led_default)(struct e1000_hw *, u16 *);
> + s32 (* const validate_nvm)(struct e1000_hw *);
> + s32 (* const write_nvm)(struct e1000_hw *, u16, u16, u16 *);
> };
>
> struct e1000_mac_info {
> @@ -856,7 +856,7 @@ struct e1000_phy_info {
> };
>
> struct e1000_nvm_info {
> - struct e1000_nvm_operations ops;
> + const struct e1000_nvm_operations ops;
>
> enum e1000_nvm_type type;
> enum e1000_nvm_override override;
> diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
> index eff3f47..8835afa 100644
> --- a/drivers/net/e1000e/ich8lan.c
> +++ b/drivers/net/e1000e/ich8lan.c
> @@ -3485,7 +3485,7 @@ static struct e1000_phy_operations ich8_phy_ops = {
> .write_phy_reg = e1000e_write_phy_reg_igp,
> };
>
> -static struct e1000_nvm_operations ich8_nvm_ops = {
> +static const struct e1000_nvm_operations ich8_nvm_ops = {
> .acquire_nvm = e1000_acquire_nvm_ich8lan,
> .read_nvm = e1000_read_nvm_ich8lan,
> .release_nvm = e1000_release_nvm_ich8lan,
> diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
> index f8f5772..f62d4e1 100644
> --- a/drivers/net/igb/e1000_82575.c
> +++ b/drivers/net/igb/e1000_82575.c
> @@ -1415,7 +1415,7 @@ static struct e1000_phy_operations e1000_phy_ops_82575 = {
> .release = igb_release_phy_82575,
> };
>
> -static struct e1000_nvm_operations e1000_nvm_ops_82575 = {
> +static const struct e1000_nvm_operations e1000_nvm_ops_82575 = {
> .acquire = igb_acquire_nvm_82575,
> .read = igb_read_nvm_eerd,
> .release = igb_release_nvm_82575,
> diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
> index 119869b..c31e6b2 100644
> --- a/drivers/net/igb/e1000_hw.h
> +++ b/drivers/net/igb/e1000_hw.h
> @@ -302,17 +302,17 @@ struct e1000_phy_operations {
> };
>
> struct e1000_nvm_operations {
> - s32 (*acquire)(struct e1000_hw *);
> - s32 (*read)(struct e1000_hw *, u16, u16, u16 *);
> - void (*release)(struct e1000_hw *);
> - s32 (*write)(struct e1000_hw *, u16, u16, u16 *);
> + s32 (* const acquire)(struct e1000_hw *);
> + s32 (* const read)(struct e1000_hw *, u16, u16, u16 *);
> + void (* const release)(struct e1000_hw *);
> + s32 (* const write)(struct e1000_hw *, u16, u16, u16 *);
> };
>
> struct e1000_info {
> s32 (*get_invariants)(struct e1000_hw *);
> struct e1000_mac_operations *mac_ops;
> struct e1000_phy_operations *phy_ops;
> - struct e1000_nvm_operations *nvm_ops;
> + const struct e1000_nvm_operations *nvm_ops;
> };
>
> extern const struct e1000_info e1000_82575_info;
> @@ -397,7 +397,7 @@ struct e1000_phy_info {
> };
>
> struct e1000_nvm_info {
> - struct e1000_nvm_operations ops;
> + const struct e1000_nvm_operations ops;
>
> enum e1000_nvm_type type;
> enum e1000_nvm_override override;
>
>
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 08/31] Constify struct e1000_phy_operations for 2.6.32 v1
[not found] ` <4B198AE3.2040003@gmail.com>
@ 2009-12-04 22:40 ` Waskiewicz Jr, Peter P
2009-12-05 0:03 ` Emese Revfy
1 sibling, 0 replies; 28+ messages in thread
From: Waskiewicz Jr, Peter P @ 2009-12-04 22:40 UTC (permalink / raw)
To: Emese Revfy
Cc: Kirsher, Jeffrey T, Brandeburg, Jesse, Allan, Bruce W,
Waskiewicz Jr, Peter P, Ronciak, John,
torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
davem, netdev
On Fri, 4 Dec 2009, Emese Revfy wrote:
> From: Emese Revfy <re.emese@gmail.com>
>
> Constify struct e1000_phy_operations.
>
> Signed-off-by: Emese Revfy <re.emese@gmail.com>
Added Dave Miller and netdev.
> ---
> drivers/net/e1000e/82571.c | 6 +++---
> drivers/net/e1000e/e1000.h | 2 +-
> drivers/net/e1000e/es2lan.c | 2 +-
> drivers/net/e1000e/ich8lan.c | 2 +-
> drivers/net/igb/e1000_82575.c | 2 +-
> drivers/net/igb/e1000_hw.h | 2 +-
> 6 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
> index d1e0563..9457254 100644
> --- a/drivers/net/e1000e/82571.c
> +++ b/drivers/net/e1000e/82571.c
> @@ -1674,7 +1674,7 @@ static struct e1000_mac_operations e82571_mac_ops = {
> .setup_led = e1000e_setup_led_generic,
> };
>
> -static struct e1000_phy_operations e82_phy_ops_igp = {
> +static const struct e1000_phy_operations e82_phy_ops_igp = {
> .acquire_phy = e1000_get_hw_semaphore_82571,
> .check_reset_block = e1000e_check_reset_block_generic,
> .commit_phy = NULL,
> @@ -1691,7 +1691,7 @@ static struct e1000_phy_operations e82_phy_ops_igp = {
> .cfg_on_link_up = NULL,
> };
>
> -static struct e1000_phy_operations e82_phy_ops_m88 = {
> +static const struct e1000_phy_operations e82_phy_ops_m88 = {
> .acquire_phy = e1000_get_hw_semaphore_82571,
> .check_reset_block = e1000e_check_reset_block_generic,
> .commit_phy = e1000e_phy_sw_reset,
> @@ -1708,7 +1708,7 @@ static struct e1000_phy_operations e82_phy_ops_m88 = {
> .cfg_on_link_up = NULL,
> };
>
> -static struct e1000_phy_operations e82_phy_ops_bm = {
> +static const struct e1000_phy_operations e82_phy_ops_bm = {
> .acquire_phy = e1000_get_hw_semaphore_82571,
> .check_reset_block = e1000e_check_reset_block_generic,
> .commit_phy = e1000e_phy_sw_reset,
> diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
> index 3e187b0..7744c27 100644
> --- a/drivers/net/e1000e/e1000.h
> +++ b/drivers/net/e1000e/e1000.h
> @@ -376,7 +376,7 @@ struct e1000_info {
> u32 max_hw_frame_size;
> s32 (*get_variants)(struct e1000_adapter *);
> struct e1000_mac_operations *mac_ops;
> - struct e1000_phy_operations *phy_ops;
> + const struct e1000_phy_operations *phy_ops;
> struct e1000_nvm_operations *nvm_ops;
> };
>
> diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
> index ae5d736..631c037 100644
> --- a/drivers/net/e1000e/es2lan.c
> +++ b/drivers/net/e1000e/es2lan.c
> @@ -1383,7 +1383,7 @@ static struct e1000_mac_operations es2_mac_ops = {
> .setup_led = e1000e_setup_led_generic,
> };
>
> -static struct e1000_phy_operations es2_phy_ops = {
> +static const struct e1000_phy_operations es2_phy_ops = {
> .acquire_phy = e1000_acquire_phy_80003es2lan,
> .check_reset_block = e1000e_check_reset_block_generic,
> .commit_phy = e1000e_phy_sw_reset,
> diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
> index eff3f47..ca9d830 100644
> --- a/drivers/net/e1000e/ich8lan.c
> +++ b/drivers/net/e1000e/ich8lan.c
> @@ -3469,7 +3469,7 @@ static struct e1000_mac_operations ich8_mac_ops = {
> /* id_led_init dependent on mac type */
> };
>
> -static struct e1000_phy_operations ich8_phy_ops = {
> +static const struct e1000_phy_operations ich8_phy_ops = {
> .acquire_phy = e1000_acquire_swflag_ich8lan,
> .check_reset_block = e1000_check_reset_block_ich8lan,
> .commit_phy = NULL,
> diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
> index f8f5772..a3e64ae 100644
> --- a/drivers/net/igb/e1000_82575.c
> +++ b/drivers/net/igb/e1000_82575.c
> @@ -1409,7 +1409,7 @@ static struct e1000_mac_operations e1000_mac_ops_82575 = {
> .get_speed_and_duplex = igb_get_speed_and_duplex_copper,
> };
>
> -static struct e1000_phy_operations e1000_phy_ops_82575 = {
> +static const struct e1000_phy_operations e1000_phy_ops_82575 = {
> .acquire = igb_acquire_phy_82575,
> .get_cfg_done = igb_get_cfg_done_82575,
> .release = igb_release_phy_82575,
> diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
> index 119869b..326e0e7 100644
> --- a/drivers/net/igb/e1000_hw.h
> +++ b/drivers/net/igb/e1000_hw.h
> @@ -311,7 +311,7 @@ struct e1000_nvm_operations {
> struct e1000_info {
> s32 (*get_invariants)(struct e1000_hw *);
> struct e1000_mac_operations *mac_ops;
> - struct e1000_phy_operations *phy_ops;
> + const struct e1000_phy_operations *phy_ops;
> struct e1000_nvm_operations *nvm_ops;
> };
>
>
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 29/31] Constify struct sysfs_ops for 2.6.32 v1
[not found] ` <4B1991E2.5010903@gmail.com>
@ 2009-12-04 23:00 ` Emese Revfy
2009-12-05 0:03 ` Emese Revfy
1 sibling, 0 replies; 28+ messages in thread
From: Emese Revfy @ 2009-12-04 23:00 UTC (permalink / raw)
To: tony.luck, fenghua.yu, benh, lethal, tglx, mingo, hpa, axboe,
gregkh, petero2
Added netdev@vger.kernel.org to CC.
> From: Emese Revfy <re.emese@gmail.com>
>
> Constify struct sysfs_ops.
>
> Signed-off-by: Emese Revfy <re.emese@gmail.com>
> ---
> arch/ia64/kernel/topology.c | 2 +-
> arch/powerpc/kernel/cacheinfo.c | 2 +-
> arch/sh/kernel/cpu/sh4/sq.c | 2 +-
> arch/x86/kernel/cpu/intel_cacheinfo.c | 2 +-
> arch/x86/kernel/cpu/mcheck/mce_amd.c | 2 +-
> block/blk-integrity.c | 2 +-
> block/blk-sysfs.c | 2 +-
> block/elevator.c | 2 +-
> drivers/base/bus.c | 4 ++--
> drivers/base/class.c | 2 +-
> drivers/base/core.c | 2 +-
> drivers/base/sys.c | 4 ++--
> drivers/block/pktcdvd.c | 2 +-
> drivers/cpufreq/cpufreq.c | 2 +-
> drivers/cpuidle/sysfs.c | 4 ++--
> drivers/dma/ioat/dma.c | 2 +-
> drivers/dma/ioat/dma.h | 2 +-
> drivers/edac/edac_device_sysfs.c | 6 +++---
> drivers/edac/edac_mc_sysfs.c | 4 ++--
> drivers/edac/edac_pci_sysfs.c | 4 ++--
> drivers/firmware/edd.c | 2 +-
> drivers/firmware/efivars.c | 2 +-
> drivers/firmware/iscsi_ibft.c | 2 +-
> drivers/firmware/memmap.c | 2 +-
> drivers/gpu/drm/ttm/ttm_bo.c | 2 +-
> drivers/gpu/drm/ttm/ttm_memory.c | 2 +-
> drivers/infiniband/core/cm.c | 2 +-
> drivers/infiniband/core/sysfs.c | 2 +-
> drivers/md/dm-sysfs.c | 2 +-
> drivers/md/md.c | 4 ++--
> drivers/net/ibmveth.c | 2 +-
> drivers/net/iseries_veth.c | 4 ++--
> drivers/parisc/pdc_stable.c | 2 +-
> drivers/pci/hotplug/fakephp.c | 2 +-
> drivers/pci/slot.c | 2 +-
> drivers/uio/uio.c | 4 ++--
> drivers/uwb/wlp/sysfs.c | 3 +--
> drivers/xen/sys-hypervisor.c | 2 +-
> fs/btrfs/sysfs.c | 4 ++--
> fs/dlm/lockspace.c | 2 +-
> fs/ext4/super.c | 2 +-
> fs/gfs2/sys.c | 2 +-
> fs/ocfs2/cluster/masklog.c | 2 +-
> fs/sysfs/file.c | 8 ++++----
> include/linux/kobject.h | 4 ++--
> include/linux/sysfs.h | 4 ++--
> kernel/params.c | 2 +-
> lib/kobject.c | 2 +-
> mm/slub.c | 2 +-
> net/bridge/br_private.h | 2 +-
> net/bridge/br_sysfs_if.c | 2 +-
> samples/kobject/kset-example.c | 2 +-
> 52 files changed, 68 insertions(+), 69 deletions(-)
>
> diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
> index 8f06035..b3a5818 100644
> --- a/arch/ia64/kernel/topology.c
> +++ b/arch/ia64/kernel/topology.c
> @@ -282,7 +282,7 @@ static ssize_t cache_show(struct kobject * kobj, struct attribute * attr, char *
> return ret;
> }
>
> -static struct sysfs_ops cache_sysfs_ops = {
> +static const struct sysfs_ops cache_sysfs_ops = {
> .show = cache_show
> };
>
> diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c
> index bb37b1d..01fe9ce 100644
> --- a/arch/powerpc/kernel/cacheinfo.c
> +++ b/arch/powerpc/kernel/cacheinfo.c
> @@ -642,7 +642,7 @@ static struct kobj_attribute *cache_index_opt_attrs[] = {
> &cache_assoc_attr,
> };
>
> -static struct sysfs_ops cache_index_ops = {
> +static const struct sysfs_ops cache_index_ops = {
> .show = cache_index_show,
> };
>
> diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c
> index 8a8a993..7b3079b 100644
> --- a/arch/sh/kernel/cpu/sh4/sq.c
> +++ b/arch/sh/kernel/cpu/sh4/sq.c
> @@ -327,7 +327,7 @@ static struct attribute *sq_sysfs_attrs[] = {
> NULL,
> };
>
> -static struct sysfs_ops sq_sysfs_ops = {
> +static const struct sysfs_ops sq_sysfs_ops = {
> .show = sq_sysfs_show,
> .store = sq_sysfs_store,
> };
> diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
> index 804c40e..dc7f8a7 100644
> --- a/arch/x86/kernel/cpu/intel_cacheinfo.c
> +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
> @@ -860,7 +860,7 @@ static ssize_t store(struct kobject *kobj, struct attribute *attr,
> return ret;
> }
>
> -static struct sysfs_ops sysfs_ops = {
> +static const struct sysfs_ops sysfs_ops = {
> .show = show,
> .store = store,
> };
> diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
> index 83a3d1f..cda932c 100644
> --- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
> +++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
> @@ -388,7 +388,7 @@ static ssize_t store(struct kobject *kobj, struct attribute *attr,
> return ret;
> }
>
> -static struct sysfs_ops threshold_ops = {
> +static const struct sysfs_ops threshold_ops = {
> .show = show,
> .store = store,
> };
> diff --git a/block/blk-integrity.c b/block/blk-integrity.c
> index 15c6308..96e83c2 100644
> --- a/block/blk-integrity.c
> +++ b/block/blk-integrity.c
> @@ -278,7 +278,7 @@ static struct attribute *integrity_attrs[] = {
> NULL,
> };
>
> -static struct sysfs_ops integrity_ops = {
> +static const struct sysfs_ops integrity_ops = {
> .show = &integrity_attr_show,
> .store = &integrity_attr_store,
> };
> diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
> index 8a6d81a..dc3e40b 100644
> --- a/block/blk-sysfs.c
> +++ b/block/blk-sysfs.c
> @@ -414,7 +414,7 @@ static void blk_release_queue(struct kobject *kobj)
> kmem_cache_free(blk_requestq_cachep, q);
> }
>
> -static struct sysfs_ops queue_sysfs_ops = {
> +static const struct sysfs_ops queue_sysfs_ops = {
> .show = queue_attr_show,
> .store = queue_attr_store,
> };
> diff --git a/block/elevator.c b/block/elevator.c
> index a847046..75a1746 100644
> --- a/block/elevator.c
> +++ b/block/elevator.c
> @@ -889,7 +889,7 @@ elv_attr_store(struct kobject *kobj, struct attribute *attr,
> return error;
> }
>
> -static struct sysfs_ops elv_sysfs_ops = {
> +static const struct sysfs_ops elv_sysfs_ops = {
> .show = elv_attr_show,
> .store = elv_attr_store,
> };
> diff --git a/drivers/base/bus.c b/drivers/base/bus.c
> index 63c143e..66ddfea 100644
> --- a/drivers/base/bus.c
> +++ b/drivers/base/bus.c
> @@ -70,7 +70,7 @@ static ssize_t drv_attr_store(struct kobject *kobj, struct attribute *attr,
> return ret;
> }
>
> -static struct sysfs_ops driver_sysfs_ops = {
> +static const struct sysfs_ops driver_sysfs_ops = {
> .show = drv_attr_show,
> .store = drv_attr_store,
> };
> @@ -115,7 +115,7 @@ static ssize_t bus_attr_store(struct kobject *kobj, struct attribute *attr,
> return ret;
> }
>
> -static struct sysfs_ops bus_sysfs_ops = {
> +static const struct sysfs_ops bus_sysfs_ops = {
> .show = bus_attr_show,
> .store = bus_attr_store,
> };
> diff --git a/drivers/base/class.c b/drivers/base/class.c
> index 161746d..c2359c8 100644
> --- a/drivers/base/class.c
> +++ b/drivers/base/class.c
> @@ -61,7 +61,7 @@ static void class_release(struct kobject *kobj)
> "be careful\n", class->name);
> }
>
> -static struct sysfs_ops class_sysfs_ops = {
> +static const struct sysfs_ops class_sysfs_ops = {
> .show = class_attr_show,
> .store = class_attr_store,
> };
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 6bee6af..35aeae5 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -93,7 +93,7 @@ static ssize_t dev_attr_store(struct kobject *kobj, struct attribute *attr,
> return ret;
> }
>
> -static struct sysfs_ops dev_sysfs_ops = {
> +static const struct sysfs_ops dev_sysfs_ops = {
> .show = dev_attr_show,
> .store = dev_attr_store,
> };
> diff --git a/drivers/base/sys.c b/drivers/base/sys.c
> index 0d90390..dd710ca 100644
> --- a/drivers/base/sys.c
> +++ b/drivers/base/sys.c
> @@ -54,7 +54,7 @@ sysdev_store(struct kobject *kobj, struct attribute *attr,
> return -EIO;
> }
>
> -static struct sysfs_ops sysfs_ops = {
> +static const struct sysfs_ops sysfs_ops = {
> .show = sysdev_show,
> .store = sysdev_store,
> };
> @@ -104,7 +104,7 @@ static ssize_t sysdev_class_store(struct kobject *kobj, struct attribute *attr,
> return -EIO;
> }
>
> -static struct sysfs_ops sysfs_class_ops = {
> +static const struct sysfs_ops sysfs_class_ops = {
> .show = sysdev_class_show,
> .store = sysdev_class_store,
> };
> diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
> index 2ddf03a..44eab68 100644
> --- a/drivers/block/pktcdvd.c
> +++ b/drivers/block/pktcdvd.c
> @@ -284,7 +284,7 @@ static ssize_t kobj_pkt_store(struct kobject *kobj,
> return len;
> }
>
> -static struct sysfs_ops kobj_pkt_ops = {
> +static const struct sysfs_ops kobj_pkt_ops = {
> .show = kobj_pkt_show,
> .store = kobj_pkt_store
> };
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index ff57c40..76da29f 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -750,7 +750,7 @@ static void cpufreq_sysfs_release(struct kobject *kobj)
> complete(&policy->kobj_unregister);
> }
>
> -static struct sysfs_ops sysfs_ops = {
> +static const struct sysfs_ops sysfs_ops = {
> .show = show,
> .store = store,
> };
> diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
> index 97b0038..aaaa360 100644
> --- a/drivers/cpuidle/sysfs.c
> +++ b/drivers/cpuidle/sysfs.c
> @@ -191,7 +191,7 @@ static ssize_t cpuidle_store(struct kobject * kobj, struct attribute * attr,
> return ret;
> }
>
> -static struct sysfs_ops cpuidle_sysfs_ops = {
> +static const struct sysfs_ops cpuidle_sysfs_ops = {
> .show = cpuidle_show,
> .store = cpuidle_store,
> };
> @@ -277,7 +277,7 @@ static ssize_t cpuidle_state_show(struct kobject * kobj,
> return ret;
> }
>
> -static struct sysfs_ops cpuidle_state_sysfs_ops = {
> +static const struct sysfs_ops cpuidle_state_sysfs_ops = {
> .show = cpuidle_state_show,
> };
>
> diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c
> index c524d36..fc2d0b6 100644
> --- a/drivers/dma/ioat/dma.c
> +++ b/drivers/dma/ioat/dma.c
> @@ -1146,7 +1146,7 @@ ioat_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
> return entry->show(&chan->common, page);
> }
>
> -struct sysfs_ops ioat_sysfs_ops = {
> +const struct sysfs_ops ioat_sysfs_ops = {
> .show = ioat_attr_show,
> };
>
> diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h
> index 45edde9..c72e7fe 100644
> --- a/drivers/dma/ioat/dma.h
> +++ b/drivers/dma/ioat/dma.h
> @@ -329,7 +329,7 @@ bool ioat_cleanup_preamble(struct ioat_chan_common *chan,
> unsigned long *phys_complete);
> void ioat_kobject_add(struct ioatdma_device *device, struct kobj_type *type);
> void ioat_kobject_del(struct ioatdma_device *device);
> -extern struct sysfs_ops ioat_sysfs_ops;
> +extern const struct sysfs_ops ioat_sysfs_ops;
> extern struct ioat_sysfs_entry ioat_version_attr;
> extern struct ioat_sysfs_entry ioat_cap_attr;
> #endif /* IOATDMA_H */
> diff --git a/drivers/edac/edac_device_sysfs.c b/drivers/edac/edac_device_sysfs.c
> index 5376457..5fdedbc 100644
> --- a/drivers/edac/edac_device_sysfs.c
> +++ b/drivers/edac/edac_device_sysfs.c
> @@ -137,7 +137,7 @@ static ssize_t edac_dev_ctl_info_store(struct kobject *kobj,
> }
>
> /* edac_dev file operations for an 'ctl_info' */
> -static struct sysfs_ops device_ctl_info_ops = {
> +static const struct sysfs_ops device_ctl_info_ops = {
> .show = edac_dev_ctl_info_show,
> .store = edac_dev_ctl_info_store
> };
> @@ -373,7 +373,7 @@ static ssize_t edac_dev_instance_store(struct kobject *kobj,
> }
>
> /* edac_dev file operations for an 'instance' */
> -static struct sysfs_ops device_instance_ops = {
> +static const struct sysfs_ops device_instance_ops = {
> .show = edac_dev_instance_show,
> .store = edac_dev_instance_store
> };
> @@ -476,7 +476,7 @@ static ssize_t edac_dev_block_store(struct kobject *kobj,
> }
>
> /* edac_dev file operations for a 'block' */
> -static struct sysfs_ops device_block_ops = {
> +static const struct sysfs_ops device_block_ops = {
> .show = edac_dev_block_show,
> .store = edac_dev_block_store
> };
> diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
> index e1d4ce0..88840e9 100644
> --- a/drivers/edac/edac_mc_sysfs.c
> +++ b/drivers/edac/edac_mc_sysfs.c
> @@ -245,7 +245,7 @@ static ssize_t csrowdev_store(struct kobject *kobj, struct attribute *attr,
> return -EIO;
> }
>
> -static struct sysfs_ops csrowfs_ops = {
> +static const struct sysfs_ops csrowfs_ops = {
> .show = csrowdev_show,
> .store = csrowdev_store
> };
> @@ -575,7 +575,7 @@ static ssize_t mcidev_store(struct kobject *kobj, struct attribute *attr,
> }
>
> /* Intermediate show/store table */
> -static struct sysfs_ops mci_ops = {
> +static const struct sysfs_ops mci_ops = {
> .show = mcidev_show,
> .store = mcidev_store
> };
> diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c
> index 422728c..79217da 100644
> --- a/drivers/edac/edac_pci_sysfs.c
> +++ b/drivers/edac/edac_pci_sysfs.c
> @@ -121,7 +121,7 @@ static ssize_t edac_pci_instance_store(struct kobject *kobj,
> }
>
> /* fs_ops table */
> -static struct sysfs_ops pci_instance_ops = {
> +static const struct sysfs_ops pci_instance_ops = {
> .show = edac_pci_instance_show,
> .store = edac_pci_instance_store
> };
> @@ -261,7 +261,7 @@ static ssize_t edac_pci_dev_store(struct kobject *kobj,
> return -EIO;
> }
>
> -static struct sysfs_ops edac_pci_sysfs_ops = {
> +static const struct sysfs_ops edac_pci_sysfs_ops = {
> .show = edac_pci_dev_show,
> .store = edac_pci_dev_store
> };
> diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c
> index 9e4f59d..110e24e 100644
> --- a/drivers/firmware/edd.c
> +++ b/drivers/firmware/edd.c
> @@ -122,7 +122,7 @@ edd_attr_show(struct kobject * kobj, struct attribute *attr, char *buf)
> return ret;
> }
>
> -static struct sysfs_ops edd_attr_ops = {
> +static const struct sysfs_ops edd_attr_ops = {
> .show = edd_attr_show,
> };
>
> diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
> index f4f709d..082f06e 100644
> --- a/drivers/firmware/efivars.c
> +++ b/drivers/firmware/efivars.c
> @@ -362,7 +362,7 @@ static ssize_t efivar_attr_store(struct kobject *kobj, struct attribute *attr,
> return ret;
> }
>
> -static struct sysfs_ops efivar_attr_ops = {
> +static const struct sysfs_ops efivar_attr_ops = {
> .show = efivar_attr_show,
> .store = efivar_attr_store,
> };
> diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
> index 051d1eb..0a5d4e7 100644
> --- a/drivers/firmware/iscsi_ibft.c
> +++ b/drivers/firmware/iscsi_ibft.c
> @@ -525,7 +525,7 @@ static ssize_t ibft_show_attribute(struct kobject *kobj,
> return ret;
> }
>
> -static struct sysfs_ops ibft_attr_ops = {
> +static const struct sysfs_ops ibft_attr_ops = {
> .show = ibft_show_attribute,
> };
>
> diff --git a/drivers/firmware/memmap.c b/drivers/firmware/memmap.c
> index 56f9234..8c58c7b 100644
> --- a/drivers/firmware/memmap.c
> +++ b/drivers/firmware/memmap.c
> @@ -74,7 +74,7 @@ static struct attribute *def_attrs[] = {
> NULL
> };
>
> -static struct sysfs_ops memmap_attr_ops = {
> +static const struct sysfs_ops memmap_attr_ops = {
> .show = memmap_attr_show,
> };
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 87c0625..d9a23ef 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -67,7 +67,7 @@ static struct attribute *ttm_bo_global_attrs[] = {
> NULL
> };
>
> -static struct sysfs_ops ttm_bo_global_ops = {
> +static const struct sysfs_ops ttm_bo_global_ops = {
> .show = &ttm_bo_global_show
> };
>
> diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c
> index 072c281..d8ef483 100644
> --- a/drivers/gpu/drm/ttm/ttm_memory.c
> +++ b/drivers/gpu/drm/ttm/ttm_memory.c
> @@ -152,7 +152,7 @@ static struct attribute *ttm_mem_zone_attrs[] = {
> NULL
> };
>
> -static struct sysfs_ops ttm_mem_zone_ops = {
> +static const struct sysfs_ops ttm_mem_zone_ops = {
> .show = &ttm_mem_zone_show,
> .store = &ttm_mem_zone_store
> };
> diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
> index 5130fc5..764787e 100644
> --- a/drivers/infiniband/core/cm.c
> +++ b/drivers/infiniband/core/cm.c
> @@ -3597,7 +3597,7 @@ static ssize_t cm_show_counter(struct kobject *obj, struct attribute *attr,
> atomic_long_read(&group->counter[cm_attr->index]));
> }
>
> -static struct sysfs_ops cm_counter_ops = {
> +static const struct sysfs_ops cm_counter_ops = {
> .show = cm_show_counter
> };
>
> diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
> index 158a214..1558bb7 100644
> --- a/drivers/infiniband/core/sysfs.c
> +++ b/drivers/infiniband/core/sysfs.c
> @@ -79,7 +79,7 @@ static ssize_t port_attr_show(struct kobject *kobj,
> return port_attr->show(p, port_attr, buf);
> }
>
> -static struct sysfs_ops port_sysfs_ops = {
> +static const struct sysfs_ops port_sysfs_ops = {
> .show = port_attr_show
> };
>
> diff --git a/drivers/md/dm-sysfs.c b/drivers/md/dm-sysfs.c
> index 4b04590..13a77b2 100644
> --- a/drivers/md/dm-sysfs.c
> +++ b/drivers/md/dm-sysfs.c
> @@ -75,7 +75,7 @@ static struct attribute *dm_attrs[] = {
> NULL,
> };
>
> -static struct sysfs_ops dm_sysfs_ops = {
> +static const struct sysfs_ops dm_sysfs_ops = {
> .show = dm_attr_show,
> };
>
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index b182f86..431d54d 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -2505,7 +2505,7 @@ static void rdev_free(struct kobject *ko)
> mdk_rdev_t *rdev = container_of(ko, mdk_rdev_t, kobj);
> kfree(rdev);
> }
> -static struct sysfs_ops rdev_sysfs_ops = {
> +static const struct sysfs_ops rdev_sysfs_ops = {
> .show = rdev_attr_show,
> .store = rdev_attr_store,
> };
> @@ -3875,7 +3875,7 @@ static void md_free(struct kobject *ko)
> kfree(mddev);
> }
>
> -static struct sysfs_ops md_sysfs_ops = {
> +static const struct sysfs_ops md_sysfs_ops = {
> .show = md_attr_show,
> .store = md_attr_store,
> };
> diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
> index 5862282..7cce8cb 100644
> --- a/drivers/net/ibmveth.c
> +++ b/drivers/net/ibmveth.c
> @@ -1577,7 +1577,7 @@ static struct attribute * veth_pool_attrs[] = {
> NULL,
> };
>
> -static struct sysfs_ops veth_pool_ops = {
> +static const struct sysfs_ops veth_pool_ops = {
> .show = veth_pool_show,
> .store = veth_pool_store,
> };
> diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
> index aa7286b..a61394f 100644
> --- a/drivers/net/iseries_veth.c
> +++ b/drivers/net/iseries_veth.c
> @@ -384,7 +384,7 @@ static struct attribute *veth_cnx_default_attrs[] = {
> NULL
> };
>
> -static struct sysfs_ops veth_cnx_sysfs_ops = {
> +static const struct sysfs_ops veth_cnx_sysfs_ops = {
> .show = veth_cnx_attribute_show
> };
>
> @@ -441,7 +441,7 @@ static struct attribute *veth_port_default_attrs[] = {
> NULL
> };
>
> -static struct sysfs_ops veth_port_sysfs_ops = {
> +static const struct sysfs_ops veth_port_sysfs_ops = {
> .show = veth_port_attribute_show
> };
>
> diff --git a/drivers/parisc/pdc_stable.c b/drivers/parisc/pdc_stable.c
> index 13a64bc..ad62835 100644
> --- a/drivers/parisc/pdc_stable.c
> +++ b/drivers/parisc/pdc_stable.c
> @@ -481,7 +481,7 @@ pdcspath_attr_store(struct kobject *kobj, struct attribute *attr,
> return ret;
> }
>
> -static struct sysfs_ops pdcspath_attr_ops = {
> +static const struct sysfs_ops pdcspath_attr_ops = {
> .show = pdcspath_attr_show,
> .store = pdcspath_attr_store,
> };
> diff --git a/drivers/pci/hotplug/fakephp.c b/drivers/pci/hotplug/fakephp.c
> index 6151389..0a894ef 100644
> --- a/drivers/pci/hotplug/fakephp.c
> +++ b/drivers/pci/hotplug/fakephp.c
> @@ -73,7 +73,7 @@ static void legacy_release(struct kobject *kobj)
> }
>
> static struct kobj_type legacy_ktype = {
> - .sysfs_ops = &(struct sysfs_ops){
> + .sysfs_ops = &(const struct sysfs_ops){
> .store = legacy_store, .show = legacy_show
> },
> .release = &legacy_release,
> diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c
> index 8c02b6c..5584d8e 100644
> --- a/drivers/pci/slot.c
> +++ b/drivers/pci/slot.c
> @@ -29,7 +29,7 @@ static ssize_t pci_slot_attr_store(struct kobject *kobj,
> return attribute->store ? attribute->store(slot, buf, len) : -EIO;
> }
>
> -static struct sysfs_ops pci_slot_sysfs_ops = {
> +static const struct sysfs_ops pci_slot_sysfs_ops = {
> .show = pci_slot_attr_show,
> .store = pci_slot_attr_store,
> };
> diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
> index e941367..4de382a 100644
> --- a/drivers/uio/uio.c
> +++ b/drivers/uio/uio.c
> @@ -129,7 +129,7 @@ static ssize_t map_type_show(struct kobject *kobj, struct attribute *attr,
> return entry->show(mem, buf);
> }
>
> -static struct sysfs_ops map_sysfs_ops = {
> +static const struct sysfs_ops map_sysfs_ops = {
> .show = map_type_show,
> };
>
> @@ -217,7 +217,7 @@ static ssize_t portio_type_show(struct kobject *kobj, struct attribute *attr,
> return entry->show(port, buf);
> }
>
> -static struct sysfs_ops portio_sysfs_ops = {
> +static const struct sysfs_ops portio_sysfs_ops = {
> .show = portio_type_show,
> };
>
> diff --git a/drivers/uwb/wlp/sysfs.c b/drivers/uwb/wlp/sysfs.c
> index 0370399..6627c94 100644
> --- a/drivers/uwb/wlp/sysfs.c
> +++ b/drivers/uwb/wlp/sysfs.c
> @@ -615,8 +615,7 @@ ssize_t wlp_wss_attr_store(struct kobject *kobj, struct attribute *attr,
> return ret;
> }
>
> -static
> -struct sysfs_ops wss_sysfs_ops = {
> +static const struct sysfs_ops wss_sysfs_ops = {
> .show = wlp_wss_attr_show,
> .store = wlp_wss_attr_store,
> };
> diff --git a/drivers/xen/sys-hypervisor.c b/drivers/xen/sys-hypervisor.c
> index 88a60e0..6783cc2 100644
> --- a/drivers/xen/sys-hypervisor.c
> +++ b/drivers/xen/sys-hypervisor.c
> @@ -425,7 +425,7 @@ static ssize_t hyp_sysfs_store(struct kobject *kobj,
> return 0;
> }
>
> -static struct sysfs_ops hyp_sysfs_ops = {
> +static const struct sysfs_ops hyp_sysfs_ops = {
> .show = hyp_sysfs_show,
> .store = hyp_sysfs_store,
> };
> diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
> index a240b6f..4ce16ef 100644
> --- a/fs/btrfs/sysfs.c
> +++ b/fs/btrfs/sysfs.c
> @@ -164,12 +164,12 @@ static void btrfs_root_release(struct kobject *kobj)
> complete(&root->kobj_unregister);
> }
>
> -static struct sysfs_ops btrfs_super_attr_ops = {
> +static const struct sysfs_ops btrfs_super_attr_ops = {
> .show = btrfs_super_attr_show,
> .store = btrfs_super_attr_store,
> };
>
> -static struct sysfs_ops btrfs_root_attr_ops = {
> +static const struct sysfs_ops btrfs_root_attr_ops = {
> .show = btrfs_root_attr_show,
> .store = btrfs_root_attr_store,
> };
> diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
> index d489fcc..5b0bd1e 100644
> --- a/fs/dlm/lockspace.c
> +++ b/fs/dlm/lockspace.c
> @@ -148,7 +148,7 @@ static void lockspace_kobj_release(struct kobject *k)
> kfree(ls);
> }
>
> -static struct sysfs_ops dlm_attr_ops = {
> +static const struct sysfs_ops dlm_attr_ops = {
> .show = dlm_attr_show,
> .store = dlm_attr_store,
> };
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index d4ca92a..b0594f3 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -2251,7 +2251,7 @@ static void ext4_sb_release(struct kobject *kobj)
> }
>
>
> -static struct sysfs_ops ext4_attr_ops = {
> +static const struct sysfs_ops ext4_attr_ops = {
> .show = ext4_attr_show,
> .store = ext4_attr_store,
> };
> diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
> index 4463297..cc946e8 100644
> --- a/fs/gfs2/sys.c
> +++ b/fs/gfs2/sys.c
> @@ -49,7 +49,7 @@ static ssize_t gfs2_attr_store(struct kobject *kobj, struct attribute *attr,
> return a->store ? a->store(sdp, buf, len) : len;
> }
>
> -static struct sysfs_ops gfs2_attr_ops = {
> +static const struct sysfs_ops gfs2_attr_ops = {
> .show = gfs2_attr_show,
> .store = gfs2_attr_store,
> };
> diff --git a/fs/ocfs2/cluster/masklog.c b/fs/ocfs2/cluster/masklog.c
> index 1cd2934..880b5d2 100644
> --- a/fs/ocfs2/cluster/masklog.c
> +++ b/fs/ocfs2/cluster/masklog.c
> @@ -135,7 +135,7 @@ static ssize_t mlog_store(struct kobject *obj, struct attribute *attr,
> return mlog_mask_store(mlog_attr->mask, buf, count);
> }
>
> -static struct sysfs_ops mlog_attr_ops = {
> +static const struct sysfs_ops mlog_attr_ops = {
> .show = mlog_show,
> .store = mlog_store,
> };
> diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
> index f5ea468..b59b2e4 100644
> --- a/fs/sysfs/file.c
> +++ b/fs/sysfs/file.c
> @@ -53,7 +53,7 @@ struct sysfs_buffer {
> size_t count;
> loff_t pos;
> char * page;
> - struct sysfs_ops * ops;
> + const struct sysfs_ops * ops;
> struct mutex mutex;
> int needs_read_fill;
> int event;
> @@ -75,7 +75,7 @@ static int fill_read_buffer(struct dentry * dentry, struct sysfs_buffer * buffer
> {
> struct sysfs_dirent *attr_sd = dentry->d_fsdata;
> struct kobject *kobj = attr_sd->s_parent->s_dir.kobj;
> - struct sysfs_ops * ops = buffer->ops;
> + const struct sysfs_ops * ops = buffer->ops;
> int ret = 0;
> ssize_t count;
>
> @@ -199,7 +199,7 @@ flush_write_buffer(struct dentry * dentry, struct sysfs_buffer * buffer, size_t
> {
> struct sysfs_dirent *attr_sd = dentry->d_fsdata;
> struct kobject *kobj = attr_sd->s_parent->s_dir.kobj;
> - struct sysfs_ops * ops = buffer->ops;
> + const struct sysfs_ops * ops = buffer->ops;
> int rc;
>
> /* need attr_sd for attr and ops, its parent for kobj */
> @@ -335,7 +335,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
> struct sysfs_dirent *attr_sd = file->f_path.dentry->d_fsdata;
> struct kobject *kobj = attr_sd->s_parent->s_dir.kobj;
> struct sysfs_buffer *buffer;
> - struct sysfs_ops *ops;
> + const struct sysfs_ops *ops;
> int error = -EACCES;
> char *p;
>
> diff --git a/include/linux/kobject.h b/include/linux/kobject.h
> index 58ae8e0..072cee4 100644
> --- a/include/linux/kobject.h
> +++ b/include/linux/kobject.h
> @@ -106,7 +106,7 @@ extern char *kobject_get_path(struct kobject *kobj, gfp_t flag);
>
> struct kobj_type {
> void (*release)(struct kobject *kobj);
> - struct sysfs_ops *sysfs_ops;
> + const struct sysfs_ops *sysfs_ops;
> struct attribute **default_attrs;
> };
>
> @@ -132,7 +132,7 @@ struct kobj_attribute {
> const char *buf, size_t count);
> };
>
> -extern struct sysfs_ops kobj_sysfs_ops;
> +extern const struct sysfs_ops kobj_sysfs_ops;
>
> /**
> * struct kset - a set of kobjects of a specific type, belonging to a specific subsystem.
> diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
> index 9d68fed..71f02cc 100644
> --- a/include/linux/sysfs.h
> +++ b/include/linux/sysfs.h
> @@ -75,8 +75,8 @@ struct bin_attribute {
> };
>
> struct sysfs_ops {
> - ssize_t (*show)(struct kobject *, struct attribute *,char *);
> - ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
> + ssize_t (* const show)(struct kobject *, struct attribute *,char *);
> + ssize_t (* const store)(struct kobject *,struct attribute *,const char *, size_t);
> };
>
> struct sysfs_dirent;
> diff --git a/kernel/params.c b/kernel/params.c
> index d656c27..8b060d0 100644
> --- a/kernel/params.c
> +++ b/kernel/params.c
> @@ -725,7 +725,7 @@ static ssize_t module_attr_store(struct kobject *kobj,
> return ret;
> }
>
> -static struct sysfs_ops module_sysfs_ops = {
> +static const struct sysfs_ops module_sysfs_ops = {
> .show = module_attr_show,
> .store = module_attr_store,
> };
> diff --git a/lib/kobject.c b/lib/kobject.c
> index b512b74..6567393 100644
> --- a/lib/kobject.c
> +++ b/lib/kobject.c
> @@ -700,7 +700,7 @@ static ssize_t kobj_attr_store(struct kobject *kobj, struct attribute *attr,
> return ret;
> }
>
> -struct sysfs_ops kobj_sysfs_ops = {
> +const struct sysfs_ops kobj_sysfs_ops = {
> .show = kobj_attr_show,
> .store = kobj_attr_store,
> };
> diff --git a/mm/slub.c b/mm/slub.c
> index 4996fc7..7c047ba 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -4503,7 +4503,7 @@ static void kmem_cache_release(struct kobject *kobj)
> kfree(s);
> }
>
> -static struct sysfs_ops slab_sysfs_ops = {
> +static const struct sysfs_ops slab_sysfs_ops = {
> .show = slab_attr_show,
> .store = slab_attr_store,
> };
> diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
> index 2114e45..c53bdd9 100644
> --- a/net/bridge/br_private.h
> +++ b/net/bridge/br_private.h
> @@ -254,7 +254,7 @@ extern void br_ifinfo_notify(int event, struct net_bridge_port *port);
>
> #ifdef CONFIG_SYSFS
> /* br_sysfs_if.c */
> -extern struct sysfs_ops brport_sysfs_ops;
> +extern const struct sysfs_ops brport_sysfs_ops;
> extern int br_sysfs_addif(struct net_bridge_port *p);
>
> /* br_sysfs_br.c */
> diff --git a/net/bridge/br_sysfs_if.c b/net/bridge/br_sysfs_if.c
> index 820643a..ce77fb3 100644
> --- a/net/bridge/br_sysfs_if.c
> +++ b/net/bridge/br_sysfs_if.c
> @@ -220,7 +220,7 @@ static ssize_t brport_store(struct kobject * kobj,
> return ret;
> }
>
> -struct sysfs_ops brport_sysfs_ops = {
> +const struct sysfs_ops brport_sysfs_ops = {
> .show = brport_show,
> .store = brport_store,
> };
> diff --git a/samples/kobject/kset-example.c b/samples/kobject/kset-example.c
> index 45b7d56..19e828c 100644
> --- a/samples/kobject/kset-example.c
> +++ b/samples/kobject/kset-example.c
> @@ -87,7 +87,7 @@ static ssize_t foo_attr_store(struct kobject *kobj,
> }
>
> /* Our custom sysfs_ops that we will associate with our ktype later on */
> -static struct sysfs_ops foo_sysfs_ops = {
> +static const struct sysfs_ops foo_sysfs_ops = {
> .show = foo_attr_show,
> .store = foo_attr_store,
> };
>
>
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 22/31] Constify struct neigh_ops for 2.6.32 v1
[not found] ` <4B198FA1.7090807@gmail.com>
@ 2009-12-04 23:02 ` Emese Revfy
2009-12-04 23:19 ` David Miller
2009-12-05 0:02 ` Emese Revfy
1 sibling, 1 reply; 28+ messages in thread
From: Emese Revfy @ 2009-12-04 23:02 UTC (permalink / raw)
To: davem, torvalds, linux-kernel, netdev
Added netdev@vger.kernel.org to CC.
> From: Emese Revfy <re.emese@gmail.com>
>
> Constify struct neigh_ops.
>
> Signed-off-by: Emese Revfy <re.emese@gmail.com>
> ---
> include/net/neighbour.h | 12 ++++++------
> 1 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/include/net/neighbour.h b/include/net/neighbour.h
> index 3817fda..2c61d38 100644
> --- a/include/net/neighbour.h
> +++ b/include/net/neighbour.h
> @@ -125,12 +125,12 @@ struct neighbour
> struct neigh_ops
> {
> int family;
> - void (*solicit)(struct neighbour *, struct sk_buff*);
> - void (*error_report)(struct neighbour *, struct sk_buff*);
> - int (*output)(struct sk_buff*);
> - int (*connected_output)(struct sk_buff*);
> - int (*hh_output)(struct sk_buff*);
> - int (*queue_xmit)(struct sk_buff*);
> + void (* const solicit)(struct neighbour *, struct sk_buff*);
> + void (* const error_report)(struct neighbour *, struct sk_buff*);
> + int (* const output)(struct sk_buff*);
> + int (* const connected_output)(struct sk_buff*);
> + int (* const hh_output)(struct sk_buff*);
> + int (* const queue_xmit)(struct sk_buff*);
> };
>
> struct pneigh_entry
>
>
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 15/31] Constify struct iwl_ops for 2.6.32 v1
[not found] ` <4B198DA7.1080809@gmail.com>
@ 2009-12-04 23:05 ` Emese Revfy
2009-12-05 0:02 ` Emese Revfy
1 sibling, 0 replies; 28+ messages in thread
From: Emese Revfy @ 2009-12-04 23:05 UTC (permalink / raw)
To: yi.zhu, reinette.chatre, ilw, linville, torvalds, linux-kernel,
netdev, davem
Added netdev@vger.kernel.org and davem@davemloft.net to CC.
> From: Emese Revfy <re.emese@gmail.com>
>
> Constify struct iwl_ops.
>
> Signed-off-by: Emese Revfy <re.emese@gmail.com>
> ---
> drivers/net/wireless/iwlwifi/iwl-1000.c | 2 +-
> drivers/net/wireless/iwlwifi/iwl-3945.c | 2 +-
> drivers/net/wireless/iwlwifi/iwl-4965.c | 2 +-
> drivers/net/wireless/iwlwifi/iwl-5000.c | 4 ++--
> drivers/net/wireless/iwlwifi/iwl-6000.c | 2 +-
> drivers/net/wireless/iwlwifi/iwl-dev.h | 2 +-
> 6 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c
> index 950267a..80d5fd2 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-1000.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-1000.c
> @@ -137,7 +137,7 @@ static struct iwl_lib_ops iwl1000_lib = {
> },
> };
>
> -static struct iwl_ops iwl1000_ops = {
> +static const struct iwl_ops iwl1000_ops = {
> .ucode = &iwl5000_ucode,
> .lib = &iwl1000_lib,
> .hcmd = &iwl5000_hcmd,
> diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
> index f059b49..fe90e0a 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-3945.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
> @@ -2876,7 +2876,7 @@ static struct iwl_hcmd_utils_ops iwl3945_hcmd_utils = {
> .build_addsta_hcmd = iwl3945_build_addsta_hcmd,
> };
>
> -static struct iwl_ops iwl3945_ops = {
> +static const struct iwl_ops iwl3945_ops = {
> .ucode = &iwl3945_ucode,
> .lib = &iwl3945_lib,
> .hcmd = &iwl3945_hcmd,
> diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
> index 6f703a0..b7c4e48 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-4965.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
> @@ -2335,7 +2335,7 @@ static struct iwl_lib_ops iwl4965_lib = {
> },
> };
>
> -static struct iwl_ops iwl4965_ops = {
> +static const struct iwl_ops iwl4965_ops = {
> .ucode = &iwl4965_ucode,
> .lib = &iwl4965_lib,
> .hcmd = &iwl4965_hcmd,
> diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
> index 6e6f516..0ec1f24 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-5000.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
> @@ -1627,14 +1627,14 @@ static struct iwl_lib_ops iwl5150_lib = {
> },
> };
>
> -struct iwl_ops iwl5000_ops = {
> +const struct iwl_ops iwl5000_ops = {
> .ucode = &iwl5000_ucode,
> .lib = &iwl5000_lib,
> .hcmd = &iwl5000_hcmd,
> .utils = &iwl5000_hcmd_utils,
> };
>
> -static struct iwl_ops iwl5150_ops = {
> +static const struct iwl_ops iwl5150_ops = {
> .ucode = &iwl5000_ucode,
> .lib = &iwl5150_lib,
> .hcmd = &iwl5000_hcmd,
> diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
> index 1473452..f07d5e1 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-6000.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
> @@ -146,7 +146,7 @@ static struct iwl_hcmd_utils_ops iwl6000_hcmd_utils = {
> .calc_rssi = iwl5000_calc_rssi,
> };
>
> -static struct iwl_ops iwl6000_ops = {
> +static const struct iwl_ops iwl6000_ops = {
> .ucode = &iwl5000_ucode,
> .lib = &iwl6000_lib,
> .hcmd = &iwl5000_hcmd,
> diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
> index 028d505..0c927e5 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-dev.h
> +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
> @@ -67,7 +67,7 @@ struct iwl_tx_queue;
>
> /* shared structures from iwl-5000.c */
> extern struct iwl_mod_params iwl50_mod_params;
> -extern struct iwl_ops iwl5000_ops;
> +extern const struct iwl_ops iwl5000_ops;
> extern struct iwl_ucode_ops iwl5000_ucode;
> extern struct iwl_lib_ops iwl5000_lib;
> extern struct iwl_hcmd_ops iwl5000_hcmd;
>
>
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 22/31] Constify struct neigh_ops for 2.6.32 v1
2009-12-04 23:02 ` [PATCH 22/31] Constify struct neigh_ops " Emese Revfy
@ 2009-12-04 23:19 ` David Miller
0 siblings, 0 replies; 28+ messages in thread
From: David Miller @ 2009-12-04 23:19 UTC (permalink / raw)
To: re.emese; +Cc: torvalds, linux-kernel, netdev
From: Emese Revfy <re.emese@gmail.com>
Date: Sat, 05 Dec 2009 00:02:48 +0100
> Added netdev@vger.kernel.org to CC.
It is better to make the proper patch posting again to
netdev, otherwise your patch will not get tracked and
watched over at patchwork.ozlabs.org
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 22/31] Constify struct neigh_ops for 2.6.32 v1
[not found] ` <4B198FA1.7090807@gmail.com>
2009-12-04 23:02 ` [PATCH 22/31] Constify struct neigh_ops " Emese Revfy
@ 2009-12-05 0:02 ` Emese Revfy
1 sibling, 0 replies; 28+ messages in thread
From: Emese Revfy @ 2009-12-05 0:02 UTC (permalink / raw)
To: davem, torvalds, linux-kernel, netdev
From: Emese Revfy <re.emese@gmail.com>
Constify struct neigh_ops.
Per Dave Miller's suggestion, resend with proper CC list and patch format.
Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
include/net/neighbour.h | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 3817fda..2c61d38 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -125,12 +125,12 @@ struct neighbour
struct neigh_ops
{
int family;
- void (*solicit)(struct neighbour *, struct sk_buff*);
- void (*error_report)(struct neighbour *, struct sk_buff*);
- int (*output)(struct sk_buff*);
- int (*connected_output)(struct sk_buff*);
- int (*hh_output)(struct sk_buff*);
- int (*queue_xmit)(struct sk_buff*);
+ void (* const solicit)(struct neighbour *, struct sk_buff*);
+ void (* const error_report)(struct neighbour *, struct sk_buff*);
+ int (* const output)(struct sk_buff*);
+ int (* const connected_output)(struct sk_buff*);
+ int (* const hh_output)(struct sk_buff*);
+ int (* const queue_xmit)(struct sk_buff*);
};
struct pneigh_entry
^ permalink raw reply related [flat|nested] 28+ messages in thread
* Re: [PATCH 15/31] Constify struct iwl_ops for 2.6.32 v1
[not found] ` <4B198DA7.1080809@gmail.com>
2009-12-04 23:05 ` [PATCH 15/31] Constify struct iwl_ops " Emese Revfy
@ 2009-12-05 0:02 ` Emese Revfy
1 sibling, 0 replies; 28+ messages in thread
From: Emese Revfy @ 2009-12-05 0:02 UTC (permalink / raw)
To: yi.zhu, reinette.chatre, ilw, linville, torvalds, linux-kernel,
netdev, davem
From: Emese Revfy <re.emese@gmail.com>
Constify struct iwl_ops.
Per Dave Miller's suggestion, resend with proper CC list and patch format.
Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
drivers/net/wireless/iwlwifi/iwl-1000.c | 2 +-
drivers/net/wireless/iwlwifi/iwl-3945.c | 2 +-
drivers/net/wireless/iwlwifi/iwl-4965.c | 2 +-
drivers/net/wireless/iwlwifi/iwl-5000.c | 4 ++--
drivers/net/wireless/iwlwifi/iwl-6000.c | 2 +-
drivers/net/wireless/iwlwifi/iwl-dev.h | 2 +-
6 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c
index 950267a..80d5fd2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-1000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-1000.c
@@ -137,7 +137,7 @@ static struct iwl_lib_ops iwl1000_lib = {
},
};
-static struct iwl_ops iwl1000_ops = {
+static const struct iwl_ops iwl1000_ops = {
.ucode = &iwl5000_ucode,
.lib = &iwl1000_lib,
.hcmd = &iwl5000_hcmd,
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index f059b49..fe90e0a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -2876,7 +2876,7 @@ static struct iwl_hcmd_utils_ops iwl3945_hcmd_utils = {
.build_addsta_hcmd = iwl3945_build_addsta_hcmd,
};
-static struct iwl_ops iwl3945_ops = {
+static const struct iwl_ops iwl3945_ops = {
.ucode = &iwl3945_ucode,
.lib = &iwl3945_lib,
.hcmd = &iwl3945_hcmd,
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 6f703a0..b7c4e48 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -2335,7 +2335,7 @@ static struct iwl_lib_ops iwl4965_lib = {
},
};
-static struct iwl_ops iwl4965_ops = {
+static const struct iwl_ops iwl4965_ops = {
.ucode = &iwl4965_ucode,
.lib = &iwl4965_lib,
.hcmd = &iwl4965_hcmd,
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 6e6f516..0ec1f24 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -1627,14 +1627,14 @@ static struct iwl_lib_ops iwl5150_lib = {
},
};
-struct iwl_ops iwl5000_ops = {
+const struct iwl_ops iwl5000_ops = {
.ucode = &iwl5000_ucode,
.lib = &iwl5000_lib,
.hcmd = &iwl5000_hcmd,
.utils = &iwl5000_hcmd_utils,
};
-static struct iwl_ops iwl5150_ops = {
+static const struct iwl_ops iwl5150_ops = {
.ucode = &iwl5000_ucode,
.lib = &iwl5150_lib,
.hcmd = &iwl5000_hcmd,
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 1473452..f07d5e1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -146,7 +146,7 @@ static struct iwl_hcmd_utils_ops iwl6000_hcmd_utils = {
.calc_rssi = iwl5000_calc_rssi,
};
-static struct iwl_ops iwl6000_ops = {
+static const struct iwl_ops iwl6000_ops = {
.ucode = &iwl5000_ucode,
.lib = &iwl6000_lib,
.hcmd = &iwl5000_hcmd,
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 028d505..0c927e5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -67,7 +67,7 @@ struct iwl_tx_queue;
/* shared structures from iwl-5000.c */
extern struct iwl_mod_params iwl50_mod_params;
-extern struct iwl_ops iwl5000_ops;
+extern const struct iwl_ops iwl5000_ops;
extern struct iwl_ucode_ops iwl5000_ucode;
extern struct iwl_lib_ops iwl5000_lib;
extern struct iwl_hcmd_ops iwl5000_hcmd;
^ permalink raw reply related [flat|nested] 28+ messages in thread
* Re: [PATCH 08/31] Constify struct e1000_phy_operations for 2.6.32 v1
[not found] ` <4B198AE3.2040003@gmail.com>
2009-12-04 22:40 ` [PATCH 08/31] Constify struct e1000_phy_operations " Waskiewicz Jr, Peter P
@ 2009-12-05 0:03 ` Emese Revfy
1 sibling, 0 replies; 28+ messages in thread
From: Emese Revfy @ 2009-12-05 0:03 UTC (permalink / raw)
To: jeffrey.t.kirsher, jesse.brandeburg, bruce.w.allan,
peter.p.waskiewicz.jr, john.ronciak, torvalds, linux-kernel@
From: Emese Revfy <re.emese@gmail.com>
Constify struct e1000_phy_operations.
Per Dave Miller's suggestion, resend with proper CC list and patch format.
Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
drivers/net/e1000e/82571.c | 6 +++---
drivers/net/e1000e/e1000.h | 2 +-
drivers/net/e1000e/es2lan.c | 2 +-
drivers/net/e1000e/ich8lan.c | 2 +-
drivers/net/igb/e1000_82575.c | 2 +-
drivers/net/igb/e1000_hw.h | 2 +-
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
index d1e0563..9457254 100644
--- a/drivers/net/e1000e/82571.c
+++ b/drivers/net/e1000e/82571.c
@@ -1674,7 +1674,7 @@ static struct e1000_mac_operations e82571_mac_ops = {
.setup_led = e1000e_setup_led_generic,
};
-static struct e1000_phy_operations e82_phy_ops_igp = {
+static const struct e1000_phy_operations e82_phy_ops_igp = {
.acquire_phy = e1000_get_hw_semaphore_82571,
.check_reset_block = e1000e_check_reset_block_generic,
.commit_phy = NULL,
@@ -1691,7 +1691,7 @@ static struct e1000_phy_operations e82_phy_ops_igp = {
.cfg_on_link_up = NULL,
};
-static struct e1000_phy_operations e82_phy_ops_m88 = {
+static const struct e1000_phy_operations e82_phy_ops_m88 = {
.acquire_phy = e1000_get_hw_semaphore_82571,
.check_reset_block = e1000e_check_reset_block_generic,
.commit_phy = e1000e_phy_sw_reset,
@@ -1708,7 +1708,7 @@ static struct e1000_phy_operations e82_phy_ops_m88 = {
.cfg_on_link_up = NULL,
};
-static struct e1000_phy_operations e82_phy_ops_bm = {
+static const struct e1000_phy_operations e82_phy_ops_bm = {
.acquire_phy = e1000_get_hw_semaphore_82571,
.check_reset_block = e1000e_check_reset_block_generic,
.commit_phy = e1000e_phy_sw_reset,
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
index 3e187b0..7744c27 100644
--- a/drivers/net/e1000e/e1000.h
+++ b/drivers/net/e1000e/e1000.h
@@ -376,7 +376,7 @@ struct e1000_info {
u32 max_hw_frame_size;
s32 (*get_variants)(struct e1000_adapter *);
struct e1000_mac_operations *mac_ops;
- struct e1000_phy_operations *phy_ops;
+ const struct e1000_phy_operations *phy_ops;
struct e1000_nvm_operations *nvm_ops;
};
diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
index ae5d736..631c037 100644
--- a/drivers/net/e1000e/es2lan.c
+++ b/drivers/net/e1000e/es2lan.c
@@ -1383,7 +1383,7 @@ static struct e1000_mac_operations es2_mac_ops = {
.setup_led = e1000e_setup_led_generic,
};
-static struct e1000_phy_operations es2_phy_ops = {
+static const struct e1000_phy_operations es2_phy_ops = {
.acquire_phy = e1000_acquire_phy_80003es2lan,
.check_reset_block = e1000e_check_reset_block_generic,
.commit_phy = e1000e_phy_sw_reset,
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
index eff3f47..ca9d830 100644
--- a/drivers/net/e1000e/ich8lan.c
+++ b/drivers/net/e1000e/ich8lan.c
@@ -3469,7 +3469,7 @@ static struct e1000_mac_operations ich8_mac_ops = {
/* id_led_init dependent on mac type */
};
-static struct e1000_phy_operations ich8_phy_ops = {
+static const struct e1000_phy_operations ich8_phy_ops = {
.acquire_phy = e1000_acquire_swflag_ich8lan,
.check_reset_block = e1000_check_reset_block_ich8lan,
.commit_phy = NULL,
diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
index f8f5772..a3e64ae 100644
--- a/drivers/net/igb/e1000_82575.c
+++ b/drivers/net/igb/e1000_82575.c
@@ -1409,7 +1409,7 @@ static struct e1000_mac_operations e1000_mac_ops_82575 = {
.get_speed_and_duplex = igb_get_speed_and_duplex_copper,
};
-static struct e1000_phy_operations e1000_phy_ops_82575 = {
+static const struct e1000_phy_operations e1000_phy_ops_82575 = {
.acquire = igb_acquire_phy_82575,
.get_cfg_done = igb_get_cfg_done_82575,
.release = igb_release_phy_82575,
diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
index 119869b..326e0e7 100644
--- a/drivers/net/igb/e1000_hw.h
+++ b/drivers/net/igb/e1000_hw.h
@@ -311,7 +311,7 @@ struct e1000_nvm_operations {
struct e1000_info {
s32 (*get_invariants)(struct e1000_hw *);
struct e1000_mac_operations *mac_ops;
- struct e1000_phy_operations *phy_ops;
+ const struct e1000_phy_operations *phy_ops;
struct e1000_nvm_operations *nvm_ops;
};
^ permalink raw reply related [flat|nested] 28+ messages in thread
* Re: [PATCH 07/31] Constify struct e1000_nvm_operations for 2.6.32 v1
[not found] ` <4B198A7E.4080407@gmail.com>
2009-12-04 22:40 ` [PATCH 07/31] Constify struct e1000_nvm_operations for 2.6.32 v1 Waskiewicz Jr, Peter P
@ 2009-12-05 0:03 ` Emese Revfy
1 sibling, 0 replies; 28+ messages in thread
From: Emese Revfy @ 2009-12-05 0:03 UTC (permalink / raw)
To: jeffrey.t.kirsher, jesse.brandeburg, bruce.w.allan,
peter.p.waskiewicz.jr, john.ronciak, torvalds, linux-kernel@
From: Emese Revfy <re.emese@gmail.com>
Constify struct e1000_nvm_operations.
Per Dave Miller's suggestion, resend with proper CC list and patch format.
Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
drivers/net/e1000e/82571.c | 2 +-
drivers/net/e1000e/e1000.h | 2 +-
drivers/net/e1000e/es2lan.c | 2 +-
drivers/net/e1000e/hw.h | 16 ++++++++--------
drivers/net/e1000e/ich8lan.c | 2 +-
drivers/net/igb/e1000_82575.c | 2 +-
drivers/net/igb/e1000_hw.h | 12 ++++++------
7 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
index d1e0563..2a2355f 100644
--- a/drivers/net/e1000e/82571.c
+++ b/drivers/net/e1000e/82571.c
@@ -1725,7 +1725,7 @@ static struct e1000_phy_operations e82_phy_ops_bm = {
.cfg_on_link_up = NULL,
};
-static struct e1000_nvm_operations e82571_nvm_ops = {
+static const struct e1000_nvm_operations e82571_nvm_ops = {
.acquire_nvm = e1000_acquire_nvm_82571,
.read_nvm = e1000e_read_nvm_eerd,
.release_nvm = e1000_release_nvm_82571,
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
index 3e187b0..bcdcfb1 100644
--- a/drivers/net/e1000e/e1000.h
+++ b/drivers/net/e1000e/e1000.h
@@ -377,7 +377,7 @@ struct e1000_info {
s32 (*get_variants)(struct e1000_adapter *);
struct e1000_mac_operations *mac_ops;
struct e1000_phy_operations *phy_ops;
- struct e1000_nvm_operations *nvm_ops;
+ const struct e1000_nvm_operations *nvm_ops;
};
/* hardware capability, feature, and workaround flags */
diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
index ae5d736..a980900 100644
--- a/drivers/net/e1000e/es2lan.c
+++ b/drivers/net/e1000e/es2lan.c
@@ -1400,7 +1400,7 @@ static struct e1000_phy_operations es2_phy_ops = {
.cfg_on_link_up = e1000_cfg_on_link_up_80003es2lan,
};
-static struct e1000_nvm_operations es2_nvm_ops = {
+static const struct e1000_nvm_operations es2_nvm_ops = {
.acquire_nvm = e1000_acquire_nvm_80003es2lan,
.read_nvm = e1000e_read_nvm_eerd,
.release_nvm = e1000_release_nvm_80003es2lan,
diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
index aaea41e..f7f181f 100644
--- a/drivers/net/e1000e/hw.h
+++ b/drivers/net/e1000e/hw.h
@@ -776,13 +776,13 @@ struct e1000_phy_operations {
/* Function pointers for the NVM. */
struct e1000_nvm_operations {
- s32 (*acquire_nvm)(struct e1000_hw *);
- s32 (*read_nvm)(struct e1000_hw *, u16, u16, u16 *);
- void (*release_nvm)(struct e1000_hw *);
- s32 (*update_nvm)(struct e1000_hw *);
- s32 (*valid_led_default)(struct e1000_hw *, u16 *);
- s32 (*validate_nvm)(struct e1000_hw *);
- s32 (*write_nvm)(struct e1000_hw *, u16, u16, u16 *);
+ s32 (* const acquire_nvm)(struct e1000_hw *);
+ s32 (* const read_nvm)(struct e1000_hw *, u16, u16, u16 *);
+ void (* const release_nvm)(struct e1000_hw *);
+ s32 (* const update_nvm)(struct e1000_hw *);
+ s32 (* const valid_led_default)(struct e1000_hw *, u16 *);
+ s32 (* const validate_nvm)(struct e1000_hw *);
+ s32 (* const write_nvm)(struct e1000_hw *, u16, u16, u16 *);
};
struct e1000_mac_info {
@@ -856,7 +856,7 @@ struct e1000_phy_info {
};
struct e1000_nvm_info {
- struct e1000_nvm_operations ops;
+ const struct e1000_nvm_operations ops;
enum e1000_nvm_type type;
enum e1000_nvm_override override;
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
index eff3f47..8835afa 100644
--- a/drivers/net/e1000e/ich8lan.c
+++ b/drivers/net/e1000e/ich8lan.c
@@ -3485,7 +3485,7 @@ static struct e1000_phy_operations ich8_phy_ops = {
.write_phy_reg = e1000e_write_phy_reg_igp,
};
-static struct e1000_nvm_operations ich8_nvm_ops = {
+static const struct e1000_nvm_operations ich8_nvm_ops = {
.acquire_nvm = e1000_acquire_nvm_ich8lan,
.read_nvm = e1000_read_nvm_ich8lan,
.release_nvm = e1000_release_nvm_ich8lan,
diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
index f8f5772..f62d4e1 100644
--- a/drivers/net/igb/e1000_82575.c
+++ b/drivers/net/igb/e1000_82575.c
@@ -1415,7 +1415,7 @@ static struct e1000_phy_operations e1000_phy_ops_82575 = {
.release = igb_release_phy_82575,
};
-static struct e1000_nvm_operations e1000_nvm_ops_82575 = {
+static const struct e1000_nvm_operations e1000_nvm_ops_82575 = {
.acquire = igb_acquire_nvm_82575,
.read = igb_read_nvm_eerd,
.release = igb_release_nvm_82575,
diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
index 119869b..c31e6b2 100644
--- a/drivers/net/igb/e1000_hw.h
+++ b/drivers/net/igb/e1000_hw.h
@@ -302,17 +302,17 @@ struct e1000_phy_operations {
};
struct e1000_nvm_operations {
- s32 (*acquire)(struct e1000_hw *);
- s32 (*read)(struct e1000_hw *, u16, u16, u16 *);
- void (*release)(struct e1000_hw *);
- s32 (*write)(struct e1000_hw *, u16, u16, u16 *);
+ s32 (* const acquire)(struct e1000_hw *);
+ s32 (* const read)(struct e1000_hw *, u16, u16, u16 *);
+ void (* const release)(struct e1000_hw *);
+ s32 (* const write)(struct e1000_hw *, u16, u16, u16 *);
};
struct e1000_info {
s32 (*get_invariants)(struct e1000_hw *);
struct e1000_mac_operations *mac_ops;
struct e1000_phy_operations *phy_ops;
- struct e1000_nvm_operations *nvm_ops;
+ const struct e1000_nvm_operations *nvm_ops;
};
extern const struct e1000_info e1000_82575_info;
@@ -397,7 +397,7 @@ struct e1000_phy_info {
};
struct e1000_nvm_info {
- struct e1000_nvm_operations ops;
+ const struct e1000_nvm_operations ops;
enum e1000_nvm_type type;
enum e1000_nvm_override override;
^ permalink raw reply related [flat|nested] 28+ messages in thread
* Re: [PATCH 06/31] Constify struct e1000_mac_operations for 2.6.32 v1
[not found] ` <4B198A33.7080705@gmail.com>
2009-12-04 22:39 ` [PATCH 06/31] Constify struct e1000_mac_operations " Waskiewicz Jr, Peter P
@ 2009-12-05 0:03 ` Emese Revfy
[not found] ` <4B19A337.6060808@gmail.com>
2 siblings, 0 replies; 28+ messages in thread
From: Emese Revfy @ 2009-12-05 0:03 UTC (permalink / raw)
To: jeffrey.t.kirsher, jesse.brandeburg, bruce.w.allan,
peter.p.waskiewicz.jr, john.ronciak, torvalds, linux-kernel@
From: Emese Revfy <re.emese@gmail.com>
Constify struct e1000_mac_operations with some exceptions.
Per Dave Miller's suggestion, resend with proper CC list and patch format.
Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
drivers/net/e1000e/82571.c | 3 ++-
drivers/net/e1000e/e1000.h | 2 +-
drivers/net/e1000e/es2lan.c | 3 ++-
drivers/net/e1000e/ich8lan.c | 2 +-
drivers/net/igb/e1000_82575.c | 2 +-
drivers/net/igb/e1000_hw.h | 2 +-
6 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
index d1e0563..16ffb11 100644
--- a/drivers/net/e1000e/82571.c
+++ b/drivers/net/e1000e/82571.c
@@ -212,6 +212,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
{
struct e1000_hw *hw = &adapter->hw;
struct e1000_mac_info *mac = &hw->mac;
+ /* cannot be const */
struct e1000_mac_operations *func = &mac->ops;
u32 swsm = 0;
u32 swsm2 = 0;
@@ -1656,7 +1657,7 @@ static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw)
temp = er32(ICRXDMTC);
}
-static struct e1000_mac_operations e82571_mac_ops = {
+static const struct e1000_mac_operations e82571_mac_ops = {
/* .check_mng_mode: mac type dependent */
/* .check_for_link: media type dependent */
.id_led_init = e1000e_id_led_init,
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
index 3e187b0..933f5da 100644
--- a/drivers/net/e1000e/e1000.h
+++ b/drivers/net/e1000e/e1000.h
@@ -375,7 +375,7 @@ struct e1000_info {
u32 pba;
u32 max_hw_frame_size;
s32 (*get_variants)(struct e1000_adapter *);
- struct e1000_mac_operations *mac_ops;
+ const struct e1000_mac_operations *mac_ops;
struct e1000_phy_operations *phy_ops;
struct e1000_nvm_operations *nvm_ops;
};
diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
index ae5d736..06d47e0 100644
--- a/drivers/net/e1000e/es2lan.c
+++ b/drivers/net/e1000e/es2lan.c
@@ -207,6 +207,7 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter)
{
struct e1000_hw *hw = &adapter->hw;
struct e1000_mac_info *mac = &hw->mac;
+ /* cannot be const */
struct e1000_mac_operations *func = &mac->ops;
/* Set media type */
@@ -1365,7 +1366,7 @@ static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw)
temp = er32(ICRXDMTC);
}
-static struct e1000_mac_operations es2_mac_ops = {
+static const struct e1000_mac_operations es2_mac_ops = {
.id_led_init = e1000e_id_led_init,
.check_mng_mode = e1000e_check_mng_mode_generic,
/* check_for_link dependent on media type */
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
index eff3f47..3e0065b 100644
--- a/drivers/net/e1000e/ich8lan.c
+++ b/drivers/net/e1000e/ich8lan.c
@@ -3451,7 +3451,7 @@ static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw)
}
}
-static struct e1000_mac_operations ich8_mac_ops = {
+static const struct e1000_mac_operations ich8_mac_ops = {
.id_led_init = e1000e_id_led_init,
.check_mng_mode = e1000_check_mng_mode_ich8lan,
.check_for_link = e1000_check_for_copper_link_ich8lan,
diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
index f8f5772..3d5794f 100644
--- a/drivers/net/igb/e1000_82575.c
+++ b/drivers/net/igb/e1000_82575.c
@@ -1400,7 +1400,7 @@ void igb_vmdq_set_replication_pf(struct e1000_hw *hw, bool enable)
wr32(E1000_VT_CTL, vt_ctl);
}
-static struct e1000_mac_operations e1000_mac_ops_82575 = {
+static const struct e1000_mac_operations e1000_mac_ops_82575 = {
.reset_hw = igb_reset_hw_82575,
.init_hw = igb_init_hw_82575,
.check_for_link = igb_check_for_link_82575,
diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
index 119869b..d58b7e5 100644
--- a/drivers/net/igb/e1000_hw.h
+++ b/drivers/net/igb/e1000_hw.h
@@ -310,7 +310,7 @@ struct e1000_nvm_operations {
struct e1000_info {
s32 (*get_invariants)(struct e1000_hw *);
- struct e1000_mac_operations *mac_ops;
+ const struct e1000_mac_operations *mac_ops;
struct e1000_phy_operations *phy_ops;
struct e1000_nvm_operations *nvm_ops;
};
^ permalink raw reply related [flat|nested] 28+ messages in thread
* Re: [PATCH 29/31] Constify struct sysfs_ops for 2.6.32 v1
[not found] ` <4B1991E2.5010903@gmail.com>
2009-12-04 23:00 ` [PATCH 29/31] Constify struct sysfs_ops " Emese Revfy
@ 2009-12-05 0:03 ` Emese Revfy
2009-12-05 21:15 ` Jens Axboe
2009-12-07 9:53 ` Hans J. Koch
1 sibling, 2 replies; 28+ messages in thread
From: Emese Revfy @ 2009-12-05 0:03 UTC (permalink / raw)
To: tony.luck, fenghua.yu, benh, lethal, tglx, mingo, hpa, axboe,
gregkh, petero2
From: Emese Revfy <re.emese@gmail.com>
Constify struct sysfs_ops.
Per Dave Miller's suggestion, resend with proper CC list and patch format.
Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
arch/ia64/kernel/topology.c | 2 +-
arch/powerpc/kernel/cacheinfo.c | 2 +-
arch/sh/kernel/cpu/sh4/sq.c | 2 +-
arch/x86/kernel/cpu/intel_cacheinfo.c | 2 +-
arch/x86/kernel/cpu/mcheck/mce_amd.c | 2 +-
block/blk-integrity.c | 2 +-
block/blk-sysfs.c | 2 +-
block/elevator.c | 2 +-
drivers/base/bus.c | 4 ++--
drivers/base/class.c | 2 +-
drivers/base/core.c | 2 +-
drivers/base/sys.c | 4 ++--
drivers/block/pktcdvd.c | 2 +-
drivers/cpufreq/cpufreq.c | 2 +-
drivers/cpuidle/sysfs.c | 4 ++--
drivers/dma/ioat/dma.c | 2 +-
drivers/dma/ioat/dma.h | 2 +-
drivers/edac/edac_device_sysfs.c | 6 +++---
drivers/edac/edac_mc_sysfs.c | 4 ++--
drivers/edac/edac_pci_sysfs.c | 4 ++--
drivers/firmware/edd.c | 2 +-
drivers/firmware/efivars.c | 2 +-
drivers/firmware/iscsi_ibft.c | 2 +-
drivers/firmware/memmap.c | 2 +-
drivers/gpu/drm/ttm/ttm_bo.c | 2 +-
drivers/gpu/drm/ttm/ttm_memory.c | 2 +-
drivers/infiniband/core/cm.c | 2 +-
drivers/infiniband/core/sysfs.c | 2 +-
drivers/md/dm-sysfs.c | 2 +-
drivers/md/md.c | 4 ++--
drivers/net/ibmveth.c | 2 +-
drivers/net/iseries_veth.c | 4 ++--
drivers/parisc/pdc_stable.c | 2 +-
drivers/pci/hotplug/fakephp.c | 2 +-
drivers/pci/slot.c | 2 +-
drivers/uio/uio.c | 4 ++--
drivers/uwb/wlp/sysfs.c | 3 +--
drivers/xen/sys-hypervisor.c | 2 +-
fs/btrfs/sysfs.c | 4 ++--
fs/dlm/lockspace.c | 2 +-
fs/ext4/super.c | 2 +-
fs/gfs2/sys.c | 2 +-
fs/ocfs2/cluster/masklog.c | 2 +-
fs/sysfs/file.c | 8 ++++----
include/linux/kobject.h | 4 ++--
include/linux/sysfs.h | 4 ++--
kernel/params.c | 2 +-
lib/kobject.c | 2 +-
mm/slub.c | 2 +-
net/bridge/br_private.h | 2 +-
net/bridge/br_sysfs_if.c | 2 +-
samples/kobject/kset-example.c | 2 +-
52 files changed, 68 insertions(+), 69 deletions(-)
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index 8f06035..b3a5818 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -282,7 +282,7 @@ static ssize_t cache_show(struct kobject * kobj, struct attribute * attr, char *
return ret;
}
-static struct sysfs_ops cache_sysfs_ops = {
+static const struct sysfs_ops cache_sysfs_ops = {
.show = cache_show
};
diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c
index bb37b1d..01fe9ce 100644
--- a/arch/powerpc/kernel/cacheinfo.c
+++ b/arch/powerpc/kernel/cacheinfo.c
@@ -642,7 +642,7 @@ static struct kobj_attribute *cache_index_opt_attrs[] = {
&cache_assoc_attr,
};
-static struct sysfs_ops cache_index_ops = {
+static const struct sysfs_ops cache_index_ops = {
.show = cache_index_show,
};
diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c
index 8a8a993..7b3079b 100644
--- a/arch/sh/kernel/cpu/sh4/sq.c
+++ b/arch/sh/kernel/cpu/sh4/sq.c
@@ -327,7 +327,7 @@ static struct attribute *sq_sysfs_attrs[] = {
NULL,
};
-static struct sysfs_ops sq_sysfs_ops = {
+static const struct sysfs_ops sq_sysfs_ops = {
.show = sq_sysfs_show,
.store = sq_sysfs_store,
};
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index 804c40e..dc7f8a7 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -860,7 +860,7 @@ static ssize_t store(struct kobject *kobj, struct attribute *attr,
return ret;
}
-static struct sysfs_ops sysfs_ops = {
+static const struct sysfs_ops sysfs_ops = {
.show = show,
.store = store,
};
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
index 83a3d1f..cda932c 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -388,7 +388,7 @@ static ssize_t store(struct kobject *kobj, struct attribute *attr,
return ret;
}
-static struct sysfs_ops threshold_ops = {
+static const struct sysfs_ops threshold_ops = {
.show = show,
.store = store,
};
diff --git a/block/blk-integrity.c b/block/blk-integrity.c
index 15c6308..96e83c2 100644
--- a/block/blk-integrity.c
+++ b/block/blk-integrity.c
@@ -278,7 +278,7 @@ static struct attribute *integrity_attrs[] = {
NULL,
};
-static struct sysfs_ops integrity_ops = {
+static const struct sysfs_ops integrity_ops = {
.show = &integrity_attr_show,
.store = &integrity_attr_store,
};
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 8a6d81a..dc3e40b 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -414,7 +414,7 @@ static void blk_release_queue(struct kobject *kobj)
kmem_cache_free(blk_requestq_cachep, q);
}
-static struct sysfs_ops queue_sysfs_ops = {
+static const struct sysfs_ops queue_sysfs_ops = {
.show = queue_attr_show,
.store = queue_attr_store,
};
diff --git a/block/elevator.c b/block/elevator.c
index a847046..75a1746 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -889,7 +889,7 @@ elv_attr_store(struct kobject *kobj, struct attribute *attr,
return error;
}
-static struct sysfs_ops elv_sysfs_ops = {
+static const struct sysfs_ops elv_sysfs_ops = {
.show = elv_attr_show,
.store = elv_attr_store,
};
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 63c143e..66ddfea 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -70,7 +70,7 @@ static ssize_t drv_attr_store(struct kobject *kobj, struct attribute *attr,
return ret;
}
-static struct sysfs_ops driver_sysfs_ops = {
+static const struct sysfs_ops driver_sysfs_ops = {
.show = drv_attr_show,
.store = drv_attr_store,
};
@@ -115,7 +115,7 @@ static ssize_t bus_attr_store(struct kobject *kobj, struct attribute *attr,
return ret;
}
-static struct sysfs_ops bus_sysfs_ops = {
+static const struct sysfs_ops bus_sysfs_ops = {
.show = bus_attr_show,
.store = bus_attr_store,
};
diff --git a/drivers/base/class.c b/drivers/base/class.c
index 161746d..c2359c8 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -61,7 +61,7 @@ static void class_release(struct kobject *kobj)
"be careful\n", class->name);
}
-static struct sysfs_ops class_sysfs_ops = {
+static const struct sysfs_ops class_sysfs_ops = {
.show = class_attr_show,
.store = class_attr_store,
};
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 6bee6af..35aeae5 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -93,7 +93,7 @@ static ssize_t dev_attr_store(struct kobject *kobj, struct attribute *attr,
return ret;
}
-static struct sysfs_ops dev_sysfs_ops = {
+static const struct sysfs_ops dev_sysfs_ops = {
.show = dev_attr_show,
.store = dev_attr_store,
};
diff --git a/drivers/base/sys.c b/drivers/base/sys.c
index 0d90390..dd710ca 100644
--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -54,7 +54,7 @@ sysdev_store(struct kobject *kobj, struct attribute *attr,
return -EIO;
}
-static struct sysfs_ops sysfs_ops = {
+static const struct sysfs_ops sysfs_ops = {
.show = sysdev_show,
.store = sysdev_store,
};
@@ -104,7 +104,7 @@ static ssize_t sysdev_class_store(struct kobject *kobj, struct attribute *attr,
return -EIO;
}
-static struct sysfs_ops sysfs_class_ops = {
+static const struct sysfs_ops sysfs_class_ops = {
.show = sysdev_class_show,
.store = sysdev_class_store,
};
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 2ddf03a..44eab68 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -284,7 +284,7 @@ static ssize_t kobj_pkt_store(struct kobject *kobj,
return len;
}
-static struct sysfs_ops kobj_pkt_ops = {
+static const struct sysfs_ops kobj_pkt_ops = {
.show = kobj_pkt_show,
.store = kobj_pkt_store
};
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index ff57c40..76da29f 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -750,7 +750,7 @@ static void cpufreq_sysfs_release(struct kobject *kobj)
complete(&policy->kobj_unregister);
}
-static struct sysfs_ops sysfs_ops = {
+static const struct sysfs_ops sysfs_ops = {
.show = show,
.store = store,
};
diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
index 97b0038..aaaa360 100644
--- a/drivers/cpuidle/sysfs.c
+++ b/drivers/cpuidle/sysfs.c
@@ -191,7 +191,7 @@ static ssize_t cpuidle_store(struct kobject * kobj, struct attribute * attr,
return ret;
}
-static struct sysfs_ops cpuidle_sysfs_ops = {
+static const struct sysfs_ops cpuidle_sysfs_ops = {
.show = cpuidle_show,
.store = cpuidle_store,
};
@@ -277,7 +277,7 @@ static ssize_t cpuidle_state_show(struct kobject * kobj,
return ret;
}
-static struct sysfs_ops cpuidle_state_sysfs_ops = {
+static const struct sysfs_ops cpuidle_state_sysfs_ops = {
.show = cpuidle_state_show,
};
diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c
index c524d36..fc2d0b6 100644
--- a/drivers/dma/ioat/dma.c
+++ b/drivers/dma/ioat/dma.c
@@ -1146,7 +1146,7 @@ ioat_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
return entry->show(&chan->common, page);
}
-struct sysfs_ops ioat_sysfs_ops = {
+const struct sysfs_ops ioat_sysfs_ops = {
.show = ioat_attr_show,
};
diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h
index 45edde9..c72e7fe 100644
--- a/drivers/dma/ioat/dma.h
+++ b/drivers/dma/ioat/dma.h
@@ -329,7 +329,7 @@ bool ioat_cleanup_preamble(struct ioat_chan_common *chan,
unsigned long *phys_complete);
void ioat_kobject_add(struct ioatdma_device *device, struct kobj_type *type);
void ioat_kobject_del(struct ioatdma_device *device);
-extern struct sysfs_ops ioat_sysfs_ops;
+extern const struct sysfs_ops ioat_sysfs_ops;
extern struct ioat_sysfs_entry ioat_version_attr;
extern struct ioat_sysfs_entry ioat_cap_attr;
#endif /* IOATDMA_H */
diff --git a/drivers/edac/edac_device_sysfs.c b/drivers/edac/edac_device_sysfs.c
index 5376457..5fdedbc 100644
--- a/drivers/edac/edac_device_sysfs.c
+++ b/drivers/edac/edac_device_sysfs.c
@@ -137,7 +137,7 @@ static ssize_t edac_dev_ctl_info_store(struct kobject *kobj,
}
/* edac_dev file operations for an 'ctl_info' */
-static struct sysfs_ops device_ctl_info_ops = {
+static const struct sysfs_ops device_ctl_info_ops = {
.show = edac_dev_ctl_info_show,
.store = edac_dev_ctl_info_store
};
@@ -373,7 +373,7 @@ static ssize_t edac_dev_instance_store(struct kobject *kobj,
}
/* edac_dev file operations for an 'instance' */
-static struct sysfs_ops device_instance_ops = {
+static const struct sysfs_ops device_instance_ops = {
.show = edac_dev_instance_show,
.store = edac_dev_instance_store
};
@@ -476,7 +476,7 @@ static ssize_t edac_dev_block_store(struct kobject *kobj,
}
/* edac_dev file operations for a 'block' */
-static struct sysfs_ops device_block_ops = {
+static const struct sysfs_ops device_block_ops = {
.show = edac_dev_block_show,
.store = edac_dev_block_store
};
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index e1d4ce0..88840e9 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -245,7 +245,7 @@ static ssize_t csrowdev_store(struct kobject *kobj, struct attribute *attr,
return -EIO;
}
-static struct sysfs_ops csrowfs_ops = {
+static const struct sysfs_ops csrowfs_ops = {
.show = csrowdev_show,
.store = csrowdev_store
};
@@ -575,7 +575,7 @@ static ssize_t mcidev_store(struct kobject *kobj, struct attribute *attr,
}
/* Intermediate show/store table */
-static struct sysfs_ops mci_ops = {
+static const struct sysfs_ops mci_ops = {
.show = mcidev_show,
.store = mcidev_store
};
diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c
index 422728c..79217da 100644
--- a/drivers/edac/edac_pci_sysfs.c
+++ b/drivers/edac/edac_pci_sysfs.c
@@ -121,7 +121,7 @@ static ssize_t edac_pci_instance_store(struct kobject *kobj,
}
/* fs_ops table */
-static struct sysfs_ops pci_instance_ops = {
+static const struct sysfs_ops pci_instance_ops = {
.show = edac_pci_instance_show,
.store = edac_pci_instance_store
};
@@ -261,7 +261,7 @@ static ssize_t edac_pci_dev_store(struct kobject *kobj,
return -EIO;
}
-static struct sysfs_ops edac_pci_sysfs_ops = {
+static const struct sysfs_ops edac_pci_sysfs_ops = {
.show = edac_pci_dev_show,
.store = edac_pci_dev_store
};
diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c
index 9e4f59d..110e24e 100644
--- a/drivers/firmware/edd.c
+++ b/drivers/firmware/edd.c
@@ -122,7 +122,7 @@ edd_attr_show(struct kobject * kobj, struct attribute *attr, char *buf)
return ret;
}
-static struct sysfs_ops edd_attr_ops = {
+static const struct sysfs_ops edd_attr_ops = {
.show = edd_attr_show,
};
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index f4f709d..082f06e 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -362,7 +362,7 @@ static ssize_t efivar_attr_store(struct kobject *kobj, struct attribute *attr,
return ret;
}
-static struct sysfs_ops efivar_attr_ops = {
+static const struct sysfs_ops efivar_attr_ops = {
.show = efivar_attr_show,
.store = efivar_attr_store,
};
diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index 051d1eb..0a5d4e7 100644
--- a/drivers/firmware/iscsi_ibft.c
+++ b/drivers/firmware/iscsi_ibft.c
@@ -525,7 +525,7 @@ static ssize_t ibft_show_attribute(struct kobject *kobj,
return ret;
}
-static struct sysfs_ops ibft_attr_ops = {
+static const struct sysfs_ops ibft_attr_ops = {
.show = ibft_show_attribute,
};
diff --git a/drivers/firmware/memmap.c b/drivers/firmware/memmap.c
index 56f9234..8c58c7b 100644
--- a/drivers/firmware/memmap.c
+++ b/drivers/firmware/memmap.c
@@ -74,7 +74,7 @@ static struct attribute *def_attrs[] = {
NULL
};
-static struct sysfs_ops memmap_attr_ops = {
+static const struct sysfs_ops memmap_attr_ops = {
.show = memmap_attr_show,
};
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 87c0625..d9a23ef 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -67,7 +67,7 @@ static struct attribute *ttm_bo_global_attrs[] = {
NULL
};
-static struct sysfs_ops ttm_bo_global_ops = {
+static const struct sysfs_ops ttm_bo_global_ops = {
.show = &ttm_bo_global_show
};
diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c
index 072c281..d8ef483 100644
--- a/drivers/gpu/drm/ttm/ttm_memory.c
+++ b/drivers/gpu/drm/ttm/ttm_memory.c
@@ -152,7 +152,7 @@ static struct attribute *ttm_mem_zone_attrs[] = {
NULL
};
-static struct sysfs_ops ttm_mem_zone_ops = {
+static const struct sysfs_ops ttm_mem_zone_ops = {
.show = &ttm_mem_zone_show,
.store = &ttm_mem_zone_store
};
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 5130fc5..764787e 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -3597,7 +3597,7 @@ static ssize_t cm_show_counter(struct kobject *obj, struct attribute *attr,
atomic_long_read(&group->counter[cm_attr->index]));
}
-static struct sysfs_ops cm_counter_ops = {
+static const struct sysfs_ops cm_counter_ops = {
.show = cm_show_counter
};
diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
index 158a214..1558bb7 100644
--- a/drivers/infiniband/core/sysfs.c
+++ b/drivers/infiniband/core/sysfs.c
@@ -79,7 +79,7 @@ static ssize_t port_attr_show(struct kobject *kobj,
return port_attr->show(p, port_attr, buf);
}
-static struct sysfs_ops port_sysfs_ops = {
+static const struct sysfs_ops port_sysfs_ops = {
.show = port_attr_show
};
diff --git a/drivers/md/dm-sysfs.c b/drivers/md/dm-sysfs.c
index 4b04590..13a77b2 100644
--- a/drivers/md/dm-sysfs.c
+++ b/drivers/md/dm-sysfs.c
@@ -75,7 +75,7 @@ static struct attribute *dm_attrs[] = {
NULL,
};
-static struct sysfs_ops dm_sysfs_ops = {
+static const struct sysfs_ops dm_sysfs_ops = {
.show = dm_attr_show,
};
diff --git a/drivers/md/md.c b/drivers/md/md.c
index b182f86..431d54d 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2505,7 +2505,7 @@ static void rdev_free(struct kobject *ko)
mdk_rdev_t *rdev = container_of(ko, mdk_rdev_t, kobj);
kfree(rdev);
}
-static struct sysfs_ops rdev_sysfs_ops = {
+static const struct sysfs_ops rdev_sysfs_ops = {
.show = rdev_attr_show,
.store = rdev_attr_store,
};
@@ -3875,7 +3875,7 @@ static void md_free(struct kobject *ko)
kfree(mddev);
}
-static struct sysfs_ops md_sysfs_ops = {
+static const struct sysfs_ops md_sysfs_ops = {
.show = md_attr_show,
.store = md_attr_store,
};
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index 5862282..7cce8cb 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -1577,7 +1577,7 @@ static struct attribute * veth_pool_attrs[] = {
NULL,
};
-static struct sysfs_ops veth_pool_ops = {
+static const struct sysfs_ops veth_pool_ops = {
.show = veth_pool_show,
.store = veth_pool_store,
};
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
index aa7286b..a61394f 100644
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -384,7 +384,7 @@ static struct attribute *veth_cnx_default_attrs[] = {
NULL
};
-static struct sysfs_ops veth_cnx_sysfs_ops = {
+static const struct sysfs_ops veth_cnx_sysfs_ops = {
.show = veth_cnx_attribute_show
};
@@ -441,7 +441,7 @@ static struct attribute *veth_port_default_attrs[] = {
NULL
};
-static struct sysfs_ops veth_port_sysfs_ops = {
+static const struct sysfs_ops veth_port_sysfs_ops = {
.show = veth_port_attribute_show
};
diff --git a/drivers/parisc/pdc_stable.c b/drivers/parisc/pdc_stable.c
index 13a64bc..ad62835 100644
--- a/drivers/parisc/pdc_stable.c
+++ b/drivers/parisc/pdc_stable.c
@@ -481,7 +481,7 @@ pdcspath_attr_store(struct kobject *kobj, struct attribute *attr,
return ret;
}
-static struct sysfs_ops pdcspath_attr_ops = {
+static const struct sysfs_ops pdcspath_attr_ops = {
.show = pdcspath_attr_show,
.store = pdcspath_attr_store,
};
diff --git a/drivers/pci/hotplug/fakephp.c b/drivers/pci/hotplug/fakephp.c
index 6151389..0a894ef 100644
--- a/drivers/pci/hotplug/fakephp.c
+++ b/drivers/pci/hotplug/fakephp.c
@@ -73,7 +73,7 @@ static void legacy_release(struct kobject *kobj)
}
static struct kobj_type legacy_ktype = {
- .sysfs_ops = &(struct sysfs_ops){
+ .sysfs_ops = &(const struct sysfs_ops){
.store = legacy_store, .show = legacy_show
},
.release = &legacy_release,
diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c
index 8c02b6c..5584d8e 100644
--- a/drivers/pci/slot.c
+++ b/drivers/pci/slot.c
@@ -29,7 +29,7 @@ static ssize_t pci_slot_attr_store(struct kobject *kobj,
return attribute->store ? attribute->store(slot, buf, len) : -EIO;
}
-static struct sysfs_ops pci_slot_sysfs_ops = {
+static const struct sysfs_ops pci_slot_sysfs_ops = {
.show = pci_slot_attr_show,
.store = pci_slot_attr_store,
};
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index e941367..4de382a 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -129,7 +129,7 @@ static ssize_t map_type_show(struct kobject *kobj, struct attribute *attr,
return entry->show(mem, buf);
}
-static struct sysfs_ops map_sysfs_ops = {
+static const struct sysfs_ops map_sysfs_ops = {
.show = map_type_show,
};
@@ -217,7 +217,7 @@ static ssize_t portio_type_show(struct kobject *kobj, struct attribute *attr,
return entry->show(port, buf);
}
-static struct sysfs_ops portio_sysfs_ops = {
+static const struct sysfs_ops portio_sysfs_ops = {
.show = portio_type_show,
};
diff --git a/drivers/uwb/wlp/sysfs.c b/drivers/uwb/wlp/sysfs.c
index 0370399..6627c94 100644
--- a/drivers/uwb/wlp/sysfs.c
+++ b/drivers/uwb/wlp/sysfs.c
@@ -615,8 +615,7 @@ ssize_t wlp_wss_attr_store(struct kobject *kobj, struct attribute *attr,
return ret;
}
-static
-struct sysfs_ops wss_sysfs_ops = {
+static const struct sysfs_ops wss_sysfs_ops = {
.show = wlp_wss_attr_show,
.store = wlp_wss_attr_store,
};
diff --git a/drivers/xen/sys-hypervisor.c b/drivers/xen/sys-hypervisor.c
index 88a60e0..6783cc2 100644
--- a/drivers/xen/sys-hypervisor.c
+++ b/drivers/xen/sys-hypervisor.c
@@ -425,7 +425,7 @@ static ssize_t hyp_sysfs_store(struct kobject *kobj,
return 0;
}
-static struct sysfs_ops hyp_sysfs_ops = {
+static const struct sysfs_ops hyp_sysfs_ops = {
.show = hyp_sysfs_show,
.store = hyp_sysfs_store,
};
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index a240b6f..4ce16ef 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -164,12 +164,12 @@ static void btrfs_root_release(struct kobject *kobj)
complete(&root->kobj_unregister);
}
-static struct sysfs_ops btrfs_super_attr_ops = {
+static const struct sysfs_ops btrfs_super_attr_ops = {
.show = btrfs_super_attr_show,
.store = btrfs_super_attr_store,
};
-static struct sysfs_ops btrfs_root_attr_ops = {
+static const struct sysfs_ops btrfs_root_attr_ops = {
.show = btrfs_root_attr_show,
.store = btrfs_root_attr_store,
};
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index d489fcc..5b0bd1e 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -148,7 +148,7 @@ static void lockspace_kobj_release(struct kobject *k)
kfree(ls);
}
-static struct sysfs_ops dlm_attr_ops = {
+static const struct sysfs_ops dlm_attr_ops = {
.show = dlm_attr_show,
.store = dlm_attr_store,
};
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index d4ca92a..b0594f3 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2251,7 +2251,7 @@ static void ext4_sb_release(struct kobject *kobj)
}
-static struct sysfs_ops ext4_attr_ops = {
+static const struct sysfs_ops ext4_attr_ops = {
.show = ext4_attr_show,
.store = ext4_attr_store,
};
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
index 4463297..cc946e8 100644
--- a/fs/gfs2/sys.c
+++ b/fs/gfs2/sys.c
@@ -49,7 +49,7 @@ static ssize_t gfs2_attr_store(struct kobject *kobj, struct attribute *attr,
return a->store ? a->store(sdp, buf, len) : len;
}
-static struct sysfs_ops gfs2_attr_ops = {
+static const struct sysfs_ops gfs2_attr_ops = {
.show = gfs2_attr_show,
.store = gfs2_attr_store,
};
diff --git a/fs/ocfs2/cluster/masklog.c b/fs/ocfs2/cluster/masklog.c
index 1cd2934..880b5d2 100644
--- a/fs/ocfs2/cluster/masklog.c
+++ b/fs/ocfs2/cluster/masklog.c
@@ -135,7 +135,7 @@ static ssize_t mlog_store(struct kobject *obj, struct attribute *attr,
return mlog_mask_store(mlog_attr->mask, buf, count);
}
-static struct sysfs_ops mlog_attr_ops = {
+static const struct sysfs_ops mlog_attr_ops = {
.show = mlog_show,
.store = mlog_store,
};
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index f5ea468..b59b2e4 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -53,7 +53,7 @@ struct sysfs_buffer {
size_t count;
loff_t pos;
char * page;
- struct sysfs_ops * ops;
+ const struct sysfs_ops * ops;
struct mutex mutex;
int needs_read_fill;
int event;
@@ -75,7 +75,7 @@ static int fill_read_buffer(struct dentry * dentry, struct sysfs_buffer * buffer
{
struct sysfs_dirent *attr_sd = dentry->d_fsdata;
struct kobject *kobj = attr_sd->s_parent->s_dir.kobj;
- struct sysfs_ops * ops = buffer->ops;
+ const struct sysfs_ops * ops = buffer->ops;
int ret = 0;
ssize_t count;
@@ -199,7 +199,7 @@ flush_write_buffer(struct dentry * dentry, struct sysfs_buffer * buffer, size_t
{
struct sysfs_dirent *attr_sd = dentry->d_fsdata;
struct kobject *kobj = attr_sd->s_parent->s_dir.kobj;
- struct sysfs_ops * ops = buffer->ops;
+ const struct sysfs_ops * ops = buffer->ops;
int rc;
/* need attr_sd for attr and ops, its parent for kobj */
@@ -335,7 +335,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
struct sysfs_dirent *attr_sd = file->f_path.dentry->d_fsdata;
struct kobject *kobj = attr_sd->s_parent->s_dir.kobj;
struct sysfs_buffer *buffer;
- struct sysfs_ops *ops;
+ const struct sysfs_ops *ops;
int error = -EACCES;
char *p;
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 58ae8e0..072cee4 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -106,7 +106,7 @@ extern char *kobject_get_path(struct kobject *kobj, gfp_t flag);
struct kobj_type {
void (*release)(struct kobject *kobj);
- struct sysfs_ops *sysfs_ops;
+ const struct sysfs_ops *sysfs_ops;
struct attribute **default_attrs;
};
@@ -132,7 +132,7 @@ struct kobj_attribute {
const char *buf, size_t count);
};
-extern struct sysfs_ops kobj_sysfs_ops;
+extern const struct sysfs_ops kobj_sysfs_ops;
/**
* struct kset - a set of kobjects of a specific type, belonging to a specific subsystem.
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 9d68fed..71f02cc 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -75,8 +75,8 @@ struct bin_attribute {
};
struct sysfs_ops {
- ssize_t (*show)(struct kobject *, struct attribute *,char *);
- ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
+ ssize_t (* const show)(struct kobject *, struct attribute *,char *);
+ ssize_t (* const store)(struct kobject *,struct attribute *,const char *, size_t);
};
struct sysfs_dirent;
diff --git a/kernel/params.c b/kernel/params.c
index d656c27..8b060d0 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -725,7 +725,7 @@ static ssize_t module_attr_store(struct kobject *kobj,
return ret;
}
-static struct sysfs_ops module_sysfs_ops = {
+static const struct sysfs_ops module_sysfs_ops = {
.show = module_attr_show,
.store = module_attr_store,
};
diff --git a/lib/kobject.c b/lib/kobject.c
index b512b74..6567393 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -700,7 +700,7 @@ static ssize_t kobj_attr_store(struct kobject *kobj, struct attribute *attr,
return ret;
}
-struct sysfs_ops kobj_sysfs_ops = {
+const struct sysfs_ops kobj_sysfs_ops = {
.show = kobj_attr_show,
.store = kobj_attr_store,
};
diff --git a/mm/slub.c b/mm/slub.c
index 4996fc7..7c047ba 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4503,7 +4503,7 @@ static void kmem_cache_release(struct kobject *kobj)
kfree(s);
}
-static struct sysfs_ops slab_sysfs_ops = {
+static const struct sysfs_ops slab_sysfs_ops = {
.show = slab_attr_show,
.store = slab_attr_store,
};
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 2114e45..c53bdd9 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -254,7 +254,7 @@ extern void br_ifinfo_notify(int event, struct net_bridge_port *port);
#ifdef CONFIG_SYSFS
/* br_sysfs_if.c */
-extern struct sysfs_ops brport_sysfs_ops;
+extern const struct sysfs_ops brport_sysfs_ops;
extern int br_sysfs_addif(struct net_bridge_port *p);
/* br_sysfs_br.c */
diff --git a/net/bridge/br_sysfs_if.c b/net/bridge/br_sysfs_if.c
index 820643a..ce77fb3 100644
--- a/net/bridge/br_sysfs_if.c
+++ b/net/bridge/br_sysfs_if.c
@@ -220,7 +220,7 @@ static ssize_t brport_store(struct kobject * kobj,
return ret;
}
-struct sysfs_ops brport_sysfs_ops = {
+const struct sysfs_ops brport_sysfs_ops = {
.show = brport_show,
.store = brport_store,
};
diff --git a/samples/kobject/kset-example.c b/samples/kobject/kset-example.c
index 45b7d56..19e828c 100644
--- a/samples/kobject/kset-example.c
+++ b/samples/kobject/kset-example.c
@@ -87,7 +87,7 @@ static ssize_t foo_attr_store(struct kobject *kobj,
}
/* Our custom sysfs_ops that we will associate with our ktype later on */
-static struct sysfs_ops foo_sysfs_ops = {
+static const struct sysfs_ops foo_sysfs_ops = {
.show = foo_attr_show,
.store = foo_attr_store,
};
^ permalink raw reply related [flat|nested] 28+ messages in thread
* Re: [PATCH 11/31] Constify struct file_operations for 2.6.32 v1
[not found] ` <4B19A333.5080103@gmail.com>
@ 2009-12-05 0:09 ` Greg KH
2009-12-05 2:50 ` Emese Revfy
0 siblings, 1 reply; 28+ messages in thread
From: Greg KH @ 2009-12-05 0:09 UTC (permalink / raw)
To: Emese Revfy
Cc: lenb, astarikovskiy, mchehab, linville, miklos, davem, rostedt,
fweisbec, mingo, avi, mtosatti, torvalds, linux-kernel, netdev
On Sat, Dec 05, 2009 at 01:02:59AM +0100, Emese Revfy wrote:
> From: Emese Revfy <re.emese@gmail.com>
>
> Constify struct file_operations with some exceptions.
> Per Dave Miller's suggestion, resend with proper CC list and patch format.
>
> Signed-off-by: Emese Revfy <re.emese@gmail.com>
> ---
> drivers/acpi/battery.c | 2 +-
> drivers/char/pty.c | 16 +++++++++---
> drivers/char/tty_io.c | 28 ++++-----------------
> drivers/media/dvb/dvb-core/dvbdev.c | 1 +
> drivers/net/wireless/b43/debugfs.c | 2 +-
> drivers/net/wireless/b43legacy/debugfs.c | 2 +-
> drivers/net/wireless/libertas/debugfs.c | 2 +-
> drivers/staging/b3dfg/b3dfg.c | 2 +-
> drivers/staging/dream/qdsp5/adsp_driver.c | 2 +-
> drivers/staging/dream/qdsp5/audio_aac.c | 2 +-
> drivers/staging/dream/qdsp5/audio_amrnb.c | 2 +-
> drivers/staging/dream/qdsp5/audio_evrc.c | 2 +-
> drivers/staging/dream/qdsp5/audio_in.c | 4 +-
> drivers/staging/dream/qdsp5/audio_mp3.c | 2 +-
> drivers/staging/dream/qdsp5/audio_out.c | 4 +-
> drivers/staging/dream/qdsp5/audio_qcelp.c | 2 +-
> drivers/staging/dream/qdsp5/snd.c | 2 +-
> drivers/staging/dream/smd/smd_qmi.c | 2 +-
> drivers/staging/dream/smd/smd_rpcrouter_device.c | 4 +-
> drivers/staging/panel/panel.c | 4 +-
> drivers/staging/poch/poch.c | 2 +-
> drivers/staging/sep/sep_driver.c | 2 +-
> drivers/staging/vme/devices/vme_user.c | 2 +-
> fs/fuse/cuse.c | 20 +++++++++------
> fs/fuse/dev.c | 8 +++---
> fs/fuse/fuse_i.h | 10 ++++++++
> include/linux/tty.h | 14 ++++++++++-
> include/net/tcp.h | 1 +
> include/net/udp.h | 1 +
> kernel/trace/trace_events.c | 2 +
> virt/kvm/kvm_main.c | 3 ++
> 31 files changed, 89 insertions(+), 63 deletions(-)
>
> diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
> index 3f4602b..2e41d36 100644
> --- a/drivers/acpi/battery.c
> +++ b/drivers/acpi/battery.c
> @@ -763,7 +763,7 @@ DECLARE_FILE_FUNCTIONS(alarm);
> }
>
> static struct battery_file {
> - struct file_operations ops;
> + const struct file_operations ops;
> mode_t mode;
> const char *name;
> } acpi_battery_file[] = {
> diff --git a/drivers/char/pty.c b/drivers/char/pty.c
> index 62f282e..d39c67b 100644
> --- a/drivers/char/pty.c
> +++ b/drivers/char/pty.c
> @@ -682,7 +682,18 @@ static int ptmx_open(struct inode *inode, struct file *filp)
> return ret;
> }
>
> -static struct file_operations ptmx_fops;
> +static const struct file_operations ptmx_fops = {
> + .llseek = no_llseek,
> + .read = tty_read,
> + .write = tty_write,
> + .poll = tty_poll,
> + .unlocked_ioctl = tty_ioctl,
> + .compat_ioctl = tty_compat_ioctl,
> + .open = ptmx_open,
> + .release = tty_release,
> + .fasync = tty_fasync,
> +};
You just made these functions all global, for no real good reason. Why
did you do this?
confused,
greg k-h
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 06/31] Constify struct e1000_mac_operations for 2.6.32 v1
[not found] ` <4B19A337.6060808@gmail.com>
@ 2009-12-05 0:40 ` Stephen Rothwell
2009-12-05 1:18 ` Emese Revfy
0 siblings, 1 reply; 28+ messages in thread
From: Stephen Rothwell @ 2009-12-05 0:40 UTC (permalink / raw)
To: Emese Revfy
Cc: jeffrey.t.kirsher, jesse.brandeburg, bruce.w.allan,
peter.p.waskiewicz.jr, john.ronciak, torvalds, linux-kernel,
davem, netdev
[-- Attachment #1: Type: text/plain, Size: 626 bytes --]
Hi Emese,
On Sat, 05 Dec 2009 01:03:03 +0100 Emese Revfy <re.emese@gmail.com> wrote:
>
> --- a/drivers/net/e1000e/82571.c
> +++ b/drivers/net/e1000e/82571.c
> @@ -212,6 +212,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
> {
> struct e1000_hw *hw = &adapter->hw;
> struct e1000_mac_info *mac = &hw->mac;
> + /* cannot be const */
> struct e1000_mac_operations *func = &mac->ops;
Adding to the comment to say why it can't be const may allow us to fix
this later ...
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 06/31] Constify struct e1000_mac_operations for 2.6.32 v1
2009-12-05 0:40 ` Stephen Rothwell
@ 2009-12-05 1:18 ` Emese Revfy
2009-12-05 1:21 ` Jeff Kirsher
0 siblings, 1 reply; 28+ messages in thread
From: Emese Revfy @ 2009-12-05 1:18 UTC (permalink / raw)
To: Stephen Rothwell
Cc: jeffrey.t.kirsher, jesse.brandeburg, bruce.w.allan,
peter.p.waskiewicz.jr, john.ronciak, torvalds, linux-kernel,
davem, netdev
Stephen Rothwell wrote:
> Hi Emese,
>
> On Sat, 05 Dec 2009 01:03:03 +0100 Emese Revfy <re.emese@gmail.com> wrote:
>> --- a/drivers/net/e1000e/82571.c
>> +++ b/drivers/net/e1000e/82571.c
>> @@ -212,6 +212,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
>> {
>> struct e1000_hw *hw = &adapter->hw;
>> struct e1000_mac_info *mac = &hw->mac;
>> + /* cannot be const */
>> struct e1000_mac_operations *func = &mac->ops;
>
> Adding to the comment to say why it can't be const may allow us to fix
> this later ...
Ok, in the next patch series I will explain each case.
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 06/31] Constify struct e1000_mac_operations for 2.6.32 v1
2009-12-05 1:18 ` Emese Revfy
@ 2009-12-05 1:21 ` Jeff Kirsher
0 siblings, 0 replies; 28+ messages in thread
From: Jeff Kirsher @ 2009-12-05 1:21 UTC (permalink / raw)
To: Emese Revfy
Cc: Stephen Rothwell, jesse.brandeburg, bruce.w.allan,
peter.p.waskiewicz.jr, john.ronciak, torvalds, linux-kernel,
davem, netdev
2009/12/4 Emese Revfy <re.emese@gmail.com>:
> Stephen Rothwell wrote:
>> Hi Emese,
>>
>> On Sat, 05 Dec 2009 01:03:03 +0100 Emese Revfy <re.emese@gmail.com> wrote:
>>> --- a/drivers/net/e1000e/82571.c
>>> +++ b/drivers/net/e1000e/82571.c
>>> @@ -212,6 +212,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
>>> {
>>> struct e1000_hw *hw = &adapter->hw;
>>> struct e1000_mac_info *mac = &hw->mac;
>>> + /* cannot be const */
>>> struct e1000_mac_operations *func = &mac->ops;
>>
>> Adding to the comment to say why it can't be const may allow us to fix
>> this later ...
>
> Ok, in the next patch series I will explain each case.
> --
Also, please sync up your patches with what is in Dave's net-next-2.6
tree, because some of the changes made no longer apply since the code
was either changed or removed.
--
Cheers,
Jeff
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 11/31] Constify struct file_operations for 2.6.32 v1
2009-12-05 0:09 ` [PATCH 11/31] Constify struct file_operations " Greg KH
@ 2009-12-05 2:50 ` Emese Revfy
2009-12-05 4:15 ` Greg KH
0 siblings, 1 reply; 28+ messages in thread
From: Emese Revfy @ 2009-12-05 2:50 UTC (permalink / raw)
To: Greg KH
Cc: lenb, astarikovskiy, mchehab, linville, miklos, davem, rostedt,
fweisbec, mingo, avi, mtosatti, torvalds, linux-kernel, netdev
Greg KH wrote:
> On Sat, Dec 05, 2009 at 01:02:59AM +0100, Emese Revfy wrote:
>> From: Emese Revfy <re.emese@gmail.com>
>>
>> Constify struct file_operations with some exceptions.
>> Per Dave Miller's suggestion, resend with proper CC list and patch format.
>>
>> Signed-off-by: Emese Revfy <re.emese@gmail.com>
>> ---
>> drivers/acpi/battery.c | 2 +-
>> drivers/char/pty.c | 16 +++++++++---
>> drivers/char/tty_io.c | 28 ++++-----------------
>> drivers/media/dvb/dvb-core/dvbdev.c | 1 +
>> drivers/net/wireless/b43/debugfs.c | 2 +-
>> drivers/net/wireless/b43legacy/debugfs.c | 2 +-
>> drivers/net/wireless/libertas/debugfs.c | 2 +-
>> drivers/staging/b3dfg/b3dfg.c | 2 +-
>> drivers/staging/dream/qdsp5/adsp_driver.c | 2 +-
>> drivers/staging/dream/qdsp5/audio_aac.c | 2 +-
>> drivers/staging/dream/qdsp5/audio_amrnb.c | 2 +-
>> drivers/staging/dream/qdsp5/audio_evrc.c | 2 +-
>> drivers/staging/dream/qdsp5/audio_in.c | 4 +-
>> drivers/staging/dream/qdsp5/audio_mp3.c | 2 +-
>> drivers/staging/dream/qdsp5/audio_out.c | 4 +-
>> drivers/staging/dream/qdsp5/audio_qcelp.c | 2 +-
>> drivers/staging/dream/qdsp5/snd.c | 2 +-
>> drivers/staging/dream/smd/smd_qmi.c | 2 +-
>> drivers/staging/dream/smd/smd_rpcrouter_device.c | 4 +-
>> drivers/staging/panel/panel.c | 4 +-
>> drivers/staging/poch/poch.c | 2 +-
>> drivers/staging/sep/sep_driver.c | 2 +-
>> drivers/staging/vme/devices/vme_user.c | 2 +-
>> fs/fuse/cuse.c | 20 +++++++++------
>> fs/fuse/dev.c | 8 +++---
>> fs/fuse/fuse_i.h | 10 ++++++++
>> include/linux/tty.h | 14 ++++++++++-
>> include/net/tcp.h | 1 +
>> include/net/udp.h | 1 +
>> kernel/trace/trace_events.c | 2 +
>> virt/kvm/kvm_main.c | 3 ++
>> 31 files changed, 89 insertions(+), 63 deletions(-)
>>
>> diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
>> index 3f4602b..2e41d36 100644
>> --- a/drivers/acpi/battery.c
>> +++ b/drivers/acpi/battery.c
>> @@ -763,7 +763,7 @@ DECLARE_FILE_FUNCTIONS(alarm);
>> }
>>
>> static struct battery_file {
>> - struct file_operations ops;
>> + const struct file_operations ops;
>> mode_t mode;
>> const char *name;
>> } acpi_battery_file[] = {
>> diff --git a/drivers/char/pty.c b/drivers/char/pty.c
>> index 62f282e..d39c67b 100644
>> --- a/drivers/char/pty.c
>> +++ b/drivers/char/pty.c
>> @@ -682,7 +682,18 @@ static int ptmx_open(struct inode *inode, struct file *filp)
>> return ret;
>> }
>>
>> -static struct file_operations ptmx_fops;
>> +static const struct file_operations ptmx_fops = {
>> + .llseek = no_llseek,
>> + .read = tty_read,
>> + .write = tty_write,
>> + .poll = tty_poll,
>> + .unlocked_ioctl = tty_ioctl,
>> + .compat_ioctl = tty_compat_ioctl,
>> + .open = ptmx_open,
>> + .release = tty_release,
>> + .fasync = tty_fasync,
>> +};
>
> You just made these functions all global, for no real good reason. Why
> did you do this?
>
> confused,
>
> greg k-h
I think this is the only way to make ptmx_fops const, provided we want to.
--
Emese
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 11/31] Constify struct file_operations for 2.6.32 v1
2009-12-05 2:50 ` Emese Revfy
@ 2009-12-05 4:15 ` Greg KH
2009-12-06 1:47 ` Emese Revfy
0 siblings, 1 reply; 28+ messages in thread
From: Greg KH @ 2009-12-05 4:15 UTC (permalink / raw)
To: Emese Revfy
Cc: lenb, astarikovskiy, mchehab, linville, miklos, davem, rostedt,
fweisbec, mingo, avi, mtosatti, torvalds, linux-kernel, netdev
On Sat, Dec 05, 2009 at 03:50:23AM +0100, Emese Revfy wrote:
> Greg KH wrote:
> > On Sat, Dec 05, 2009 at 01:02:59AM +0100, Emese Revfy wrote:
> >> -static struct file_operations ptmx_fops;
> >> +static const struct file_operations ptmx_fops = {
> >> + .llseek = no_llseek,
> >> + .read = tty_read,
> >> + .write = tty_write,
> >> + .poll = tty_poll,
> >> + .unlocked_ioctl = tty_ioctl,
> >> + .compat_ioctl = tty_compat_ioctl,
> >> + .open = ptmx_open,
> >> + .release = tty_release,
> >> + .fasync = tty_fasync,
> >> +};
> >
> > You just made these functions all global, for no real good reason. Why
> > did you do this?
>
> I think this is the only way to make ptmx_fops const, provided we want to.
Why do we want to?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 29/31] Constify struct sysfs_ops for 2.6.32 v1
2009-12-05 0:03 ` Emese Revfy
@ 2009-12-05 21:15 ` Jens Axboe
2009-12-06 8:58 ` Pekka Enberg
2009-12-07 9:53 ` Hans J. Koch
1 sibling, 1 reply; 28+ messages in thread
From: Jens Axboe @ 2009-12-05 21:15 UTC (permalink / raw)
To: Emese Revfy
Cc: tony.luck, fenghua.yu, benh, lethal, tglx, mingo, hpa, gregkh,
petero2, davej, maciej.sosnowski, dougthompson, airlied, rolandd,
sean.hefty, hal.rosenstock, neilb, rdunlap, kyle, deller, jejb,
jbarnes, hjk, david.vrabel, jeremy, chris.mason, ccaulfie,
teigland, tytso, adilger, swhiteho, mfasheh, joel.becker, rusty,
penberg, shemminger, torvalds, linux-kernel, netdev
On Sat, Dec 05 2009, Emese Revfy wrote:
> From: Emese Revfy <re.emese@gmail.com>
>
> Constify struct sysfs_ops.
> Per Dave Miller's suggestion, resend with proper CC list and patch format.
For the block parts:
Acked-by: Jens Axboe <jens.axboe@oracle.com>
--
Jens Axboe
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 11/31] Constify struct file_operations for 2.6.32 v1
2009-12-05 4:15 ` Greg KH
@ 2009-12-06 1:47 ` Emese Revfy
2009-12-06 17:25 ` Greg KH
0 siblings, 1 reply; 28+ messages in thread
From: Emese Revfy @ 2009-12-06 1:47 UTC (permalink / raw)
To: Greg KH
Cc: lenb, astarikovskiy, mchehab, linville, miklos, davem, rostedt,
fweisbec, mingo, avi, mtosatti, torvalds, linux-kernel, netdev
Greg KH wrote:
> On Sat, Dec 05, 2009 at 03:50:23AM +0100, Emese Revfy wrote:
>> Greg KH wrote:
>>> On Sat, Dec 05, 2009 at 01:02:59AM +0100, Emese Revfy wrote:
>>>> -static struct file_operations ptmx_fops;
>>>> +static const struct file_operations ptmx_fops = {
>>>> + .llseek = no_llseek,
>>>> + .read = tty_read,
>>>> + .write = tty_write,
>>>> + .poll = tty_poll,
>>>> + .unlocked_ioctl = tty_ioctl,
>>>> + .compat_ioctl = tty_compat_ioctl,
>>>> + .open = ptmx_open,
>>>> + .release = tty_release,
>>>> + .fasync = tty_fasync,
>>>> +};
>>> You just made these functions all global, for no real good reason. Why
>>> did you do this?
>> I think this is the only way to make ptmx_fops const, provided we want to.
>
> Why do we want to?
Because I saw that checkpatch.pl itself tries to ensure the same I went
through the whole tree looking for non-const file_operations structures
and tried to make them const as best as I could. If you think making
ptmx_fops const is not worth the effort I will remove it from the patch.
--
Emese
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 29/31] Constify struct sysfs_ops for 2.6.32 v1
2009-12-05 21:15 ` Jens Axboe
@ 2009-12-06 8:58 ` Pekka Enberg
0 siblings, 0 replies; 28+ messages in thread
From: Pekka Enberg @ 2009-12-06 8:58 UTC (permalink / raw)
To: Jens Axboe
Cc: Emese Revfy, tony.luck, fenghua.yu, benh, lethal, tglx, mingo,
hpa, gregkh, petero2, davej, maciej.sosnowski, dougthompson,
airlied, rolandd, sean.hefty, hal.rosenstock, neilb, rdunlap,
kyle, deller, jejb, jbarnes, hjk, david.vrabel, jeremy,
chris.mason, ccaulfie, teigland, tytso, adilger, swhiteho,
mfasheh, joel.becker, rusty, shemminger, torvalds, linux-kernel,
netdev
On Sat, 2009-12-05 at 22:15 +0100, Jens Axboe wrote:
> On Sat, Dec 05 2009, Emese Revfy wrote:
> > From: Emese Revfy <re.emese@gmail.com>
> >
> > Constify struct sysfs_ops.
> > Per Dave Miller's suggestion, resend with proper CC list and patch format.
>
> For the block parts:
>
> Acked-by: Jens Axboe <jens.axboe@oracle.com>
For the SLUB parts:
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 11/31] Constify struct file_operations for 2.6.32 v1
2009-12-06 1:47 ` Emese Revfy
@ 2009-12-06 17:25 ` Greg KH
2009-12-07 0:45 ` Emese Revfy
0 siblings, 1 reply; 28+ messages in thread
From: Greg KH @ 2009-12-06 17:25 UTC (permalink / raw)
To: Emese Revfy
Cc: lenb, astarikovskiy, mchehab, linville, miklos, davem, rostedt,
fweisbec, mingo, avi, mtosatti, torvalds, linux-kernel, netdev
On Sun, Dec 06, 2009 at 02:47:44AM +0100, Emese Revfy wrote:
> Greg KH wrote:
> > On Sat, Dec 05, 2009 at 03:50:23AM +0100, Emese Revfy wrote:
> >> Greg KH wrote:
> >>> On Sat, Dec 05, 2009 at 01:02:59AM +0100, Emese Revfy wrote:
> >>>> -static struct file_operations ptmx_fops;
> >>>> +static const struct file_operations ptmx_fops = {
> >>>> + .llseek = no_llseek,
> >>>> + .read = tty_read,
> >>>> + .write = tty_write,
> >>>> + .poll = tty_poll,
> >>>> + .unlocked_ioctl = tty_ioctl,
> >>>> + .compat_ioctl = tty_compat_ioctl,
> >>>> + .open = ptmx_open,
> >>>> + .release = tty_release,
> >>>> + .fasync = tty_fasync,
> >>>> +};
> >>> You just made these functions all global, for no real good reason. Why
> >>> did you do this?
> >> I think this is the only way to make ptmx_fops const, provided we want to.
> >
> > Why do we want to?
>
> Because I saw that checkpatch.pl itself tries to ensure the same I went
> through the whole tree looking for non-const file_operations structures
> and tried to make them const as best as I could. If you think making
> ptmx_fops const is not worth the effort I will remove it from the patch.
Based on the patch, I would think it is not worth it.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 11/31] Constify struct file_operations for 2.6.32 v1
2009-12-06 17:25 ` Greg KH
@ 2009-12-07 0:45 ` Emese Revfy
2009-12-07 15:11 ` Greg KH
0 siblings, 1 reply; 28+ messages in thread
From: Emese Revfy @ 2009-12-07 0:45 UTC (permalink / raw)
To: Greg KH
Cc: lenb, astarikovskiy, mchehab, linville, miklos, davem, rostedt,
fweisbec, mingo, avi, mtosatti, torvalds, linux-kernel, netdev
Greg KH wrote:
> On Sun, Dec 06, 2009 at 02:47:44AM +0100, Emese Revfy wrote:
>> Greg KH wrote:
>>> On Sat, Dec 05, 2009 at 03:50:23AM +0100, Emese Revfy wrote:
>>>> Greg KH wrote:
>>>>> On Sat, Dec 05, 2009 at 01:02:59AM +0100, Emese Revfy wrote:
>>>>>> -static struct file_operations ptmx_fops;
>>>>>> +static const struct file_operations ptmx_fops = {
>>>>>> + .llseek = no_llseek,
>>>>>> + .read = tty_read,
>>>>>> + .write = tty_write,
>>>>>> + .poll = tty_poll,
>>>>>> + .unlocked_ioctl = tty_ioctl,
>>>>>> + .compat_ioctl = tty_compat_ioctl,
>>>>>> + .open = ptmx_open,
>>>>>> + .release = tty_release,
>>>>>> + .fasync = tty_fasync,
>>>>>> +};
>>>>> You just made these functions all global, for no real good reason. Why
>>>>> did you do this?
>>>> I think this is the only way to make ptmx_fops const, provided we want to.
>>> Why do we want to?
>> Because I saw that checkpatch.pl itself tries to ensure the same I went
>> through the whole tree looking for non-const file_operations structures
>> and tried to make them const as best as I could. If you think making
>> ptmx_fops const is not worth the effort I will remove it from the patch.
>
> Based on the patch, I would think it is not worth it.
>
> thanks,
>
> greg k-h
>
Ok, I removed the affected hunks.
From: Emese Revfy <re.emese@gmail.com>
Constify struct file_operations with some exceptions.
Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
drivers/acpi/battery.c | 2 +-
drivers/char/pty.c | 1 +
drivers/char/tty_io.c | 1 +
drivers/media/dvb/dvb-core/dvbdev.c | 1 +
drivers/net/wireless/b43/debugfs.c | 2 +-
drivers/net/wireless/b43legacy/debugfs.c | 2 +-
drivers/net/wireless/libertas/debugfs.c | 2 +-
drivers/staging/b3dfg/b3dfg.c | 2 +-
drivers/staging/dream/qdsp5/adsp_driver.c | 2 +-
drivers/staging/dream/qdsp5/audio_aac.c | 2 +-
drivers/staging/dream/qdsp5/audio_amrnb.c | 2 +-
drivers/staging/dream/qdsp5/audio_evrc.c | 2 +-
drivers/staging/dream/qdsp5/audio_in.c | 4 ++--
drivers/staging/dream/qdsp5/audio_mp3.c | 2 +-
drivers/staging/dream/qdsp5/audio_out.c | 4 ++--
drivers/staging/dream/qdsp5/audio_qcelp.c | 2 +-
drivers/staging/dream/qdsp5/snd.c | 2 +-
drivers/staging/dream/smd/smd_qmi.c | 2 +-
drivers/staging/dream/smd/smd_rpcrouter_device.c | 4 ++--
drivers/staging/panel/panel.c | 4 ++--
drivers/staging/poch/poch.c | 2 +-
drivers/staging/sep/sep_driver.c | 2 +-
drivers/staging/vme/devices/vme_user.c | 2 +-
fs/char_dev.c | 1 +
fs/fuse/cuse.c | 19 ++++++++++++-------
fs/fuse/dev.c | 8 ++++----
fs/fuse/fuse_i.h | 10 ++++++++++
virt/kvm/kvm_main.c | 3 +++
28 files changed, 57 insertions(+), 35 deletions(-)
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 3f4602b..2e41d36 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -763,7 +763,7 @@ DECLARE_FILE_FUNCTIONS(alarm);
}
static struct battery_file {
- struct file_operations ops;
+ const struct file_operations ops;
mode_t mode;
const char *name;
} acpi_battery_file[] = {
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index 62f282e..96e29e5 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -682,6 +682,7 @@ static int ptmx_open(struct inode *inode, struct file *filp)
return ret;
}
+/* cannot be const, see unix98_pty_init */
static struct file_operations ptmx_fops;
static void __init unix98_pty_init(void)
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 59499ee..97616a9 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -3046,6 +3046,7 @@ struct tty_struct *get_current_tty(void)
}
EXPORT_SYMBOL_GPL(get_current_tty);
+/* cannot be const, see this function */
void tty_default_fops(struct file_operations *fops)
{
*fops = tty_fops;
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c
index 94159b9..9684961 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/drivers/media/dvb/dvb-core/dvbdev.c
@@ -191,6 +191,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
const struct dvb_device *template, void *priv, int type)
{
struct dvb_device *dvbdev;
+ /* cannot be const, see this function */
struct file_operations *dvbdevfops;
struct device *clsdev;
int minor;
diff --git a/drivers/net/wireless/b43/debugfs.c b/drivers/net/wireless/b43/debugfs.c
index 80b19a4..dab3a45 100644
--- a/drivers/net/wireless/b43/debugfs.c
+++ b/drivers/net/wireless/b43/debugfs.c
@@ -43,7 +43,7 @@ static struct dentry *rootdir;
struct b43_debugfs_fops {
ssize_t (*read)(struct b43_wldev *dev, char *buf, size_t bufsize);
int (*write)(struct b43_wldev *dev, const char *buf, size_t count);
- struct file_operations fops;
+ const struct file_operations fops;
/* Offset of struct b43_dfs_file in struct b43_dfsentry */
size_t file_struct_offset;
};
diff --git a/drivers/net/wireless/b43legacy/debugfs.c b/drivers/net/wireless/b43legacy/debugfs.c
index 1f85ac5..c99b4b4 100644
--- a/drivers/net/wireless/b43legacy/debugfs.c
+++ b/drivers/net/wireless/b43legacy/debugfs.c
@@ -44,7 +44,7 @@ static struct dentry *rootdir;
struct b43legacy_debugfs_fops {
ssize_t (*read)(struct b43legacy_wldev *dev, char *buf, size_t bufsize);
int (*write)(struct b43legacy_wldev *dev, const char *buf, size_t count);
- struct file_operations fops;
+ const struct file_operations fops;
/* Offset of struct b43legacy_dfs_file in struct b43legacy_dfsentry */
size_t file_struct_offset;
/* Take wl->irq_lock before calling read/write? */
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index 893a55c..7f66a50 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -708,7 +708,7 @@ out_unlock:
struct lbs_debugfs_files {
const char *name;
int perm;
- struct file_operations fops;
+ const struct file_operations fops;
};
static const struct lbs_debugfs_files debugfs_files[] = {
diff --git a/drivers/staging/b3dfg/b3dfg.c b/drivers/staging/b3dfg/b3dfg.c
index cda26bb..25f3ec6 100644
--- a/drivers/staging/b3dfg/b3dfg.c
+++ b/drivers/staging/b3dfg/b3dfg.c
@@ -848,7 +848,7 @@ static int b3dfg_mmap(struct file *filp, struct vm_area_struct *vma)
return r;
}
-static struct file_operations b3dfg_fops = {
+static const struct file_operations b3dfg_fops = {
.owner = THIS_MODULE,
.open = b3dfg_open,
.release = b3dfg_release,
diff --git a/drivers/staging/dream/qdsp5/adsp_driver.c b/drivers/staging/dream/qdsp5/adsp_driver.c
index e55a0db..577b776 100644
--- a/drivers/staging/dream/qdsp5/adsp_driver.c
+++ b/drivers/staging/dream/qdsp5/adsp_driver.c
@@ -576,7 +576,7 @@ static struct adsp_device *inode_to_device(struct inode *inode)
static dev_t adsp_devno;
static struct class *adsp_class;
-static struct file_operations adsp_fops = {
+static const struct file_operations adsp_fops = {
.owner = THIS_MODULE,
.open = adsp_open,
.unlocked_ioctl = adsp_ioctl,
diff --git a/drivers/staging/dream/qdsp5/audio_aac.c b/drivers/staging/dream/qdsp5/audio_aac.c
index ad2390f..4116ee8 100644
--- a/drivers/staging/dream/qdsp5/audio_aac.c
+++ b/drivers/staging/dream/qdsp5/audio_aac.c
@@ -1022,7 +1022,7 @@ done:
return rc;
}
-static struct file_operations audio_aac_fops = {
+static const struct file_operations audio_aac_fops = {
.owner = THIS_MODULE,
.open = audio_open,
.release = audio_release,
diff --git a/drivers/staging/dream/qdsp5/audio_amrnb.c b/drivers/staging/dream/qdsp5/audio_amrnb.c
index cd818a5..870b37b 100644
--- a/drivers/staging/dream/qdsp5/audio_amrnb.c
+++ b/drivers/staging/dream/qdsp5/audio_amrnb.c
@@ -833,7 +833,7 @@ done:
return rc;
}
-static struct file_operations audio_amrnb_fops = {
+static const struct file_operations audio_amrnb_fops = {
.owner = THIS_MODULE,
.open = audamrnb_open,
.release = audamrnb_release,
diff --git a/drivers/staging/dream/qdsp5/audio_evrc.c b/drivers/staging/dream/qdsp5/audio_evrc.c
index 4b43e18..cedafda 100644
--- a/drivers/staging/dream/qdsp5/audio_evrc.c
+++ b/drivers/staging/dream/qdsp5/audio_evrc.c
@@ -805,7 +805,7 @@ dma_fail:
return rc;
}
-static struct file_operations audio_evrc_fops = {
+static const struct file_operations audio_evrc_fops = {
.owner = THIS_MODULE,
.open = audevrc_open,
.release = audevrc_release,
diff --git a/drivers/staging/dream/qdsp5/audio_in.c b/drivers/staging/dream/qdsp5/audio_in.c
index 3d950a2..9431118 100644
--- a/drivers/staging/dream/qdsp5/audio_in.c
+++ b/drivers/staging/dream/qdsp5/audio_in.c
@@ -913,7 +913,7 @@ static int audpre_open(struct inode *inode, struct file *file)
return 0;
}
-static struct file_operations audio_fops = {
+static const struct file_operations audio_fops = {
.owner = THIS_MODULE,
.open = audio_in_open,
.release = audio_in_release,
@@ -922,7 +922,7 @@ static struct file_operations audio_fops = {
.unlocked_ioctl = audio_in_ioctl,
};
-static struct file_operations audpre_fops = {
+static const struct file_operations audpre_fops = {
.owner = THIS_MODULE,
.open = audpre_open,
.unlocked_ioctl = audpre_ioctl,
diff --git a/drivers/staging/dream/qdsp5/audio_mp3.c b/drivers/staging/dream/qdsp5/audio_mp3.c
index b95574f..286c2f4 100644
--- a/drivers/staging/dream/qdsp5/audio_mp3.c
+++ b/drivers/staging/dream/qdsp5/audio_mp3.c
@@ -941,7 +941,7 @@ done:
return rc;
}
-static struct file_operations audio_mp3_fops = {
+static const struct file_operations audio_mp3_fops = {
.owner = THIS_MODULE,
.open = audio_open,
.release = audio_release,
diff --git a/drivers/staging/dream/qdsp5/audio_out.c b/drivers/staging/dream/qdsp5/audio_out.c
index d1adcf6..f8f9833 100644
--- a/drivers/staging/dream/qdsp5/audio_out.c
+++ b/drivers/staging/dream/qdsp5/audio_out.c
@@ -810,7 +810,7 @@ static int audpp_open(struct inode *inode, struct file *file)
return 0;
}
-static struct file_operations audio_fops = {
+static const struct file_operations audio_fops = {
.owner = THIS_MODULE,
.open = audio_open,
.release = audio_release,
@@ -819,7 +819,7 @@ static struct file_operations audio_fops = {
.unlocked_ioctl = audio_ioctl,
};
-static struct file_operations audpp_fops = {
+static const struct file_operations audpp_fops = {
.owner = THIS_MODULE,
.open = audpp_open,
.unlocked_ioctl = audpp_ioctl,
diff --git a/drivers/staging/dream/qdsp5/audio_qcelp.c b/drivers/staging/dream/qdsp5/audio_qcelp.c
index f0f50e3..f6b9dbc 100644
--- a/drivers/staging/dream/qdsp5/audio_qcelp.c
+++ b/drivers/staging/dream/qdsp5/audio_qcelp.c
@@ -816,7 +816,7 @@ err:
return rc;
}
-static struct file_operations audio_qcelp_fops = {
+static const struct file_operations audio_qcelp_fops = {
.owner = THIS_MODULE,
.open = audqcelp_open,
.release = audqcelp_release,
diff --git a/drivers/staging/dream/qdsp5/snd.c b/drivers/staging/dream/qdsp5/snd.c
index 037d7ff..5469ec3 100644
--- a/drivers/staging/dream/qdsp5/snd.c
+++ b/drivers/staging/dream/qdsp5/snd.c
@@ -242,7 +242,7 @@ err:
return rc;
}
-static struct file_operations snd_fops = {
+static const struct file_operations snd_fops = {
.owner = THIS_MODULE,
.open = snd_open,
.release = snd_release,
diff --git a/drivers/staging/dream/smd/smd_qmi.c b/drivers/staging/dream/smd/smd_qmi.c
index d4e7d88..0ea632a 100644
--- a/drivers/staging/dream/smd/smd_qmi.c
+++ b/drivers/staging/dream/smd/smd_qmi.c
@@ -793,7 +793,7 @@ static int qmi_release(struct inode *ip, struct file *fp)
return 0;
}
-static struct file_operations qmi_fops = {
+static const struct file_operations qmi_fops = {
.owner = THIS_MODULE,
.read = qmi_read,
.write = qmi_write,
diff --git a/drivers/staging/dream/smd/smd_rpcrouter_device.c b/drivers/staging/dream/smd/smd_rpcrouter_device.c
index cd3910b..ff053d3 100644
--- a/drivers/staging/dream/smd/smd_rpcrouter_device.c
+++ b/drivers/staging/dream/smd/smd_rpcrouter_device.c
@@ -214,7 +214,7 @@ static long rpcrouter_ioctl(struct file *filp, unsigned int cmd,
return rc;
}
-static struct file_operations rpcrouter_server_fops = {
+static const struct file_operations rpcrouter_server_fops = {
.owner = THIS_MODULE,
.open = rpcrouter_open,
.release = rpcrouter_release,
@@ -224,7 +224,7 @@ static struct file_operations rpcrouter_server_fops = {
.unlocked_ioctl = rpcrouter_ioctl,
};
-static struct file_operations rpcrouter_router_fops = {
+static const struct file_operations rpcrouter_router_fops = {
.owner = THIS_MODULE,
.open = rpcrouter_open,
.release = rpcrouter_release,
diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index 4ce399b..225f9bc 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -1305,7 +1305,7 @@ static int lcd_release(struct inode *inode, struct file *file)
return 0;
}
-static struct file_operations lcd_fops = {
+static const struct file_operations lcd_fops = {
.write = lcd_write,
.open = lcd_open,
.release = lcd_release,
@@ -1565,7 +1565,7 @@ static int keypad_release(struct inode *inode, struct file *file)
return 0;
}
-static struct file_operations keypad_fops = {
+static const struct file_operations keypad_fops = {
.read = keypad_read, /* read */
.open = keypad_open, /* open */
.release = keypad_release, /* close */
diff --git a/drivers/staging/poch/poch.c b/drivers/staging/poch/poch.c
index 2eb8e3d..57616a7 100644
--- a/drivers/staging/poch/poch.c
+++ b/drivers/staging/poch/poch.c
@@ -1057,7 +1057,7 @@ static int poch_ioctl(struct inode *inode, struct file *filp,
return 0;
}
-static struct file_operations poch_fops = {
+static const struct file_operations poch_fops = {
.owner = THIS_MODULE,
.open = poch_open,
.release = poch_release,
diff --git a/drivers/staging/sep/sep_driver.c b/drivers/staging/sep/sep_driver.c
index f890a16..509ece8 100644
--- a/drivers/staging/sep/sep_driver.c
+++ b/drivers/staging/sep/sep_driver.c
@@ -2603,7 +2603,7 @@ static struct pci_driver sep_pci_driver = {
static dev_t sep_devno;
/* the files operations structure of the driver */
-static struct file_operations sep_file_operations = {
+static const struct file_operations sep_file_operations = {
.owner = THIS_MODULE,
.ioctl = sep_ioctl,
.poll = sep_poll,
diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index 7891288..8e31300 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -136,7 +136,7 @@ static int vme_user_ioctl(struct inode *, struct file *, unsigned int,
static int __init vme_user_probe(struct device *, int, int);
static int __exit vme_user_remove(struct device *, int, int);
-static struct file_operations vme_user_fops = {
+static const struct file_operations vme_user_fops = {
.open = vme_user_open,
.release = vme_user_release,
.read = vme_user_read,
diff --git a/fs/char_dev.c b/fs/char_dev.c
index d6db933..7b47e79 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -547,6 +547,7 @@ struct cdev *cdev_alloc(void)
* Initializes @cdev, remembering @fops, making it ready to add to the
* system with cdev_add().
*/
+
void cdev_init(struct cdev *cdev, const struct file_operations *fops)
{
memset(cdev, 0, sizeof *cdev);
diff --git a/fs/fuse/cuse.c b/fs/fuse/cuse.c
index de792dc..2115e7f 100644
--- a/fs/fuse/cuse.c
+++ b/fs/fuse/cuse.c
@@ -528,7 +528,18 @@ static int cuse_channel_release(struct inode *inode, struct file *file)
return rc;
}
-static struct file_operations cuse_channel_fops; /* initialized during init */
+static const struct file_operations cuse_channel_fops = { /* initialized during init */
+ .owner = THIS_MODULE,
+ .llseek = no_llseek,
+ .read = do_sync_read,
+ .aio_read = fuse_dev_read,
+ .write = do_sync_write,
+ .aio_write = fuse_dev_write,
+ .poll = fuse_dev_poll,
+ .open = cuse_channel_open,
+ .release = cuse_channel_release,
+ .fasync = fuse_dev_fasync,
+};
/**************************************************************************
@@ -575,12 +586,6 @@ static int __init cuse_init(void)
for (i = 0; i < CUSE_CONNTBL_LEN; i++)
INIT_LIST_HEAD(&cuse_conntbl[i]);
- /* inherit and extend fuse_dev_operations */
- cuse_channel_fops = fuse_dev_operations;
- cuse_channel_fops.owner = THIS_MODULE;
- cuse_channel_fops.open = cuse_channel_open;
- cuse_channel_fops.release = cuse_channel_release;
-
cuse_class = class_create(THIS_MODULE, "cuse");
if (IS_ERR(cuse_class))
return PTR_ERR(cuse_class);
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 51d9e33..03c8f95 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -745,7 +745,7 @@ __releases(&fc->lock)
* request_end(). Otherwise add it to the processing list, and set
* the 'sent' flag.
*/
-static ssize_t fuse_dev_read(struct kiocb *iocb, const struct iovec *iov,
+ssize_t fuse_dev_read(struct kiocb *iocb, const struct iovec *iov,
unsigned long nr_segs, loff_t pos)
{
int err;
@@ -987,7 +987,7 @@ static int copy_out_args(struct fuse_copy_state *cs, struct fuse_out *out,
* it from the list and copy the rest of the buffer to the request.
* The request is finished by calling request_end()
*/
-static ssize_t fuse_dev_write(struct kiocb *iocb, const struct iovec *iov,
+ssize_t fuse_dev_write(struct kiocb *iocb, const struct iovec *iov,
unsigned long nr_segs, loff_t pos)
{
int err;
@@ -1084,7 +1084,7 @@ static ssize_t fuse_dev_write(struct kiocb *iocb, const struct iovec *iov,
return err;
}
-static unsigned fuse_dev_poll(struct file *file, poll_table *wait)
+unsigned fuse_dev_poll(struct file *file, poll_table *wait)
{
unsigned mask = POLLOUT | POLLWRNORM;
struct fuse_conn *fc = fuse_get_conn(file);
@@ -1210,7 +1210,7 @@ int fuse_dev_release(struct inode *inode, struct file *file)
}
EXPORT_SYMBOL_GPL(fuse_dev_release);
-static int fuse_dev_fasync(int fd, struct file *file, int on)
+int fuse_dev_fasync(int fd, struct file *file, int on)
{
struct fuse_conn *fc = fuse_get_conn(file);
if (!fc)
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index 01cc462..b11fe78 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -521,6 +521,16 @@ extern const struct file_operations fuse_dev_operations;
extern const struct dentry_operations fuse_dentry_operations;
+extern ssize_t fuse_dev_read(struct kiocb *iocb, const struct iovec *iov,
+ unsigned long nr_segs, loff_t pos);
+
+extern ssize_t fuse_dev_write(struct kiocb *iocb, const struct iovec *iov,
+ unsigned long nr_segs, loff_t pos);
+
+extern unsigned fuse_dev_poll(struct file *file, poll_table *wait);
+
+extern int fuse_dev_fasync(int fd, struct file *file, int on);
+
/**
* Inode to nodeid comparison.
*/
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 7495ce3..3ddb0c8 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1745,6 +1745,7 @@ static int kvm_vcpu_release(struct inode *inode, struct file *filp)
return 0;
}
+/* cannot be const, see kvm_init */
static struct file_operations kvm_vcpu_fops = {
.release = kvm_vcpu_release,
.unlocked_ioctl = kvm_vcpu_ioctl,
@@ -2341,6 +2342,7 @@ static int kvm_vm_mmap(struct file *file, struct vm_area_struct *vma)
return 0;
}
+/* cannot be const, see kvm_init */
static struct file_operations kvm_vm_fops = {
.release = kvm_vm_release,
.unlocked_ioctl = kvm_vm_ioctl,
@@ -2428,6 +2430,7 @@ out:
return r;
}
+/* cannot be const, see kvm_init */
static struct file_operations kvm_chardev_ops = {
.unlocked_ioctl = kvm_dev_ioctl,
.compat_ioctl = kvm_dev_ioctl,
^ permalink raw reply related [flat|nested] 28+ messages in thread
* Re: [PATCH 29/31] Constify struct sysfs_ops for 2.6.32 v1
2009-12-05 0:03 ` Emese Revfy
2009-12-05 21:15 ` Jens Axboe
@ 2009-12-07 9:53 ` Hans J. Koch
1 sibling, 0 replies; 28+ messages in thread
From: Hans J. Koch @ 2009-12-07 9:53 UTC (permalink / raw)
To: Emese Revfy
Cc: tony.luck, fenghua.yu, benh, lethal, tglx, mingo, hpa, axboe,
gregkh, petero2, davej, maciej.sosnowski, dougthompson, airlied,
rolandd, sean.hefty, hal.rosenstock, neilb, rdunlap, kyle, deller,
jejb, jbarnes, hjk, david.vrabel, jeremy, chris.mason, ccaulfie,
teigland, tytso, adilger, swhiteho, mfasheh, joel.becker, rusty,
penberg, shemminger, torvalds, linux-kernel, netdev
On Sat, Dec 05, 2009 at 01:03:07AM +0100, Emese Revfy wrote:
> From: Emese Revfy <re.emese@gmail.com>
>
> Constify struct sysfs_ops.
> Per Dave Miller's suggestion, resend with proper CC list and patch format.
>
> Signed-off-by: Emese Revfy <re.emese@gmail.com>
For the Userspace I/O part:
Acked-by: Hans J. Koch <hjk@linutronix.de>
> ---
[...]
> drivers/uio/uio.c | 4 ++--
[...]
> diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
> index e941367..4de382a 100644
> --- a/drivers/uio/uio.c
> +++ b/drivers/uio/uio.c
> @@ -129,7 +129,7 @@ static ssize_t map_type_show(struct kobject *kobj, struct attribute *attr,
> return entry->show(mem, buf);
> }
>
> -static struct sysfs_ops map_sysfs_ops = {
> +static const struct sysfs_ops map_sysfs_ops = {
> .show = map_type_show,
> };
>
> @@ -217,7 +217,7 @@ static ssize_t portio_type_show(struct kobject *kobj, struct attribute *attr,
> return entry->show(port, buf);
> }
>
> -static struct sysfs_ops portio_sysfs_ops = {
> +static const struct sysfs_ops portio_sysfs_ops = {
> .show = portio_type_show,
> };
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 11/31] Constify struct file_operations for 2.6.32 v1
2009-12-07 0:45 ` Emese Revfy
@ 2009-12-07 15:11 ` Greg KH
2009-12-07 17:35 ` Emese Revfy
0 siblings, 1 reply; 28+ messages in thread
From: Greg KH @ 2009-12-07 15:11 UTC (permalink / raw)
To: Emese Revfy
Cc: lenb, astarikovskiy, mchehab, linville, miklos, davem, rostedt,
fweisbec, mingo, avi, mtosatti, torvalds, linux-kernel, netdev
On Mon, Dec 07, 2009 at 01:45:02AM +0100, Emese Revfy wrote:
> Greg KH wrote:
> > On Sun, Dec 06, 2009 at 02:47:44AM +0100, Emese Revfy wrote:
> >> Greg KH wrote:
> >>> On Sat, Dec 05, 2009 at 03:50:23AM +0100, Emese Revfy wrote:
> >>>> Greg KH wrote:
> >>>>> On Sat, Dec 05, 2009 at 01:02:59AM +0100, Emese Revfy wrote:
> >>>>>> -static struct file_operations ptmx_fops;
> >>>>>> +static const struct file_operations ptmx_fops = {
> >>>>>> + .llseek = no_llseek,
> >>>>>> + .read = tty_read,
> >>>>>> + .write = tty_write,
> >>>>>> + .poll = tty_poll,
> >>>>>> + .unlocked_ioctl = tty_ioctl,
> >>>>>> + .compat_ioctl = tty_compat_ioctl,
> >>>>>> + .open = ptmx_open,
> >>>>>> + .release = tty_release,
> >>>>>> + .fasync = tty_fasync,
> >>>>>> +};
> >>>>> You just made these functions all global, for no real good reason. Why
> >>>>> did you do this?
> >>>> I think this is the only way to make ptmx_fops const, provided we want to.
> >>> Why do we want to?
> >> Because I saw that checkpatch.pl itself tries to ensure the same I went
> >> through the whole tree looking for non-const file_operations structures
> >> and tried to make them const as best as I could. If you think making
> >> ptmx_fops const is not worth the effort I will remove it from the patch.
> >
> > Based on the patch, I would think it is not worth it.
> >
> > thanks,
> >
> > greg k-h
> >
> Ok, I removed the affected hunks.
>
> From: Emese Revfy <re.emese@gmail.com>
>
> Constify struct file_operations with some exceptions.
Now please break this patch (and your others) out into "one subsystem at
a time" type thing so it will have a chance at being applied.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 11/31] Constify struct file_operations for 2.6.32 v1
2009-12-07 15:11 ` Greg KH
@ 2009-12-07 17:35 ` Emese Revfy
2009-12-07 17:57 ` Greg KH
0 siblings, 1 reply; 28+ messages in thread
From: Emese Revfy @ 2009-12-07 17:35 UTC (permalink / raw)
To: Greg KH
Cc: lenb, astarikovskiy, mchehab, linville, miklos, davem, rostedt,
fweisbec, mingo, avi, mtosatti, torvalds, linux-kernel, netdev
>> From: Emese Revfy <re.emese@gmail.com>
>>
>> Constify struct file_operations with some exceptions.
>
> Now please break this patch (and your others) out into "one subsystem at
> a time" type thing so it will have a chance at being applied.
Shall i split them up per subsystem and structure type or
only per subsystem (that is, include all affected structures
in the given subsystem)?
--
Emese
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 11/31] Constify struct file_operations for 2.6.32 v1
2009-12-07 17:35 ` Emese Revfy
@ 2009-12-07 17:57 ` Greg KH
0 siblings, 0 replies; 28+ messages in thread
From: Greg KH @ 2009-12-07 17:57 UTC (permalink / raw)
To: Emese Revfy
Cc: lenb, astarikovskiy, mchehab, linville, miklos, davem, rostedt,
fweisbec, mingo, avi, mtosatti, torvalds, linux-kernel, netdev
On Mon, Dec 07, 2009 at 06:35:07PM +0100, Emese Revfy wrote:
> >> From: Emese Revfy <re.emese@gmail.com>
> >>
> >> Constify struct file_operations with some exceptions.
> >
> > Now please break this patch (and your others) out into "one subsystem at
> > a time" type thing so it will have a chance at being applied.
>
> Shall i split them up per subsystem and structure type or
> only per subsystem (that is, include all affected structures
> in the given subsystem)?
Both.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 28+ messages in thread
end of thread, other threads:[~2009-12-07 18:06 UTC | newest]
Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <4B198670.2000406@gmail.com>
[not found] ` <4B198A7E.4080407@gmail.com>
2009-12-04 22:40 ` [PATCH 07/31] Constify struct e1000_nvm_operations for 2.6.32 v1 Waskiewicz Jr, Peter P
2009-12-05 0:03 ` Emese Revfy
[not found] ` <4B1991E2.5010903@gmail.com>
2009-12-04 23:00 ` [PATCH 29/31] Constify struct sysfs_ops " Emese Revfy
2009-12-05 0:03 ` Emese Revfy
2009-12-05 21:15 ` Jens Axboe
2009-12-06 8:58 ` Pekka Enberg
2009-12-07 9:53 ` Hans J. Koch
[not found] ` <4B198FA1.7090807@gmail.com>
2009-12-04 23:02 ` [PATCH 22/31] Constify struct neigh_ops " Emese Revfy
2009-12-04 23:19 ` David Miller
2009-12-05 0:02 ` Emese Revfy
[not found] ` <4B198DA7.1080809@gmail.com>
2009-12-04 23:05 ` [PATCH 15/31] Constify struct iwl_ops " Emese Revfy
2009-12-05 0:02 ` Emese Revfy
[not found] ` <4B198AE3.2040003@gmail.com>
2009-12-04 22:40 ` [PATCH 08/31] Constify struct e1000_phy_operations " Waskiewicz Jr, Peter P
2009-12-05 0:03 ` Emese Revfy
[not found] ` <4B198A33.7080705@gmail.com>
2009-12-04 22:39 ` [PATCH 06/31] Constify struct e1000_mac_operations " Waskiewicz Jr, Peter P
2009-12-05 0:03 ` Emese Revfy
[not found] ` <4B19A337.6060808@gmail.com>
2009-12-05 0:40 ` Stephen Rothwell
2009-12-05 1:18 ` Emese Revfy
2009-12-05 1:21 ` Jeff Kirsher
[not found] ` <4B198C43.50205@gmail.com>
[not found] ` <4B19A333.5080103@gmail.com>
2009-12-05 0:09 ` [PATCH 11/31] Constify struct file_operations " Greg KH
2009-12-05 2:50 ` Emese Revfy
2009-12-05 4:15 ` Greg KH
2009-12-06 1:47 ` Emese Revfy
2009-12-06 17:25 ` Greg KH
2009-12-07 0:45 ` Emese Revfy
2009-12-07 15:11 ` Greg KH
2009-12-07 17:35 ` Emese Revfy
2009-12-07 17:57 ` Greg KH
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).