: constify function pointer tables
Subsystems (48)
A message that is not in the archive (sent off-list or not yet received): 54038cd4f87a03884e4f59f8f3697889dfb63c54.1201030614.git.jengelh@computergmbh.de
PATCH 1/1 : constify function pointer tables
--- arch/mips/basler/excite/excite_iodev.c | 2 +- arch/mips/kernel/proc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/mips/basler/excite/excite_iodev.c +1 -1
@@ -48,7 +48,7 @@ static DECLARE_WAIT_QUEUE_HEAD(wq); -static struct file_operations fops = +static const struct file_operations fops = { .owner =THIS_MODULE , .open = iodev_open,
arch/mips/kernel/proc.c +1 -1
@@ -89,7 +89,7 @@ static void c_stop(struct seq_file *m, void *v) { } -struct seq_operations cpuinfo_op = { +const struct seq_operations cpuinfo_op = { .start = c_start, .next = c_next, .stop = c_stop,
Signature · 1 line
1.5.3.4
On Tue, Jan 22, 2008 at 08:42:33PM +0100, Jan Engelhardt wrote:
Thanks, queued for 2.6.25.
Ralf
PATCH 1/1 : fix CAC_ADDR/UNCAC_ADDR
In reply to Jan EngelhardtWith commit db38501511a7513ec4f0ae9922d847c135cf3c78 PAGE_OFFSET was redefined as CAC_BASE+PHYS_OFFSET, but [UN]CAC_ADDR - which are used in dma_alloc_coherent() and dma_free_coherent() respectively, and in drivers/video/au1100fb.c - were not adjusted accordingly.
with kind regards
linux-2.6.24/include/asm-mips/page.h +2 -2
@@ -184,8 +184,8 @@#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) -#define UNCAC_ADDR (addr) ((addr) - PAGE_OFFSET + UNCAC_BASE) -#define CAC_ADDR (addr) ((addr) - UNCAC_BASE + PAGE_OFFSET) +#define UNCAC_ADDR (addr) ((addr) - PAGE_OFFSET + PHYS_OFFSET + UNCAC_BASE) +#define CAC_ADDR (addr) ((addr) - UNCAC_BASE + PAGE_OFFSET - PHYS_OFFSET)#include <asm-generic/memory_model.h> #include <asm-generic/page.h>
PATCH 1/1 : constify function pointer tables
In reply to a message not in the archive--- crypto/proc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
crypto/proc.c +1 -1
@@ -78,7 +78,7 @@ static int c_show(struct seq_file *m, void *p)return 0 ; } -static struct seq_operations crypto_seq_ops = { +static const struct seq_operations crypto_seq_ops = { .start = c_start, .next = c_next, .stop = c_stop,
Signature · 1 line
1.5.3.4
Herbert Xu
maintainerQuoted 1 line · Jan Engelhardt
Signed-off-by Jan Engelhardt <[email protected]>
Patch applied. Thanks!
Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txtPATCH 1/1 ACPI: constify function pointer tables
In reply to a message not in the archive--- drivers/acpi/battery.c | 2 +- drivers/acpi/ec.c | 2 +- drivers/acpi/processor_perflib.c | 2 +- drivers/acpi/processor_thermal.c | 2 +- drivers/acpi/processor_throttling.c | 2 +- drivers/acpi/sbs.c | 14 +++++++------- drivers/acpi/video.c | 10 +++++----- include/acpi/processor.h | 4 ++-- 8 files changed, 19 insertions(+), 19 deletions(-)
drivers/acpi/battery.c +1 -1
@@ -713,7 +713,7 @@ DECLARE_FILE_FUNCTIONS(alarm);static struct battery_file {struct file_operations ops;mode_t mode; -char *name; +const char *name; } acpi_battery_file[] = {FILE_DESCRIPTION_RO (info),FILE_DESCRIPTION_RO (state),
drivers/acpi/ec.c +1 -1
@@ -629,7 +629,7 @@ static int acpi_ec_info_open_fs(struct inode *inode, struct file *file)return single_open (file, acpi_ec_read_info,PDE (inode)->data); } -static struct file_operations acpi_ec_info_ops = { +static const struct file_operations acpi_ec_info_ops = { .open = acpi_ec_info_open_fs, .read = seq_read, .llseek = seq_lseek,
drivers/acpi/processor_perflib.c +1 -1
@@ -389,7 +389,7 @@ EXPORT_SYMBOL(acpi_processor_notify_smm);/* /proc/acpi/processor/../performance interface (DEPRECATED) */ static int acpi_processor_perf_open_fs (struct inode *inode,struct file *file); -static struct file_operations acpi_processor_perf_fops = { +static const struct file_operations acpi_processor_perf_fops = { .open = acpi_processor_perf_open_fs, .read = seq_read, .llseek = seq_lseek,
drivers/acpi/processor_thermal.c +1 -1
@@ -382,7 +382,7 @@ static ssize_t acpi_processor_write_limit(struct file * file,return count; } -struct file_operations acpi_processor_limit_fops = { +const struct file_operations acpi_processor_limit_fops = { .open = acpi_processor_limit_open_fs, .read = seq_read, .write = acpi_processor_write_limit,
drivers/acpi/processor_throttling.c +1 -1
@@ -917,7 +917,7 @@ static ssize_t acpi_processor_write_throttling(struct file *file,return count; } -struct file_operations acpi_processor_throttling_fops = { +const struct file_operations acpi_processor_throttling_fops = { .open = acpi_processor_throttling_open_fs, .read = seq_read, .write = acpi_processor_write_throttling,
drivers/acpi/sbs.c +7 -7
@@ -479,9 +479,9 @@ static int acpi_sbs_add_fs(struct proc_dir_entry **dir, struct proc_dir_entry *parent_dir, char *dir_name, - struct file_operations *info_fops, - struct file_operations *state_fops, - struct file_operations *alarm_fops, void *data) + const struct file_operations *info_fops, + const struct file_operations *state_fops, + const struct file_operations *alarm_fops, void *data) { struct proc_dir_entry *entry = NULL;
@@ -694,7 +694,7 @@ static int acpi_battery_alarm_open_fs(struct inode *inode, struct file *file)return single_open (file, acpi_battery_read_alarm,PDE (inode)->data); } -static struct file_operations acpi_battery_info_fops = { +static const struct file_operations acpi_battery_info_fops = { .open = acpi_battery_info_open_fs, .read = seq_read, .llseek = seq_lseek,
@@ -702,7 +702,7 @@ static struct file_operations acpi_battery_info_fops = { .owner = THIS_MODULE, }; -static struct file_operations acpi_battery_state_fops = { +static const struct file_operations acpi_battery_state_fops = { .open = acpi_battery_state_open_fs, .read = seq_read, .llseek = seq_lseek,
@@ -710,7 +710,7 @@ static struct file_operations acpi_battery_state_fops = { .owner = THIS_MODULE, }; -static struct file_operations acpi_battery_alarm_fops = { +static const struct file_operations acpi_battery_alarm_fops = { .open = acpi_battery_alarm_open_fs, .read = seq_read, .write = acpi_battery_write_alarm,
@@ -742,7 +742,7 @@ static int acpi_ac_state_open_fs(struct inode *inode, struct file *file)return single_open (file, acpi_ac_read_state,PDE (inode)->data); } -static struct file_operations acpi_ac_state_fops = { +static const struct file_operations acpi_ac_state_fops = { .open = acpi_ac_state_open_fs, .read = seq_read, .llseek = seq_lseek,
drivers/acpi/video.c +5 -5
@@ -184,7 +184,7 @@ struct acpi_video_device {/* bus */ static int acpi_video_bus_info_open_fs (struct inode *inode,struct file *file); -static struct file_operations acpi_video_bus_info_fops = { +static const struct file_operations acpi_video_bus_info_fops = { .open = acpi_video_bus_info_open_fs, .read = seq_read, .llseek = seq_lseek,
@@ -192,7 +192,7 @@ static struct file_operations acpi_video_bus_info_fops = { };static int acpi_video_bus_ROM_open_fs (struct inode *inode,struct file *file); -static struct file_operations acpi_video_bus_ROM_fops = { +static const struct file_operations acpi_video_bus_ROM_fops = { .open = acpi_video_bus_ROM_open_fs, .read = seq_read, .llseek = seq_lseek,
@@ -201,7 +201,7 @@ static struct file_operations acpi_video_bus_ROM_fops = {static int acpi_video_bus_POST_info_open_fs (struct inode *inode,struct file *file); -static struct file_operations acpi_video_bus_POST_info_fops = { +static const struct file_operations acpi_video_bus_POST_info_fops = { .open = acpi_video_bus_POST_info_open_fs, .read = seq_read, .llseek = seq_lseek,
@@ -227,7 +227,7 @@ static struct file_operations acpi_video_bus_DOS_fops = {/* device */ static int acpi_video_device_info_open_fs (struct inode *inode,struct file *file); -static struct file_operations acpi_video_device_info_fops = { +static const struct file_operations acpi_video_device_info_fops = { .open = acpi_video_device_info_open_fs, .read = seq_read, .llseek = seq_lseek,
@@ -254,7 +254,7 @@ static struct file_operations acpi_video_device_brightness_fops = {static int acpi_video_device_EDID_open_fs (struct inode *inode,struct file *file); -static struct file_operations acpi_video_device_EDID_fops = { +static const struct file_operations acpi_video_device_EDID_fops = { .open = acpi_video_device_EDID_open_fs, .read = seq_read, .llseek = seq_lseek,
include/acpi/processor.h +2 -2
@@ -315,7 +315,7 @@ static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr)/* in processor_throttling.c */ int acpi_processor_get_throttling_info (struct acpi_processor *pr);extern int acpi_processor_set_throttling (struct acpi_processor *pr,int state); -extern struct file_operations acpi_processor_throttling_fops; +extern const struct file_operations acpi_processor_throttling_fops;/* in processor_idle.c */ int acpi_processor_power_init(struct acpi_processor *pr,
@@ -329,7 +329,7 @@ extern struct cpuidle_driver acpi_idle_driver;/* in processor_thermal.c */ int acpi_processor_get_limit_info (struct acpi_processor *pr); -extern struct file_operations acpi_processor_limit_fops; +extern const struct file_operations acpi_processor_limit_fops;#ifdef CONFIG_CPU_FREQ void acpi_thermal_cpufreq_init (void );
Signature · 1 line
1.5.3.4
A message that is not in the archive (sent off-list or not yet received): 54038cd4f87a03884e4f59f8f3697889dfb63c54.1201030614.git.jengelh-bdq14YP6qtRlEiWPh9xO2Q@public.gmane.org
PATCH 1/1 KVM: constify function pointer tables
--- drivers/kvm/kvm_main.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/kvm/kvm_main.c +2 -2
@@ -2573,7 +2573,7 @@ static int kvm_vcpu_release(struct inode *inode, struct file *filp)return 0 ; } -static struct file_operations kvm_vcpu_fops = { +static const struct file_operations kvm_vcpu_fops = { .release = kvm_vcpu_release, .unlocked_ioctl = kvm_vcpu_ioctl, .compat_ioctl = kvm_vcpu_ioctl,
@@ -3140,7 +3140,7 @@ static int kvm_vm_mmap(struct file *file, struct vm_area_struct *vma)return 0 ; } -static struct file_operations kvm_vm_fops = { +static const struct file_operations kvm_vm_fops = { .release = kvm_vm_release, .unlocked_ioctl = kvm_vm_ioctl, .compat_ioctl = kvm_vm_ioctl,
Signature · 7 lines
1.5.3.4 ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
A message that is not in the archive (sent off-list or not yet received): Pine.LNX.4.64.0801222046010.5722-vVwEwcwQeYFPkBl3ERsXe1l1cybopEuJUBSOeVevoDU@public.gmane.org
Avi Kivity
AppliedRe: [PATCH] KVM: constify function pointer tables
Quoted 3 lines · Jan Engelhardt
Signed-off-by Jan Engelhardt <[email protected]>--- drivers/kvm/kvm_main.c | 4 ++--
Applied, but please generate patches against kvm.git as kvm moves quickly. In this case, the file has moved to virt/kvm/.
Signature · 7 lines
error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
PATCH 1/1 : constify function pointer tables
In reply to a message not in the archive--- fs/nfs/client.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
fs/nfs/client.c +2 -2
@@ -1168,7 +1168,7 @@ static void *nfs_server_list_next(struct seq_file *p, void *v, loff_t *pos);static void nfs_server_list_stop (struct seq_file *p,void *v);static int nfs_server_list_show (struct seq_file *m,void *v); -static struct seq_operations nfs_server_list_ops = { +static const struct seq_operations nfs_server_list_ops = { .start = nfs_server_list_start, .next = nfs_server_list_next, .stop = nfs_server_list_stop,
@@ -1188,7 +1188,7 @@ static void *nfs_volume_list_next(struct seq_file *p, void *v, loff_t *pos);static void nfs_volume_list_stop (struct seq_file *p,void *v);static int nfs_volume_list_show (struct seq_file *m,void *v); -static struct seq_operations nfs_volume_list_ops = { +static const struct seq_operations nfs_volume_list_ops = { .start = nfs_volume_list_start, .next = nfs_volume_list_next, .stop = nfs_volume_list_stop,
Signature · 1 line
1.5.3.4
PATCH 1/1 knfsd: constify function pointer tables
In reply to a message not in the archive--- fs/nfsd/export.c | 2 +- fs/nfsd/nfsctl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
fs/nfsd/export.c +1 -1
@@ -1539,7 +1539,7 @@ static int e_show(struct seq_file *m, void *p)return svc_export_show (m, &svc_export_cache, cp); } -struct seq_operations nfs_exports_op = { +const struct seq_operations nfs_exports_op = { .start = e_start, .next = e_next, .stop = e_stop,
fs/nfsd/nfsctl.c +1 -1
@@ -149,7 +149,7 @@ static const struct file_operations transaction_ops = { .release = simple_transaction_release, }; -extern struct seq_operations nfs_exports_op; +extern const struct seq_operations nfs_exports_op;static int exports_open (struct inode *inode,struct file *file) {return seq_open (file, &nfs_exports_op);
Signature · 14 lines
1.5.3.4 ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ NFS maillist - [email protected] https://lists.sourceforge.net/lists/listinfo/nfs _______________________________________________ Please note that [email protected] is being discontinued. Please subscribe to [email protected] instead. http://vger.kernel.org/vger-lists.html#linux-nfs
PATCH 1/1 NET: constify data and function pointer tables
In reply to a message not in the archive--- drivers/net/bonding/bond_main.c | 2 +- drivers/net/hamradio/bpqether.c | 2 +- drivers/net/hamradio/scc.c | 2 +- drivers/net/hamradio/yam.c | 2 +- drivers/net/ibmveth.c | 2 +- drivers/net/pppoe.c | 2 +- drivers/net/pppol2tp.c | 4 ++-- drivers/net/wireless/libertas/debugfs.c | 14 +++++++------- drivers/net/wireless/strip.c | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-)
drivers/net/bonding/bond_main.c +1 -1
@@ -3252,7 +3252,7 @@ static int bond_info_seq_show(struct seq_file *seq, void *v)return 0 ; } -static struct seq_operations bond_info_seq_ops = { +static const struct seq_operations bond_info_seq_ops = { .start = bond_info_seq_start, .next = bond_info_seq_next, .stop = bond_info_seq_stop,
drivers/net/hamradio/bpqether.c +1 -1
@@ -442,7 +442,7 @@ static int bpq_seq_show(struct seq_file *seq, void *v)return 0 ; } -static struct seq_operations bpq_seqops = { +static const struct seq_operations bpq_seqops = { .start = bpq_seq_start, .next = bpq_seq_next, .stop = bpq_seq_stop,
drivers/net/hamradio/scc.c +1 -1
@@ -2071,7 +2071,7 @@ static int scc_net_seq_show(struct seq_file *seq, void *v)return 0 ; } -static struct seq_operations scc_net_seq_ops = { +static const struct seq_operations scc_net_seq_ops = { .start = scc_net_seq_start, .next = scc_net_seq_next, .stop = scc_net_seq_stop,
drivers/net/hamradio/yam.c +1 -1
@@ -788,7 +788,7 @@ static int yam_seq_show(struct seq_file *seq, void *v)return 0 ; } -static struct seq_operations yam_seqops = { +static const struct seq_operations yam_seqops = { .start = yam_seq_start, .next = yam_seq_next, .stop = yam_seq_stop,
drivers/net/ibmveth.c +1 -1
@@ -1300,7 +1300,7 @@ static int ibmveth_seq_show(struct seq_file *seq, void *v)return 0 ; } -static struct seq_operations ibmveth_seq_ops = { +static const struct seq_operations ibmveth_seq_ops = { .start = ibmveth_seq_start, .next = ibmveth_seq_next, .stop = ibmveth_seq_stop,
drivers/net/pppoe.c +1 -1
@@ -1026,7 +1026,7 @@ static void pppoe_seq_stop(struct seq_file *seq, void *v)read_unlock_bh (&pppoe_hash_lock); } -static struct seq_operations pppoe_seq_ops = { +static const struct seq_operations pppoe_seq_ops = { .start = pppoe_seq_start, .next = pppoe_seq_next, .stop = pppoe_seq_stop,
drivers/net/pppol2tp.c +2 -2
@@ -2355,7 +2355,7 @@ out:return 0 ; } -static struct seq_operations pppol2tp_seq_ops = { +static const struct seq_operations pppol2tp_seq_ops = { .start = pppol2tp_seq_start, .next = pppol2tp_seq_next, .stop = pppol2tp_seq_stop,
@@ -2403,7 +2403,7 @@ static int pppol2tp_proc_release(struct inode *inode, struct file *file)return seq_release (inode, file); } -static struct file_operations pppol2tp_proc_fops = { +static const struct file_operations pppol2tp_proc_fops = { .owner =THIS_MODULE , .open = pppol2tp_proc_open, .read = seq_read,
drivers/net/wireless/libertas/debugfs.c +7 -7
@@ -1569,7 +1569,7 @@ static ssize_t libertas_rdrf_write(struct file *file, res = -EFAULT ; goto out_unlock; } - priv->rf_offset =simple_strtoul ((char *)buf,NULL ,16 ); + priv->rf_offset =simple_strtoul (buf,NULL ,16 ); res = count; out_unlock:free_page (addr);
@@ -1620,12 +1620,12 @@ out_unlock: }struct libertas_debugfs_files { -char *name; +const char *name;int perm;struct file_operations fops; }; -static struct libertas_debugfs_files debugfs_files[] = { +static const struct libertas_debugfs_files debugfs_files[] = { {"info" ,0444 ,FOPS (libertas_dev_info, write_file_dummy), }, {"getscantable" ,0444 ,FOPS (libertas_getscantable, write_file_dummy), },
@@ -1635,7 +1635,7 @@ static struct libertas_debugfs_files debugfs_files[] = { { "setuserscan", 0600, FOPS(NULL, libertas_setuserscan), }, }; -static struct libertas_debugfs_files debugfs_events_files[] = { +static const struct libertas_debugfs_files debugfs_events_files[] = { {"low_rssi", 0644, FOPS(libertas_lowrssi_read, libertas_lowrssi_write), }, {"low_snr", 0644, FOPS(libertas_lowsnr_read,
@@ -1650,7 +1650,7 @@ static struct libertas_debugfs_files debugfs_events_files[] = { libertas_highsnr_write), }, }; -static struct libertas_debugfs_files debugfs_regs_files[] = { +static const struct libertas_debugfs_files debugfs_regs_files[] = { {"rdmac" ,0644 ,FOPS (libertas_rdmac_read, libertas_rdmac_write), }, {"wrmac" ,0600 ,FOPS (NULL , libertas_wrmac_write), }, {"rdbbp" ,0644 ,FOPS (libertas_rdbbp_read, libertas_rdbbp_write), },
@@ -1677,7 +1677,7 @@ void libertas_debugfs_remove(void)void libertas_debugfs_init_one (wlan_private *priv,struct net_device *dev) {int i; -struct libertas_debugfs_files *files; +const struct libertas_debugfs_files *files;if (!libertas_dir) goto exit;
@@ -1881,7 +1881,7 @@ static ssize_t wlan_debugfs_write(struct file *f, const char __user *buf,return (ssize_t )cnt; } -static struct file_operations libertas_debug_fops = { +static const struct file_operations libertas_debug_fops = { .owner =THIS_MODULE , .open = open_file_generic, .write = wlan_debugfs_write,
drivers/net/wireless/strip.c +1 -1
@@ -1149,7 +1149,7 @@ static int strip_seq_show(struct seq_file *seq, void *v) } -static struct seq_operations strip_seq_ops = { +static const struct seq_operations strip_seq_ops = { .start = strip_seq_start, .next = strip_seq_next, .stop = strip_seq_stop,
Signature · 1 line
1.5.3.4
Re: [PATCH] NET: constify data and function pointer tables
Quoted 12 lines · Jan Engelhardt
Signed-off-by Jan Engelhardt <[email protected]>--- drivers/net/bonding/bond_main.c | 2 +- drivers/net/hamradio/bpqether.c | 2 +- drivers/net/hamradio/scc.c | 2 +- drivers/net/hamradio/yam.c | 2 +- drivers/net/ibmveth.c | 2 +- drivers/net/pppoe.c | 2 +- drivers/net/pppol2tp.c | 4 ++-- drivers/net/wireless/libertas/debugfs.c | 14 +++++++------- drivers/net/wireless/strip.c | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-)
ACK -- but you should collect linville's ack of the wireless stuff too (even though the patch is simple and obvious)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH] NET: constify data and function pointer tables
Quoted 14 lines · Jeff Garzik
Quoted 12 lines · Jan Engelhardt
Signed-off-by Jan Engelhardt <[email protected]>--- drivers/net/bonding/bond_main.c | 2 +- drivers/net/hamradio/bpqether.c | 2 +- drivers/net/hamradio/scc.c | 2 +- drivers/net/hamradio/yam.c | 2 +- drivers/net/ibmveth.c | 2 +- drivers/net/pppoe.c | 2 +- drivers/net/pppol2tp.c | 4 ++-- drivers/net/wireless/libertas/debugfs.c | 14 +++++++------- drivers/net/wireless/strip.c | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-)
Quoted 2 lines
ACK -- but you should collect linville's ack of the wireless stuff too (even though the patch is simple and obvious)
Looks fine to me...ACK
Signature · 2 lines
John W. Linville [email protected]
PATCH 1/1 : constify function pointer tables
In reply to a message not in the archive--- net/rxrpc/ar-call.c | 2 +- net/rxrpc/ar-internal.h | 6 +++--- net/rxrpc/ar-proc.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-)
net/rxrpc/ar-call.c +1 -1
@@ -15,7 +15,7 @@#include <net/af_rxrpc.h> #include "ar-internal.h" -const char *rxrpc_call_states[] = { +const char *const rxrpc_call_states[] = { [RXRPC_CALL_CLIENT_SEND_REQUEST ] ="ClSndReq" , [RXRPC_CALL_CLIENT_AWAIT_REPLY ] ="ClAwtRpl" , [RXRPC_CALL_CLIENT_RECV_REPLY ] ="ClRcvRpl" ,
net/rxrpc/ar-internal.h +3 -3
@@ -565,9 +565,9 @@ extern void __exit rxrpc_destroy_all_peers(void);/* * ar-proc.c */ -extern const char *rxrpc_call_states[]; -extern struct file_operations rxrpc_call_seq_fops; -extern struct file_operations rxrpc_connection_seq_fops; +extern const char *const rxrpc_call_states[]; +extern const struct file_operations rxrpc_call_seq_fops; +extern const struct file_operations rxrpc_connection_seq_fops;/* * ar-recvmsg.c
net/rxrpc/ar-proc.c +3 -3
@@ -14,7 +14,7 @@#include <net/af_rxrpc.h> #include "ar-internal.h" -static const char *rxrpc_conn_states[] = { +static const char *const rxrpc_conn_states[] = { [RXRPC_CONN_UNUSED ] ="Unused " , [RXRPC_CONN_CLIENT ] ="Client " , [RXRPC_CONN_SERVER_UNSECURED ] ="SvUnsec " ,
@@ -98,7 +98,7 @@ static int rxrpc_call_seq_open(struct inode *inode, struct file *file)return seq_open (file, &rxrpc_call_seq_ops); } -struct file_operations rxrpc_call_seq_fops = { +const struct file_operations rxrpc_call_seq_fops = { .owner =THIS_MODULE , .open = rxrpc_call_seq_open, .read = seq_read,
@@ -183,7 +183,7 @@ static int rxrpc_connection_seq_open(struct inode *inode, struct file *file)return seq_open (file, &rxrpc_connection_seq_ops); } -struct file_operations rxrpc_connection_seq_fops = { +const struct file_operations rxrpc_connection_seq_fops = { .owner =THIS_MODULE , .open = rxrpc_connection_seq_open, .read = seq_read,
Signature · 1 line
1.5.3.4
From: Jan Engelhardt <[email protected]>
Date: Tue, 22 Jan 2008 20:47:51 +0100 (CET)
Quoted 1 line
Signed-off-by Jan Engelhardt <[email protected]>
Applied, thanks.
PATCH 1/1 md: constify function pointer tables
In reply to a message not in the archive--- drivers/md/md.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/md/md.c +1 -1
@@ -5033,7 +5033,7 @@ static int md_seq_show(struct seq_file *seq, void *v)return 0 ; } -static struct seq_operations md_seq_ops = { +static const struct seq_operations md_seq_ops = { .start = md_seq_start, .next = md_seq_next, .stop = md_seq_stop,
Signature · 1 line
1.5.3.4
PATCH 1/1 x86: constify function pointer tables
In reply to a message not in the archive--- arch/x86/kernel/cpu/proc.c | 2 +- arch/x86/kernel/setup_64.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/cpu/proc.c +1 -1
@@ -188,7 +188,7 @@ static void *c_next(struct seq_file *m, void *v, loff_t *pos)static void c_stop (struct seq_file *m,void *v) { } -struct seq_operations cpuinfo_op = { +const struct seq_operations cpuinfo_op = { .start = c_start, .next = c_next, .stop = c_stop,
arch/x86/kernel/setup_64.c +1 -1
@@ -1184,7 +1184,7 @@ static void c_stop(struct seq_file *m, void *v) { } -struct seq_operations cpuinfo_op = { +const struct seq_operations cpuinfo_op = { .start =c_start, .next = c_next, .stop = c_stop,
Signature · 1 line
1.5.3.4
Ingo Molnar
AppliedRe: [PATCH] x86: constify function pointer tables
Quoted 1 line · Jan Engelhardt
Signed-off-by Jan Engelhardt <[email protected]>
thanks, applied.
btw., please send future x86 cleanup patches against x86.git#mm. For example, this bit:
arch/x86/kernel/setup_64.c static void c_stop(struct seq_file *m, void *v) · line 1188
Quoted 3 lines
arch/x86/kernel/setup_64.c +1
-1-struct seq_operations cpuinfo_op = { +const struct seq_operations cpuinfo_op = { .start =c_start,
already looks a bit different there so it didnt apply straight away. (i fixed that up so no need to resend)
x86.git#mm tracking coordinates are at:
http://redhat.com/~mingo/x86.git/README Ingo
PATCH 1/1 : constify function pointer tables
In reply to a message not in the archive--- net/x25/x25_proc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
net/x25/x25_proc.c +1 -1
@@ -287,7 +287,7 @@ static const struct file_operations x25_seq_route_fops = { .release = seq_release, }; -static struct file_operations x25_seq_forward_fops = { +static const struct file_operations x25_seq_forward_fops = { .owner =THIS_MODULE , .open = x25_seq_forward_open, .read = seq_read,
Signature · 1 line
1.5.3.4
From: Jan Engelhardt <[email protected]>
Date: Tue, 22 Jan 2008 20:52:04 +0100 (CET)
Quoted 1 line
Signed-off-by Jan Engelhardt <[email protected]>
Applied.
PATCH 1/1 : constify function pointer tables
In reply to a message not in the archive--- fs/ocfs2/dlmglue.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ocfs2/dlmglue.c +1 -1
@@ -2211,7 +2211,7 @@ static int ocfs2_dlm_seq_show(struct seq_file *m, void *v)return 0 ; } -static struct seq_operations ocfs2_dlm_seq_ops = { +static const struct seq_operations ocfs2_dlm_seq_ops = { .start = ocfs2_dlm_seq_start, .stop = ocfs2_dlm_seq_stop, .next = ocfs2_dlm_seq_next,
Signature · 1 line
1.5.3.4
PATCH 1/1 : constify function pointer tables
In reply to a message not in the archive--- fs/dlm/debug_fs.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
fs/dlm/debug_fs.c +2 -2
@@ -342,7 +342,7 @@ static int rsb_seq_show(struct seq_file *file, void *iter_ptr)return 0 ; } -static struct seq_operations rsb_seq_ops = { +static const struct seq_operations rsb_seq_ops = { .start = rsb_seq_start, .next = rsb_seq_next, .stop = rsb_seq_stop,
@@ -419,7 +419,7 @@ static void *locks_seq_start(struct seq_file *file, loff_t *pos)return ri; } -static struct seq_operations locks_seq_ops = { +static const struct seq_operations locks_seq_ops = { .start = locks_seq_start, .next = rsb_seq_next, .stop = rsb_seq_stop,
Signature · 1 line
1.5.3.4
PATCH 1/1 : constify function pointer tables
In reply to a message not in the archive--- drivers/scsi/lpfc/lpfc_debugfs.c | 10 +++++----- drivers/scsi/sg.c | 8 ++++----
drivers/scsi/lpfc/lpfc_debugfs.c +5 -5
@@ -715,7 +715,7 @@ lpfc_debugfs_release(struct inode *inode, struct file *file) }#undef lpfc_debugfs_op_disc_trc -static struct file_operations lpfc_debugfs_op_disc_trc = { +static const struct file_operations lpfc_debugfs_op_disc_trc = { .owner =THIS_MODULE , .open = lpfc_debugfs_disc_trc_open, .llseek = lpfc_debugfs_lseek,
@@ -724,7 +724,7 @@ static struct file_operations lpfc_debugfs_op_disc_trc = { };#undef lpfc_debugfs_op_nodelist -static struct file_operations lpfc_debugfs_op_nodelist = { +static const struct file_operations lpfc_debugfs_op_nodelist = { .owner =THIS_MODULE , .open = lpfc_debugfs_nodelist_open, .llseek = lpfc_debugfs_lseek,
@@ -733,7 +733,7 @@ static struct file_operations lpfc_debugfs_op_nodelist = { };#undef lpfc_debugfs_op_hbqinfo -static struct file_operations lpfc_debugfs_op_hbqinfo = { +static const struct file_operations lpfc_debugfs_op_hbqinfo = { .owner =THIS_MODULE , .open = lpfc_debugfs_hbqinfo_open, .llseek = lpfc_debugfs_lseek,
@@ -742,7 +742,7 @@ static struct file_operations lpfc_debugfs_op_hbqinfo = { };#undef lpfc_debugfs_op_dumpslim -static struct file_operations lpfc_debugfs_op_dumpslim = { +static const struct file_operations lpfc_debugfs_op_dumpslim = { .owner =THIS_MODULE , .open = lpfc_debugfs_dumpslim_open, .llseek = lpfc_debugfs_lseek,
@@ -751,7 +751,7 @@ static struct file_operations lpfc_debugfs_op_dumpslim = { };#undef lpfc_debugfs_op_slow_ring_trc -static struct file_operations lpfc_debugfs_op_slow_ring_trc = { +static const struct file_operations lpfc_debugfs_op_slow_ring_trc = { .owner =THIS_MODULE , .open = lpfc_debugfs_slow_ring_trc_open, .llseek = lpfc_debugfs_lseek,
drivers/scsi/sg.c +4 -4
@@ -1309,7 +1309,7 @@ sg_cmd_done(void *data, char *sense, int result, int resid) } } -static struct file_operations sg_fops = { +static const struct file_operations sg_fops = { .owner =THIS_MODULE , .read = sg_read, .write = sg_write,
@@ -2594,7 +2594,7 @@ static struct file_operations dev_fops = { .open = sg_proc_open_dev, .release = seq_release, }; -static struct seq_operations dev_seq_ops = { +static const struct seq_operations dev_seq_ops = { .start = dev_seq_start, .next = dev_seq_next, .stop = dev_seq_stop,
@@ -2607,7 +2607,7 @@ static struct file_operations devstrs_fops = { .open = sg_proc_open_devstrs, .release = seq_release, }; -static struct seq_operations devstrs_seq_ops = { +static const struct seq_operations devstrs_seq_ops = { .start = dev_seq_start, .next = dev_seq_next, .stop = dev_seq_stop,
@@ -2620,7 +2620,7 @@ static struct file_operations debug_fops = { .open = sg_proc_open_debug, .release = seq_release, }; -static struct seq_operations debug_seq_ops = { +static const struct seq_operations debug_seq_ops = { .start = dev_seq_start, .next = dev_seq_next, .stop = dev_seq_stop,
Signature · 1 line
1.5.3.4
Quoted 4 lines · Jan Engelhardt
Signed-off-by Jan Engelhardt <[email protected]>--- drivers/scsi/lpfc/lpfc_debugfs.c | 10 +++++----- drivers/scsi/sg.c | 8 ++++----
ACK
-- james s
PATCH 1/1 input: constify function pointer tables
In reply to a message not in the archive--- drivers/input/input.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/input/input.c +2 -2
@@ -755,7 +755,7 @@ static int input_devices_seq_show(struct seq_file *seq, void *v)return 0 ; } -static struct seq_operations input_devices_seq_ops = { +static const struct seq_operations input_devices_seq_ops = { .start = input_devices_seq_start, .next = input_devices_seq_next, .stop = input_devices_seq_stop,
@@ -808,7 +808,7 @@ static int input_handlers_seq_show(struct seq_file *seq, void *v)return 0 ; } -static struct seq_operations input_handlers_seq_ops = { +static const struct seq_operations input_handlers_seq_ops = { .start = input_handlers_seq_start, .next = input_handlers_seq_next, .stop = input_handlers_seq_stop,
Signature · 1 line
1.5.3.4
PATCH 1/1 : constify function pointer tables
In reply to a message not in the archive--- arch/powerpc/kernel/setup-common.c | 2 +- arch/powerpc/platforms/cell/spufs/inode.c | 2 +- arch/powerpc/platforms/pseries/hvCall_inst.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/kernel/setup-common.c +1 -1
@@ -296,7 +296,7 @@ static void c_stop(struct seq_file *m, void *v) { } -struct seq_operations cpuinfo_op = { +const struct seq_operations cpuinfo_op = { .start =c_start, .next = c_next, .stop = c_stop,
arch/powerpc/platforms/cell/spufs/inode.c +1 -1
@@ -110,7 +110,7 @@ spufs_new_file(struct super_block *sb, struct dentry *dentry, const struct file_operations *fops, int mode, struct spu_context *ctx) { - static struct inode_operations spufs_file_iops = { + static const struct inode_operations spufs_file_iops = { .setattr = spufs_setattr, };struct inode *inode;
arch/powerpc/platforms/pseries/hvCall_inst.c +1 -1
@@ -71,7 +71,7 @@ static int hc_show(struct seq_file *m, void *p)return 0 ; } -static struct seq_operations hcall_inst_seq_ops = { +static const struct seq_operations hcall_inst_seq_ops = { .start = hc_start, .next = hc_next, .stop = hc_stop,
Signature · 1 line
1.5.3.4
Hi Jan,
Good idea ... but ...
arch/powerpc/kernel/setup-common.c static void c_stop(struct seq_file *m, void *v) · line 299
Quoted 11 lines · On Tue, 22 Jan 2008 20:43:09 +0100 (CET) Jan Engelhardt…
arch/powerpc/kernel/setup-common.c +1
-1@@ -296,7 +296,7 @@ static void c_stop(struct seq_file *m, void *v) { } -struct seq_operations cpuinfo_op = { +const struct seq_operations cpuinfo_op = {
This is declared non const in fs/proc/proc_misc.c (one of the reasons why it should be decalred in a header file ...)
The others look good, though.
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
PATCH 1/1 : constify function pointer tables
In reply to a message not in the archive--- drivers/mtd/ubi/cdev.c | 4 ++-- drivers/mtd/ubi/ubi.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/mtd/ubi/cdev.c +2 -2
@@ -683,14 +683,14 @@ static int ubi_cdev_ioctl(struct inode *inode, struct file *file, }/* UBI character device operations */ -struct file_operations ubi_cdev_operations = { +const struct file_operations ubi_cdev_operations = { .owner =THIS_MODULE , .ioctl = ubi_cdev_ioctl, .llseek = no_llseek, };/* UBI volume character device operations */ -struct file_operations ubi_vol_cdev_operations = { +const struct file_operations ubi_vol_cdev_operations = { .owner =THIS_MODULE , .open = vol_cdev_open, .release = vol_cdev_release,
drivers/mtd/ubi/ubi.h +2 -2
@@ -361,8 +361,8 @@ struct ubi_device {#endif }; -extern struct file_operations ubi_cdev_operations; -extern struct file_operations ubi_vol_cdev_operations; +extern const struct file_operations ubi_cdev_operations; +extern const struct file_operations ubi_vol_cdev_operations;extern struct class *ubi_class;/* vtbl.c */
Signature · 1 line
1.5.3.4
PATCH 1/1 procfs: constify function pointer tables
In reply to a message not in the archiveHi,
This touches so many different places that I did not feel like creating a miniscule patch for each architecture. I hope that is ok.
===Patch begins===
[PATCH] procfs: constify function pointer tables
--- arch/alpha/kernel/setup.c | 2 +- arch/blackfin/kernel/setup.c | 2 +- arch/cris/kernel/setup.c | 2 +- arch/frv/kernel/setup.c | 2 +- arch/h8300/kernel/setup.c | 2 +- arch/m32r/kernel/setup.c | 2 +- arch/m68k/kernel/setup.c | 2 +- arch/m68knommu/kernel/setup.c | 2 +- arch/parisc/kernel/setup.c | 2 +- arch/ppc/kernel/setup.c | 2 +- arch/v850/kernel/procfs.c | 2 +- arch/xtensa/kernel/setup.c | 2 +- fs/proc/base.c | 6 +++--- fs/proc/nommu.c | 2 +- fs/proc/proc_misc.c | 22 +++++++++++----------- fs/proc/proc_sysctl.c | 4 ++-- fs/proc/proc_tty.c | 2 +- fs/proc/task_mmu.c | 8 ++++---- fs/proc/task_nommu.c | 2 +- 19 files changed, 35 insertions(+), 35 deletions(-)
arch/alpha/kernel/setup.c +1 -1
@@ -1472,7 +1472,7 @@ c_stop(struct seq_file *f, void *v) { } -struct seq_operations cpuinfo_op = { +const struct seq_operations cpuinfo_op = { .start = c_start, .next = c_next, .stop = c_stop,
arch/blackfin/kernel/setup.c +1 -1
@@ -691,7 +691,7 @@ static void c_stop(struct seq_file *m, void *v) { } -struct seq_operations cpuinfo_op = { +const struct seq_operations cpuinfo_op = { .start = c_start, .next = c_next, .stop = c_stop,
arch/cris/kernel/setup.c +1 -1
@@ -180,7 +180,7 @@ static void c_stop(struct seq_file *m, void *v)extern int show_cpuinfo (struct seq_file *m,void *v); -struct seq_operations cpuinfo_op = { +const struct seq_operations cpuinfo_op = { .start = c_start, .next = c_next, .stop = c_stop,
arch/frv/kernel/setup.c +1 -1
@@ -1109,7 +1109,7 @@ static void c_stop(struct seq_file *m, void *v) { } -struct seq_operations cpuinfo_op = { +const struct seq_operations cpuinfo_op = { .start = c_start, .next = c_next, .stop = c_stop,
arch/h8300/kernel/setup.c +1 -1
@@ -236,7 +236,7 @@ static void c_stop(struct seq_file *m, void *v) { } -struct seq_operations cpuinfo_op = { +const struct seq_operations cpuinfo_op = { .start = c_start, .next = c_next, .stop = c_stop,
arch/m32r/kernel/setup.c +1 -1
@@ -366,7 +366,7 @@ static void c_stop(struct seq_file *m, void *v) { } -struct seq_operations cpuinfo_op = { +const struct seq_operations cpuinfo_op = { .start = c_start, .next = c_next, .stop = c_stop,
arch/m68k/kernel/setup.c +1 -1
@@ -449,7 +449,7 @@ static void *c_next(struct seq_file *m, void *v, loff_t *pos)static void c_stop (struct seq_file *m,void *v) { } -struct seq_operations cpuinfo_op = { +const struct seq_operations cpuinfo_op = { .start = c_start, .next = c_next, .stop = c_stop,
arch/m68knommu/kernel/setup.c +1 -1
@@ -263,7 +263,7 @@ static void c_stop(struct seq_file *m, void *v) { } -struct seq_operations cpuinfo_op = { +const struct seq_operations cpuinfo_op = { .start = c_start, .next = c_next, .stop = c_stop,
arch/parisc/kernel/setup.c +1 -1
@@ -190,7 +190,7 @@ c_stop (struct seq_file *m, void *v) { } -struct seq_operations cpuinfo_op = { +const struct seq_operations cpuinfo_op = { .start = c_start, .next = c_next, .stop = c_stop,
arch/ppc/kernel/setup.c +1 -1
@@ -277,7 +277,7 @@ static void c_stop(struct seq_file *m, void *v) { } -struct seq_operations cpuinfo_op = { +const struct seq_operations cpuinfo_op = { .start =c_start, .next = c_next, .stop = c_stop,
arch/v850/kernel/procfs.c +1 -1
@@ -59,7 +59,7 @@ static void cpuinfo_stop (struct seq_file *m, void *v) { } -struct seq_operations cpuinfo_op = { +const struct seq_operations cpuinfo_op = { .start = cpuinfo_start, .next = cpuinfo_next, .stop = cpuinfo_stop,
arch/xtensa/kernel/setup.c +1 -1
@@ -469,7 +469,7 @@ c_stop(struct seq_file *f, void *v) { } -struct seq_operations cpuinfo_op = +const struct seq_operations cpuinfo_op = { start: c_start, next: c_next,
fs/proc/base.c +3 -3
@@ -435,7 +435,7 @@ static const struct inode_operations proc_def_inode_operations = { .setattr = proc_setattr, }; -extern struct seq_operations mounts_op; +extern const struct seq_operations mounts_op;struct proc_mounts {struct seq_file m;int event;
@@ -514,7 +514,7 @@ static const struct file_operations proc_mounts_operations = { .poll = mounts_poll, }; -extern struct seq_operations mountstats_op; +extern const struct seq_operations mountstats_op;static int mountstats_open (struct inode *inode,struct file *file) {int ret =seq_open (file, &mountstats_op);
@@ -895,7 +895,7 @@ static ssize_t clear_refs_write(struct file *file, const char __user *buf, return end - buffer; } -static struct file_operations proc_clear_refs_operations = { +static const struct file_operations proc_clear_refs_operations = { .write = clear_refs_write, };#endif
fs/proc/nommu.c +1 -1
@@ -116,7 +116,7 @@ static void *nommu_vma_list_next(struct seq_file *m, void *v, loff_t *pos)return rb_next ((struct rb_node *) v); } -static struct seq_operations proc_nommu_vma_list_seqop = { +static const struct seq_operations proc_nommu_vma_list_seqop = { .start = nommu_vma_list_start, .next = nommu_vma_list_next, .stop = nommu_vma_list_stop,
fs/proc/proc_misc.c +11 -11
@@ -216,7 +216,7 @@ static int meminfo_read_proc(char *page, char **start, off_t off,#undef K } -extern struct seq_operations fragmentation_op; +extern const struct seq_operations fragmentation_op;static int fragmentation_open (struct inode *inode,struct file *file) { (void )inode;
@@ -230,7 +230,7 @@ static const struct file_operations fragmentation_file_operations = { .release = seq_release, }; -extern struct seq_operations pagetypeinfo_op; +extern const struct seq_operations pagetypeinfo_op;static int pagetypeinfo_open (struct inode *inode,struct file *file) {return seq_open (file, &pagetypeinfo_op);
@@ -243,7 +243,7 @@ static const struct file_operations pagetypeinfo_file_ops = { .release = seq_release, }; -extern struct seq_operations zoneinfo_op; +extern const struct seq_operations zoneinfo_op;static int zoneinfo_open (struct inode *inode,struct file *file) {return seq_open (file, &zoneinfo_op);
@@ -268,7 +268,7 @@ static int version_read_proc(char *page, char **start, off_t off,return proc_calc_metrics (page, start, off, count, eof, len); } -extern struct seq_operations cpuinfo_op; +extern const struct seq_operations cpuinfo_op;static int cpuinfo_open (struct inode *inode,struct file *file) {return seq_open (file, &cpuinfo_op);
@@ -321,7 +321,7 @@ static void devinfo_stop(struct seq_file *f, void *v)/* Nothing to do */ } -static struct seq_operations devinfo_ops = { +static const struct seq_operations devinfo_ops = { .start = devinfo_start, .next = devinfo_next, .stop = devinfo_stop,
@@ -340,7 +340,7 @@ static const struct file_operations proc_devinfo_operations = { .release = seq_release, }; -extern struct seq_operations vmstat_op; +extern const struct seq_operations vmstat_op;static int vmstat_open (struct inode *inode,struct file *file) {return seq_open (file, &vmstat_op);
@@ -371,7 +371,7 @@ static int stram_read_proc(char *page, char **start, off_t off,#endif #ifdef CONFIG_BLOCK -extern struct seq_operations partitions_op; +extern const struct seq_operations partitions_op;static int partitions_open (struct inode *inode,struct file *file) {return seq_open (file, &partitions_op);
@@ -383,7 +383,7 @@ static const struct file_operations proc_partitions_operations = { .release = seq_release, }; -extern struct seq_operations diskstats_op; +extern const struct seq_operations diskstats_op;static int diskstats_open (struct inode *inode,struct file *file) {return seq_open (file, &diskstats_op);
@@ -397,7 +397,7 @@ static const struct file_operations proc_diskstats_operations = {#endif #ifdef CONFIG_MODULES -extern struct seq_operations modules_op; +extern const struct seq_operations modules_op;static int modules_open (struct inode *inode,struct file *file) {return seq_open (file, &modules_op);
@@ -424,7 +424,7 @@ static const struct file_operations proc_slabinfo_operations = { };#ifdef CONFIG_DEBUG_SLAB_LEAK -extern struct seq_operations slabstats_op; +extern const struct seq_operations slabstats_op;static int slabstats_open (struct inode *inode,struct file *file) {unsigned long *n =kzalloc (PAGE_SIZE ,GFP_KERNEL );
@@ -599,7 +599,7 @@ static void int_seq_stop(struct seq_file *f, void *v)extern int show_interrupts (struct seq_file *f,void *v);/* In arch code */ -static struct seq_operations int_seq_ops = { +static const struct seq_operations int_seq_ops = { .start = int_seq_start, .next = int_seq_next, .stop = int_seq_stop,
fs/proc/proc_sysctl.c +2 -2
@@ -9,7 +9,7 @@static struct dentry_operations proc_sys_dentry_operations;static const struct file_operations proc_sys_file_operations; -static struct inode_operations proc_sys_inode_operations; +static const struct inode_operations proc_sys_inode_operations;static void proc_sys_refresh_inode (struct inode *inode,struct ctl_table *table) {
@@ -446,7 +446,7 @@ static const struct file_operations proc_sys_file_operations = { .readdir = proc_sys_readdir, }; -static struct inode_operations proc_sys_inode_operations = { +static const struct inode_operations proc_sys_inode_operations = { .lookup = proc_sys_lookup, .permission = proc_sys_permission, .setattr = proc_sys_setattr,
fs/proc/proc_tty.c +1 -1
@@ -120,7 +120,7 @@ static void t_stop(struct seq_file *m, void *v)mutex_unlock (&tty_mutex); } -static struct seq_operations tty_drivers_op = { +static const struct seq_operations tty_drivers_op = { .start = t_start, .next = t_next, .stop = t_stop,
fs/proc/task_mmu.c +4 -4
@@ -467,14 +467,14 @@ static void m_stop(struct seq_file *m, void *v)put_task_struct (priv->task); } -static struct seq_operations proc_pid_maps_op = { +static const struct seq_operations proc_pid_maps_op = { .start = m_start, .next = m_next, .stop = m_stop, .show = show_map }; -static struct seq_operations proc_pid_smaps_op = { +static const struct seq_operations proc_pid_smaps_op = { .start = m_start, .next = m_next, .stop = m_stop,
@@ -482,7 +482,7 @@ static struct seq_operations proc_pid_smaps_op = { };static int do_maps_open (struct inode *inode,struct file *file, -struct seq_operations *ops) +const struct seq_operations *ops) {struct proc_maps_private *priv;int ret = -ENOMEM ;
@@ -526,7 +526,7 @@ static int show_numa_map_checked(struct seq_file *m, void *v)return show_numa_map (m, v); } -static struct seq_operations proc_pid_numa_maps_op = { +static const struct seq_operations proc_pid_numa_maps_op = { .start = m_start, .next = m_next, .stop = m_stop,
fs/proc/task_nommu.c +1 -1
@@ -199,7 +199,7 @@ static void *m_next(struct seq_file *m, void *_vml, loff_t *pos)return vml ? vml->next :NULL ; } -static struct seq_operations proc_pid_maps_ops = { +static const struct seq_operations proc_pid_maps_ops = { .start = m_start, .next = m_next, .stop = m_stop,
Signature · 1 line
1.5.3.4
Re: [PATCH] procfs: constify function pointer tables
Quoted 20 lines · Jan Engelhardt
This touches so many different places that I did not feel like creating a miniscule patch for each architecture. I hope that is ok.
===Patch begins===
[PATCH] procfs: constify function pointer tablesSigned-off-by Jan Engelhardt <[email protected]>--- arch/alpha/kernel/setup.c | 2 +- arch/blackfin/kernel/setup.c | 2 +- arch/cris/kernel/setup.c | 2 +- arch/frv/kernel/setup.c | 2 +- arch/h8300/kernel/setup.c | 2 +- arch/m32r/kernel/setup.c | 2 +- arch/m68k/kernel/setup.c | 2 +- arch/m68knommu/kernel/setup.c | 2 +- arch/parisc/kernel/setup.c | 2 +- arch/ppc/kernel/setup.c | 2 +- arch/v850/kernel/procfs.c | 2 +- arch/xtensa/kernel/setup.c | 2 +-
Quoted 8 lines
fs/proc/base.c | 6 +++--- fs/proc/nommu.c | 2 +- fs/proc/proc_misc.c | 22 +++++++++++----------- fs/proc/proc_sysctl.c | 4 ++-- fs/proc/proc_tty.c | 2 +- fs/proc/task_mmu.c | 8 ++++---- fs/proc/task_nommu.c | 2 +- 19 files changed, 35 insertions(+), 35 deletions(-)
m68k part is:
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH] procfs: constify function pointer tables
In reply to Jan EngelhardtQuoted 2 lines · Jan Engelhardt
This touches so many different places that I did not feel like creating a miniscule patch for each architecture. I hope that is ok.
there is a linux-arch alias so you dont have to look up every maintainer yourself ;)
Quoted 1 line
arch/blackfin/kernel/setup.c | 2 +-
Blackfin changes look fine, thanks
-mike
Re: [PATCH] procfs: constify function pointer tables
In reply to Jan EngelhardtFRV looks okay.
Re: [PATCH] procfs: constify function pointer tables
In reply to Jan EngelhardtHi Jan,
fs/proc/base.c static const struct inode_operations proc_def_inode_operations = { · line 438
Quoted 3 lines · On Tue, 22 Jan 2008 21:00:46 +0100 (CET) Jan Engelhardt…
fs/proc/base.c +1
-1-extern struct seq_operations mounts_op; +extern const struct seq_operations mounts_op;
[ and many others ... ]
I don't suppose you feel like finding appropriate header files to put these declarations into?
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Re: [PATCH] procfs: constify function pointer tables
In reply to Jan EngelhardtQuoted 50 lines · Jan Engelhardt
Hi,
This touches so many different places that I did not feel like creating a miniscule patch for each architecture. I hope that is ok.
===Patch begins===
[PATCH] procfs: constify function pointer tablesSigned-off-by Jan Engelhardt <[email protected]>--- arch/alpha/kernel/setup.c | 2 +- arch/blackfin/kernel/setup.c | 2 +- arch/cris/kernel/setup.c | 2 +- arch/frv/kernel/setup.c | 2 +- arch/h8300/kernel/setup.c | 2 +- arch/m32r/kernel/setup.c | 2 +- arch/m68k/kernel/setup.c | 2 +- arch/m68knommu/kernel/setup.c | 2 +- arch/parisc/kernel/setup.c | 2 +- arch/ppc/kernel/setup.c | 2 +- arch/v850/kernel/procfs.c | 2 +- arch/xtensa/kernel/setup.c | 2 +- fs/proc/base.c | 6 +++--- fs/proc/nommu.c | 2 +- fs/proc/proc_misc.c | 22 +++++++++++----------- fs/proc/proc_sysctl.c | 4 ++-- fs/proc/proc_tty.c | 2 +- fs/proc/task_mmu.c | 8 ++++---- fs/proc/task_nommu.c | 2 +- 19 files changed, 35 insertions(+), 35 deletions(-)arch/alpha/kernel/setup.c +1
-1@@ -1472,7 +1472,7 @@ c_stop(struct seq_file *f, void *v) { } -struct seq_operations cpuinfo_op = { +const struct seq_operations cpuinfo_op = { .start = c_start, .next = c_next, .stop = c_stop,arch/blackfin/kernel/setup.c +0
-0
arch/blackfin/kernel/setup.c static void c_stop(struct seq_file *m, void *v) · line 697
Quoted 8 lines
arch/blackfin/kernel/setup.c +1
-1@@ -691,7 +691,7 @@ static void c_stop(struct seq_file *m, void *v) { } -struct seq_operations cpuinfo_op = { +const struct seq_operations cpuinfo_op = { .start = c_start, .next = c_next, .stop = c_stop,
Thanks, I understand the seq_xxx() API needs "const struct seq_operations *". So for Blackfin part, I agree with Mike.
but there are still some other files need add "const":
---/opt/git-tree/blackfin-2.6$ grep -r seq_operations arch/* arch/alpha/kernel/setup.c:struct seq_operations cpuinfo_op = { arch/arm/kernel/setup.c:struct seq_operations cpuinfo_op = { arch/arm/mach-davinci/clock.c:static struct seq_operations davinci_ck_op = { arch/avr32/kernel/cpu.c:struct seq_operations cpuinfo_op = { arch/avr32/mm/tlb.c:static struct seq_operations tlb_ops = { arch/blackfin/kernel/setup.c:struct seq_operations cpuinfo_op = { arch/cris/kernel/setup.c:struct seq_operations cpuinfo_op = { arch/frv/kernel/setup.c:struct seq_operations cpuinfo_op = { arch/h8300/kernel/setup.c:struct seq_operations cpuinfo_op = { arch/ia64/hp/common/sba_iommu.c:static struct seq_operations ioc_seq_ops = { arch/ia64/kernel/perfmon.c:struct seq_operations pfm_seq_ops = { arch/ia64/kernel/setup.c:struct seq_operations cpuinfo_op = { arch/ia64/sn/kernel/sn2/sn2_smp.c:static struct seq_operations sn2_ptc_seq_ops = {
arch/ia64/sn/kernel/sn2/sn_hwperf.c:static struct seq_operations sn_topology_seq_ops = {
arch/m32r/kernel/setup.c:struct seq_operations cpuinfo_op = { arch/m68k/kernel/setup.c:struct seq_operations cpuinfo_op = { arch/m68knommu/kernel/setup.c:struct seq_operations cpuinfo_op = { arch/mips/kernel/proc.c:struct seq_operations cpuinfo_op = { arch/parisc/kernel/setup.c:struct seq_operations cpuinfo_op = { arch/powerpc/kernel/setup-common.c:struct seq_operations cpuinfo_op = {
----
[!snip!]
Regards,
-Bryan
Re: [PATCH] procfs: constify function pointer tables
Quoted 18 lines · Bryan Wu
Quoted 18 lines
[PATCH] procfs: constify function pointer tables
--- arch/alpha/kernel/setup.c | 2 +- arch/blackfin/kernel/setup.c | 2 +-[...]
arch/alpha/kernel/setup.c +1
-1@@ -1472,7 +1472,7 @@ c_stop(struct seq_file *f, void *v) { } -struct seq_operations cpuinfo_op = { +const struct seq_operations cpuinfo_op = { .start = c_start, .next = c_next, .stop = c_stop,
[...]
Quoted 7 lines
Thanks, I understand the
seq_xxx()API needs "const structseq_operations*". So for Blackfin part, I agree with Mike.but there are still some other files need add "const":
---/opt/git-tree/blackfin-2.6$grep -rseq_operationsarch/*arch/alpha/kernel/setup.c:structseq_operationscpuinfo_op= {
The patch already touches that :-)
Re: [PATCH] procfs: constify function pointer tables
Quoted 24 lines · Jan Engelhardt
Quoted 18 lines · Bryan Wu
Quoted 18 lines
[PATCH] procfs: constify function pointer tables
--- arch/alpha/kernel/setup.c | 2 +- arch/blackfin/kernel/setup.c | 2 +-[...]
arch/alpha/kernel/setup.c +1
-1@@ -1472,7 +1472,7 @@ c_stop(struct seq_file *f, void *v) { } -struct seq_operations cpuinfo_op = { +const struct seq_operations cpuinfo_op = { .start = c_start, .next = c_next, .stop = c_stop,[...]
Quoted 3 lines
Thanks, I understand the
seq_xxx()API needs "const structseq_operations*". So for Blackfin part, I agree with Mike.
Quoted 7 lines
Quoted 4 lines
but there are still some other files need add "const":
---/opt/git-tree/blackfin-2.6$grep -rseq_operationsarch/*arch/alpha/kernel/setup.c:structseq_operationscpuinfo_op= {The patch already touches that :-)
Oh, this patch does not touch all, following is the missing list:
---
arch/arm/kernel/setup.c:struct seq_operations cpuinfo_op = { arch/arm/mach-davinci/clock.c:static struct seq_operations davinci_ck_op = { arch/avr32/kernel/cpu.c:struct seq_operations cpuinfo_op = { arch/avr32/mm/tlb.c:static struct seq_operations tlb_ops = { arch/ia64/hp/common/sba_iommu.c:static struct seq_operations ioc_seq_ops = { arch/ia64/kernel/perfmon.c:struct seq_operations pfm_seq_ops = { arch/ia64/kernel/setup.c:struct seq_operations cpuinfo_op = { arch/ia64/sn/kernel/sn2/sn2_smp.c:static struct seq_operations sn2_ptc_seq_ops = {
arch/ia64/sn/kernel/sn2/sn_hwperf.c:static struct seq_operations sn_topology_seq_ops = {
arch/mips/kernel/proc.c:struct seq_operations cpuinfo_op = { arch/powerpc/kernel/setup-common.c:struct seq_operations cpuinfo_op = { arch/powerpc/platforms/pseries/hvCall_inst.c:static struct seq_operations hcall_inst_seq_ops = { arch/s390/kernel/setup.c:struct seq_operations cpuinfo_op = { arch/sh/kernel/setup.c:struct seq_operations cpuinfo_op = { arch/sh64/kernel/setup.c:struct seq_operations cpuinfo_op = { arch/sparc/kernel/setup.c:struct seq_operations cpuinfo_op = { arch/sparc64/kernel/setup.c:struct seq_operations cpuinfo_op = { arch/x86/kernel/cpu/proc.c:struct seq_operations cpuinfo_op = { arch/x86/kernel/setup_64.c:struct seq_operations cpuinfo_op = {
----
maybe you did not use the latest git tree.
-Bryan Wu
Re: [PATCH] procfs: constify function pointer tables
Quoted 2 lines · Bryan Wu
Oh, this patch does not touch all, following is the missing list:
---
[...]
Quoted 4 lines
arch/ia64/hp/common/sba_iommu.c:static struct
seq_operationsioc_seq_ops= { arch/ia64/kernel/perfmon.c:structseq_operationspfm_seq_ops= { arch/ia64/kernel/setup.c:structseq_operationscpuinfo_op= { arch/ia64/sn/kernel/sn2/sn2_smp.c:static structseq_operations
(and more)
[...]
They were sent as other separate patches to each maintainer. (without lkml, would have been a needless patchbomb.)
Re: [PATCH] procfs: constify function pointer tables
Quoted 9 lines · Jan Engelhardt
Quoted 2 lines · Bryan Wu
Oh, this patch does not touch all, following is the missing list:
---[...]
Quoted 4 lines
arch/ia64/hp/common/sba_iommu.c:static struct
seq_operationsioc_seq_ops= { arch/ia64/kernel/perfmon.c:structseq_operationspfm_seq_ops= { arch/ia64/kernel/setup.c:structseq_operationscpuinfo_op= { arch/ia64/sn/kernel/sn2/sn2_smp.c:static structseq_operations
Quoted 6 lines
(and more)
[...]They were sent as other separate patches to each maintainer. (without lkml, would have been a needless patchbomb.)
Oh, don't know that. I worried a lot, -:))
-Bryan
Re: [PATCH] procfs: constify function pointer tables
In reply to Jan EngelhardtQuoted 10 lines · Jan Engelhardt
Hi,
This touches so many different places that I did not feel like creating a miniscule patch for each architecture. I hope that is ok.
===Patch begins===
[PATCH] procfs: constify function pointer tablesSigned-off-by Jan Engelhardt <[email protected]>---
...
arch/cris/kernel/setup.c static void c_stop(struct seq_file *m, void *v) · line 186
Quoted 13 lines
arch/cris/kernel/setup.c +1
-1@@ -180,7 +180,7 @@ static void c_stop(struct seq_file *m, void *v)extern int show_cpuinfo (struct seq_file *m,void *v); -struct seq_operations cpuinfo_op = { +const struct seq_operations cpuinfo_op = { .start = c_start, .next = c_next, .stop = c_stop,
CRIS port:
/^JN - Jesper Nilsson
--
Jesper Nilsson -- [email protected]
PATCH 1/1 kernel: constify data and function pointer tables
In reply to a message not in the archiveHi,
this one also touches like any place that could be found, so I combined it.
===Patch begins here===
[PATCH] kernel: constify data and function pointer tables
--- drivers/char/apm-emulation.c | 2 +- drivers/char/drm/drmP.h | 6 +++--- drivers/char/misc.c | 2 +- drivers/char/tpm/tpm_bios.c | 4 ++-- drivers/isdn/capi/kcapi_proc.c | 10 +++++----- drivers/misc/phantom.c | 2 +- drivers/spi/spidev.c | 2 +- fs/afs/proc.c | 8 ++++---- fs/char_dev.c | 2 +- fs/debugfs/inode.c | 4 ++-- fs/hfsplus/inode.c | 2 +- fs/inode.c | 2 +- fs/locks.c | 2 +- fs/namespace.c | 4 ++-- include/linux/cgroup.h | 2 +- include/linux/fs.h | 2 +- ipc/util.c | 2 +- kernel/cgroup.c | 12 ++++++------ kernel/kprobes.c | 6 +++--- kernel/lockdep_proc.c | 2 +- kernel/time/timer_list.c | 2 +- kernel/time/timer_stats.c | 2 +- samples/markers/marker-example.c | 2 +- 23 files changed, 42 insertions(+), 42 deletions(-)
drivers/char/apm-emulation.c +1 -1
@@ -438,7 +438,7 @@ static int apm_open(struct inode * inode, struct file * filp)return as ?0 : -ENOMEM ; } -static struct file_operations apm_bios_fops = { +static const struct file_operations apm_bios_fops = { .owner =THIS_MODULE , .read = apm_read, .poll = apm_poll,
drivers/char/drm/drmP.h +3 -3
@@ -612,9 +612,9 @@ struct drm_driver {int major;int minor;int patchlevel; -char *name; -char *desc; -char *date; +const char *name; +const char *desc; +const char *date;u32 driver_features;int dev_priv_size;
drivers/char/misc.c +1 -1
@@ -90,7 +90,7 @@ static int misc_seq_show(struct seq_file *seq, void *v) } -static struct seq_operations misc_seq_ops = { +static const struct seq_operations misc_seq_ops = { .start = misc_seq_start, .next = misc_seq_next, .stop = misc_seq_stop,
drivers/char/tpm/tpm_bios.c +2 -2
@@ -344,14 +344,14 @@ static int tpm_ascii_bios_measurements_show(struct seq_file *m, void *v)return 0 ; } -static struct seq_operations tpm_ascii_b_measurments_seqops = { +static const struct seq_operations tpm_ascii_b_measurments_seqops = { .start = tpm_bios_measurements_start, .next = tpm_bios_measurements_next, .stop = tpm_bios_measurements_stop, .show = tpm_ascii_bios_measurements_show, }; -static struct seq_operations tpm_binary_b_measurments_seqops = { +static const struct seq_operations tpm_binary_b_measurments_seqops = { .start = tpm_bios_measurements_start, .next = tpm_bios_measurements_next, .stop = tpm_bios_measurements_stop,
drivers/isdn/capi/kcapi_proc.c +5 -5
@@ -89,14 +89,14 @@ static int contrstats_show(struct seq_file *seq, void *v)return 0 ; } -static struct seq_operations seq_controller_ops = { +static const struct seq_operations seq_controller_ops = { .start = controller_start, .next = controller_next, .stop = controller_stop, .show = controller_show, }; -static struct seq_operations seq_contrstats_ops = { +static const struct seq_operations seq_contrstats_ops = { .start = controller_start, .next = controller_next, .stop = controller_stop,
@@ -192,14 +192,14 @@ applstats_show(struct seq_file *seq, void *v)return 0 ; } -static struct seq_operations seq_applications_ops = { +static const struct seq_operations seq_applications_ops = { .start = applications_start, .next = applications_next, .stop = applications_stop, .show = applications_show, }; -static struct seq_operations seq_applstats_ops = { +static const struct seq_operations seq_applstats_ops = { .start = applications_start, .next = applications_next, .stop = applications_stop,
@@ -267,7 +267,7 @@ static int capi_driver_show(struct seq_file *seq, void *v)return 0 ; } -static struct seq_operations seq_capi_driver_ops = { +static const struct seq_operations seq_capi_driver_ops = { .start = capi_driver_start, .next = capi_driver_next, .stop = capi_driver_stop,
drivers/misc/phantom.c +1 -1
@@ -249,7 +249,7 @@ static unsigned int phantom_poll(struct file *file, poll_table *wait)return mask; } -static struct file_operations phantom_file_ops = { +static const struct file_operations phantom_file_ops = { .open = phantom_open, .release = phantom_release, .unlocked_ioctl = phantom_ioctl,
drivers/spi/spidev.c +1 -1
@@ -439,7 +439,7 @@ static int spidev_release(struct inode *inode, struct file *filp)return status; } -static struct file_operations spidev_fops = { +static const struct file_operations spidev_fops = { .owner =THIS_MODULE ,/* REVISIT switch to aio primitives, so that userspace * gets more complete API coverage. It'll simplify things
fs/afs/proc.c +4 -4
@@ -28,7 +28,7 @@ static int afs_proc_cells_show(struct seq_file *m, void *v);static ssize_t afs_proc_cells_write (struct file *file,const char __user *buf,size_t size,loff_t *_pos); -static struct seq_operations afs_proc_cells_ops = { +static const struct seq_operations afs_proc_cells_ops = { .start = afs_proc_cells_start, .next = afs_proc_cells_next, .stop = afs_proc_cells_stop,
@@ -68,7 +68,7 @@ static void *afs_proc_cell_volumes_next(struct seq_file *p, void *v,static void afs_proc_cell_volumes_stop (struct seq_file *p,void *v);static int afs_proc_cell_volumes_show (struct seq_file *m,void *v); -static struct seq_operations afs_proc_cell_volumes_ops = { +static const struct seq_operations afs_proc_cell_volumes_ops = { .start = afs_proc_cell_volumes_start, .next = afs_proc_cell_volumes_next, .stop = afs_proc_cell_volumes_stop,
@@ -92,7 +92,7 @@ static void *afs_proc_cell_vlservers_next(struct seq_file *p, void *v,static void afs_proc_cell_vlservers_stop (struct seq_file *p,void *v);static int afs_proc_cell_vlservers_show (struct seq_file *m,void *v); -static struct seq_operations afs_proc_cell_vlservers_ops = { +static const struct seq_operations afs_proc_cell_vlservers_ops = { .start = afs_proc_cell_vlservers_start, .next = afs_proc_cell_vlservers_next, .stop = afs_proc_cell_vlservers_stop,
@@ -115,7 +115,7 @@ static void *afs_proc_cell_servers_next(struct seq_file *p, void *v,static void afs_proc_cell_servers_stop (struct seq_file *p,void *v);static int afs_proc_cell_servers_show (struct seq_file *m,void *v); -static struct seq_operations afs_proc_cell_servers_ops = { +static const struct seq_operations afs_proc_cell_servers_ops = { .start = afs_proc_cell_servers_start, .next = afs_proc_cell_servers_next, .stop = afs_proc_cell_servers_stop,
fs/char_dev.c +1 -1
@@ -55,7 +55,7 @@ static struct char_device_struct {unsigned int baseminor;int minorct;char name[64 ]; -struct file_operations *fops; +const struct file_operations *fops;struct cdev *cdev;/* will die */ } *chrdevs[CHRDEV_MAJOR_HASH_SIZE ];
fs/debugfs/inode.c +2 -2
@@ -30,8 +30,8 @@#define DEBUGFS_MAGIC 0x64626720/* declared over in file.c */ -extern struct file_operations debugfs_file_operations; -extern struct inode_operations debugfs_link_operations; +extern const struct file_operations debugfs_file_operations; +extern const struct inode_operations debugfs_link_operations;static struct vfsmount *debugfs_mount;static int debugfs_mount_count;
fs/hfsplus/inode.c +1 -1
@@ -279,7 +279,7 @@ static int hfsplus_file_release(struct inode *inode, struct file *file) }extern const struct inode_operations hfsplus_dir_inode_operations; -extern struct file_operations hfsplus_dir_operations; +extern const struct file_operations hfsplus_dir_operations;static const struct inode_operations hfsplus_file_inode_operations = { .lookup = hfsplus_file_lookup,
fs/inode.c +1 -1
@@ -111,7 +111,7 @@ static void wake_up_inode(struct inode *inode)static struct inode *alloc_inode (struct super_block *sb) {static const struct address_space_operations empty_aops; -static struct inode_operations empty_iops; +static const struct inode_operations empty_iops;static const struct file_operations empty_fops;struct inode *inode;
fs/locks.c +1 -1
@@ -2177,7 +2177,7 @@ static void locks_stop(struct seq_file *f, void *v)unlock_kernel (); } -struct seq_operations locks_seq_operations = { +const struct seq_operations locks_seq_operations = { .start = locks_start, .next = locks_next, .stop = locks_stop,
fs/namespace.c +2 -2
@@ -391,7 +391,7 @@ static int show_vfsmnt(struct seq_file *m, void *v)return err; } -struct seq_operations mounts_op = { +const struct seq_operations mounts_op = { .start = m_start, .next = m_next, .stop = m_stop,
@@ -429,7 +429,7 @@ static int show_vfsstat(struct seq_file *m, void *v)return err; } -struct seq_operations mountstats_op = { +const struct seq_operations mountstats_op = { .start = m_start, .next = m_next, .stop = m_stop,
include/linux/cgroup.h +1 -1
@@ -33,7 +33,7 @@ extern void cgroup_exit(struct task_struct *p, int run_callbacks);extern int cgroupstats_build (struct cgroupstats *stats,struct dentry *dentry); -extern struct file_operations proc_cgroup_operations; +extern const struct file_operations proc_cgroup_operations;/* Define the enumeration of all cgroup subsystems */ #define SUBSYS (_x) _x ## _subsys_id,
include/linux/fs.h +1 -1
@@ -939,7 +939,7 @@ extern int vfs_setlease(struct file *, long, struct file_lock **);extern int lease_modify (struct file_lock **,int );extern int lock_may_read (struct inode *,loff_t start,unsigned long count);extern int lock_may_write (struct inode *,loff_t start,unsigned long count); -extern struct seq_operations locks_seq_operations; +extern const struct seq_operations locks_seq_operations;struct fasync_struct {int magic;
ipc/util.c +1 -1
@@ -901,7 +901,7 @@ static int sysvipc_proc_show(struct seq_file *s, void *it)return iface->show (s, it); } -static struct seq_operations sysvipc_proc_seqops = { +static const struct seq_operations sysvipc_proc_seqops = { .start = sysvipc_proc_start, .stop = sysvipc_proc_stop, .next = sysvipc_proc_next,
kernel/cgroup.c +6 -6
@@ -564,8 +564,8 @@ void cgroup_unlock(void)static int cgroup_mkdir (struct inode *dir,struct dentry *dentry,int mode);static int cgroup_rmdir (struct inode *unused_dir,struct dentry *dentry);static int cgroup_populate_dir (struct cgroup *cgrp); -static struct inode_operations cgroup_dir_inode_operations; -static struct file_operations proc_cgroupstats_operations; +static const struct inode_operations cgroup_dir_inode_operations; +static const struct file_operations proc_cgroupstats_operations;static struct backing_dev_info cgroup_backing_dev_info = { .capabilities =BDI_CAP_NO_ACCT_DIRTY |BDI_CAP_NO_WRITEBACK ,
@@ -1510,7 +1510,7 @@ static int cgroup_rename(struct inode *old_dir, struct dentry *old_dentry,return simple_rename (old_dir, old_dentry, new_dir, new_dentry); } -static struct file_operations cgroup_file_operations = { +static const struct file_operations cgroup_file_operations = { .read = cgroup_file_read, .write = cgroup_file_write, .llseek = generic_file_llseek,
@@ -1518,7 +1518,7 @@ static struct file_operations cgroup_file_operations = { .release = cgroup_file_release, }; -static struct inode_operations cgroup_dir_inode_operations = { +static const struct inode_operations cgroup_dir_inode_operations = { .lookup = simple_lookup, .mkdir = cgroup_mkdir, .rmdir = cgroup_rmdir,
@@ -2390,7 +2390,7 @@ static int cgroup_open(struct inode *inode, struct file *file)return single_open (file, proc_cgroup_show, pid); } -struct file_operations proc_cgroup_operations = { +const struct file_operations proc_cgroup_operations = { .open = cgroup_open, .read = seq_read, .llseek = seq_lseek,
@@ -2419,7 +2419,7 @@ static int cgroupstats_open(struct inode *inode, struct file *file)return single_open (file, proc_cgroupstats_show,0 ); } -static struct file_operations proc_cgroupstats_operations = { +static const struct file_operations proc_cgroupstats_operations = { .open = cgroupstats_open, .read = seq_read, .llseek = seq_lseek,
kernel/kprobes.c +3 -3
@@ -889,7 +889,7 @@ static int __kprobes show_kprobe_addr(struct seq_file *pi, void *v)return 0 ; } -static struct seq_operations kprobes_seq_ops = { +static const struct seq_operations kprobes_seq_ops = { .start = kprobe_seq_start, .next = kprobe_seq_next, .stop = kprobe_seq_stop,
@@ -901,7 +901,7 @@ static int __kprobes kprobes_open(struct inode *inode, struct file *filp)return seq_open (filp, &kprobes_seq_ops); } -static struct file_operations debugfs_kprobes_operations = { +static const struct file_operations debugfs_kprobes_operations = { .open = kprobes_open, .read = seq_read, .llseek = seq_lseek,
@@ -1013,7 +1013,7 @@ static ssize_t write_enabled_file_bool(struct file *file,return count; } -static struct file_operations fops_kp = { +static const struct file_operations fops_kp = { .read = read_enabled_file_bool, .write = write_enabled_file_bool, };
kernel/lockdep_proc.c +1 -1
@@ -581,7 +581,7 @@ static int ls_show(struct seq_file *m, void *v)return 0 ; } -static struct seq_operations lockstat_ops = { +static const struct seq_operations lockstat_ops = { .start = ls_start, .next = ls_next, .stop = ls_stop,
kernel/time/timer_list.c +1 -1
@@ -265,7 +265,7 @@ static int timer_list_open(struct inode *inode, struct file *filp)return single_open (filp, timer_list_show,NULL ); } -static struct file_operations timer_list_fops = { +static const struct file_operations timer_list_fops = { .open = timer_list_open, .read = seq_read, .llseek = seq_lseek,
kernel/time/timer_stats.c +1 -1
@@ -395,7 +395,7 @@ static int tstats_open(struct inode *inode, struct file *filp)return single_open (filp, tstats_show,NULL ); } -static struct file_operations tstats_fops = { +static const struct file_operations tstats_fops = { .open = tstats_open, .read = seq_read, .write = tstats_write,
samples/markers/marker-example.c +1 -1
@@ -26,7 +26,7 @@ static int my_open(struct inode *inode, struct file *file)return -EPERM ; } -static struct file_operations mark_ops = { +static const struct file_operations mark_ops = { .open = my_open, };
Signature · 1 line
1.5.3.4