sysfs options: enable for r/w

From: Jan Engelhardt <jengelh@computergmbh.de>

References: http://lkml.org/lkml/2006/1/15/139
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---

 drivers/block/floppy.c               |    6 +++---
 drivers/cdrom/cdrom.c                |   12 ++++++------
 drivers/char/hangcheck-timer.c       |    8 ++++----
 drivers/net/dummy.c                  |    2 +-
 drivers/net/netconsole.c             |    2 +-
 fs/afs/main.c                        |    2 +-
 fs/jfs/jfs_txnmgr.c                  |    4 ++--
 fs/jfs/super.c                       |    2 +-
 fs/ntfs/super.c                      |    2 +-
 net/core/pktgen.c                    |    8 ++++----
 net/ipv4/netfilter/iptable_filter.c  |    2 +-
 net/ipv6/netfilter/ip6table_filter.c |    2 +-
 net/irda/irlan/irlan_common.c        |    4 ++--
 net/netrom/af_netrom.c               |    2 +-
 net/rose/af_rose.c                   |    2 +-
 net/sched/sch_teql.c                 |    2 +-
 16 files changed, 31 insertions(+), 31 deletions(-)


Index: linux-4.11-rc8/drivers/block/floppy.c
===================================================================
--- linux-4.11-rc8.orig/drivers/block/floppy.c
+++ linux-4.11-rc8/drivers/block/floppy.c
@@ -4622,9 +4622,9 @@ static void __exit floppy_module_exit(vo
 
 module_exit(floppy_module_exit);
 
-module_param(floppy, charp, 0);
-module_param(FLOPPY_IRQ, int, 0);
-module_param(FLOPPY_DMA, int, 0);
+module_param(floppy, charp, S_IRUGO);
+module_param(FLOPPY_IRQ, int, S_IRUGO);
+module_param(FLOPPY_DMA, int, S_IRUGO);
 MODULE_AUTHOR("Alain L. Knaff");
 MODULE_SUPPORTED_DEVICE("fd");
 MODULE_LICENSE("GPL");
Index: linux-4.11-rc8/drivers/cdrom/cdrom.c
===================================================================
--- linux-4.11-rc8.orig/drivers/cdrom/cdrom.c
+++ linux-4.11-rc8/drivers/cdrom/cdrom.c
@@ -294,12 +294,12 @@ static bool lockdoor = 1;
 static bool check_media_type;
 /* automatically restart mrw format */
 static bool mrw_format_restart = 1;
-module_param(debug, bool, 0);
-module_param(autoclose, bool, 0);
-module_param(autoeject, bool, 0);
-module_param(lockdoor, bool, 0);
-module_param(check_media_type, bool, 0);
-module_param(mrw_format_restart, bool, 0);
+module_param(debug, bool, S_IRUGO | S_IWUSR);
+module_param(autoclose, bool, S_IRUGO | S_IWUSR);
+module_param(autoeject, bool, S_IRUGO | S_IWUSR);
+module_param(lockdoor, bool, S_IRUGO | S_IWUSR);
+module_param(check_media_type, bool, S_IRUGO | S_IWUSR);
+module_param(mrw_format_restart, bool, S_IRUGO | S_IWUSR);
 
 static DEFINE_MUTEX(cdrom_mutex);
 
Index: linux-4.11-rc8/drivers/char/hangcheck-timer.c
===================================================================
--- linux-4.11-rc8.orig/drivers/char/hangcheck-timer.c
+++ linux-4.11-rc8/drivers/char/hangcheck-timer.c
@@ -62,13 +62,13 @@ static int hangcheck_reboot;  /* Default
 static int hangcheck_dump_tasks;  /* Defaults to not dumping SysRQ T */
 
 /* options - modular */
-module_param(hangcheck_tick, int, 0);
+module_param(hangcheck_tick, int, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(hangcheck_tick, "Timer delay.");
-module_param(hangcheck_margin, int, 0);
+module_param(hangcheck_margin, int, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(hangcheck_margin, "If the hangcheck timer has been delayed more than hangcheck_margin seconds, the driver will fire.");
-module_param(hangcheck_reboot, int, 0);
+module_param(hangcheck_reboot, int, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(hangcheck_reboot, "If nonzero, the machine will reboot when the timer margin is exceeded.");
-module_param(hangcheck_dump_tasks, int, 0);
+module_param(hangcheck_dump_tasks, int, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(hangcheck_dump_tasks, "If nonzero, the machine will dump the system task state when the timer margin is exceeded.");
 
 MODULE_AUTHOR("Oracle");
Index: linux-4.11-rc8/drivers/net/dummy.c
===================================================================
--- linux-4.11-rc8.orig/drivers/net/dummy.c
+++ linux-4.11-rc8/drivers/net/dummy.c
@@ -360,7 +360,7 @@ static struct rtnl_link_ops dummy_link_o
 };
 
 /* Number of dummy devices to be set up by this module. */
-module_param(numdummies, int, 0);
+module_param(numdummies, int, S_IRUGO);
 MODULE_PARM_DESC(numdummies, "Number of dummy pseudo devices");
 
 module_param(num_vfs, int, 0);
Index: linux-4.11-rc8/drivers/net/netconsole.c
===================================================================
--- linux-4.11-rc8.orig/drivers/net/netconsole.c
+++ linux-4.11-rc8/drivers/net/netconsole.c
@@ -57,7 +57,7 @@ MODULE_LICENSE("GPL");
 #define MAX_PRINT_CHUNK		1000
 
 static char config[MAX_PARAM_LENGTH];
-module_param_string(netconsole, config, MAX_PARAM_LENGTH, 0);
+module_param_string(netconsole, config, MAX_PARAM_LENGTH, S_IRUGO);
 MODULE_PARM_DESC(netconsole, " netconsole=[src-port]@[src-ip]/[dev],[tgt-port]@<tgt-ip>/[tgt-macaddr]");
 
 static bool oops_only = false;
Index: linux-4.11-rc8/fs/afs/main.c
===================================================================
--- linux-4.11-rc8.orig/fs/afs/main.c
+++ linux-4.11-rc8/fs/afs/main.c
@@ -28,7 +28,7 @@ MODULE_PARM_DESC(debug, "AFS debugging m
 
 static char *rootcell;
 
-module_param(rootcell, charp, 0);
+module_param(rootcell, charp, 0400);
 MODULE_PARM_DESC(rootcell, "root AFS cell name and VL server IP addr list");
 
 struct uuid_v1 afs_uuid;
Index: linux-4.11-rc8/fs/jfs/jfs_txnmgr.c
===================================================================
--- linux-4.11-rc8.orig/fs/jfs/jfs_txnmgr.c
+++ linux-4.11-rc8/fs/jfs/jfs_txnmgr.c
@@ -95,12 +95,12 @@ static struct {
 #endif
 
 static int nTxBlock = -1;	/* number of transaction blocks */
-module_param(nTxBlock, int, 0);
+module_param(nTxBlock, int, S_IRUGO);
 MODULE_PARM_DESC(nTxBlock,
 		 "Number of transaction blocks (max:65536)");
 
 static int nTxLock = -1;	/* number of transaction locks */
-module_param(nTxLock, int, 0);
+module_param(nTxLock, int, S_IRUGO);
 MODULE_PARM_DESC(nTxLock,
 		 "Number of transaction locks (max:65536)");
 
Index: linux-4.11-rc8/fs/jfs/super.c
===================================================================
--- linux-4.11-rc8.orig/fs/jfs/super.c
+++ linux-4.11-rc8/fs/jfs/super.c
@@ -58,7 +58,7 @@ static struct file_system_type jfs_fs_ty
 
 #define MAX_COMMIT_THREADS 64
 static int commit_threads;
-module_param(commit_threads, int, 0);
+module_param(commit_threads, int, S_IRUGO);
 MODULE_PARM_DESC(commit_threads, "Number of commit threads");
 
 static struct task_struct *jfsCommitThread[MAX_COMMIT_THREADS];
Index: linux-4.11-rc8/fs/ntfs/super.c
===================================================================
--- linux-4.11-rc8.orig/fs/ntfs/super.c
+++ linux-4.11-rc8/fs/ntfs/super.c
@@ -3205,7 +3205,7 @@ MODULE_DESCRIPTION("NTFS 1.2/3.x driver
 MODULE_VERSION(NTFS_VERSION);
 MODULE_LICENSE("GPL");
 #ifdef DEBUG
-module_param(debug_msgs, bint, 0);
+module_param(debug_msgs, bint, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug_msgs, "Enable debug messages.");
 #endif
 
Index: linux-4.11-rc8/net/core/pktgen.c
===================================================================
--- linux-4.11-rc8.orig/net/core/pktgen.c
+++ linux-4.11-rc8/net/core/pktgen.c
@@ -3963,11 +3963,11 @@ MODULE_AUTHOR("Robert Olsson <robert.ols
 MODULE_DESCRIPTION("Packet Generator tool");
 MODULE_LICENSE("GPL");
 MODULE_VERSION(VERSION);
-module_param(pg_count_d, int, 0);
+module_param(pg_count_d, int, S_IRUSR);
 MODULE_PARM_DESC(pg_count_d, "Default number of packets to inject");
-module_param(pg_delay_d, int, 0);
+module_param(pg_delay_d, int, S_IRUSR);
 MODULE_PARM_DESC(pg_delay_d, "Default delay between packets (nanoseconds)");
-module_param(pg_clone_skb_d, int, 0);
+module_param(pg_clone_skb_d, int, S_IRUSR);
 MODULE_PARM_DESC(pg_clone_skb_d, "Default number of copies of the same packet");
-module_param(debug, int, 0);
+module_param(debug, int, S_IRUGO);
 MODULE_PARM_DESC(debug, "Enable debugging of pktgen module");
Index: linux-4.11-rc8/net/ipv4/netfilter/iptable_filter.c
===================================================================
--- linux-4.11-rc8.orig/net/ipv4/netfilter/iptable_filter.c
+++ linux-4.11-rc8/net/ipv4/netfilter/iptable_filter.c
@@ -51,7 +51,7 @@ static struct nf_hook_ops *filter_ops __
 
 /* Default to forward because I got too much mail already. */
 static bool forward __read_mostly = true;
-module_param(forward, bool, 0000);
+module_param(forward, bool, 0644);
 
 static int __net_init iptable_filter_table_init(struct net *net)
 {
Index: linux-4.11-rc8/net/ipv6/netfilter/ip6table_filter.c
===================================================================
--- linux-4.11-rc8.orig/net/ipv6/netfilter/ip6table_filter.c
+++ linux-4.11-rc8/net/ipv6/netfilter/ip6table_filter.c
@@ -45,7 +45,7 @@ static struct nf_hook_ops *filter_ops __
 
 /* Default to forward because I got too much mail already. */
 static bool forward = true;
-module_param(forward, bool, 0000);
+module_param(forward, bool, 0644);
 
 static int __net_init ip6table_filter_table_init(struct net *net)
 {
Index: linux-4.11-rc8/net/irda/irlan/irlan_common.c
===================================================================
--- linux-4.11-rc8.orig/net/irda/irlan/irlan_common.c
+++ linux-4.11-rc8/net/irda/irlan/irlan_common.c
@@ -1166,9 +1166,9 @@ MODULE_AUTHOR("Dag Brattli <dagb@cs.uit.
 MODULE_DESCRIPTION("The Linux IrDA LAN protocol");
 MODULE_LICENSE("GPL");
 
-module_param(eth, bool, 0);
+module_param(eth, bool, S_IRUGO);
 MODULE_PARM_DESC(eth, "Name devices ethX (0) or irlanX (1)");
-module_param(access, int, 0);
+module_param(access, int, S_IRUGO);
 MODULE_PARM_DESC(access, "Access type DIRECT=1, PEER=2, HOSTED=3");
 
 module_init(irlan_init);
Index: linux-4.11-rc8/net/netrom/af_netrom.c
===================================================================
--- linux-4.11-rc8.orig/net/netrom/af_netrom.c
+++ linux-4.11-rc8/net/netrom/af_netrom.c
@@ -1468,7 +1468,7 @@ fail:
 
 module_init(nr_proto_init);
 
-module_param(nr_ndevs, int, 0);
+module_param(nr_ndevs, int, S_IRUGO);
 MODULE_PARM_DESC(nr_ndevs, "number of NET/ROM devices");
 
 MODULE_AUTHOR("Jonathan Naylor G4KLX <g4klx@g4klx.demon.co.uk>");
Index: linux-4.11-rc8/net/rose/af_rose.c
===================================================================
--- linux-4.11-rc8.orig/net/rose/af_rose.c
+++ linux-4.11-rc8/net/rose/af_rose.c
@@ -1589,7 +1589,7 @@ out_proto_unregister:
 }
 module_init(rose_proto_init);
 
-module_param(rose_ndevs, int, 0);
+module_param(rose_ndevs, int, S_IRUGO);
 MODULE_PARM_DESC(rose_ndevs, "number of ROSE devices");
 
 MODULE_AUTHOR("Jonathan Naylor G4KLX <g4klx@g4klx.demon.co.uk>");
Index: linux-4.11-rc8/net/sched/sch_teql.c
===================================================================
--- linux-4.11-rc8.orig/net/sched/sch_teql.c
+++ linux-4.11-rc8/net/sched/sch_teql.c
@@ -466,7 +466,7 @@ static __init void teql_master_setup(str
 
 static LIST_HEAD(master_dev_list);
 static int max_equalizers = 1;
-module_param(max_equalizers, int, 0);
+module_param(max_equalizers, int, S_IRUGO);
 MODULE_PARM_DESC(max_equalizers, "Max number of link equalizers");
 
 static int __init teql_init(void)
