[Xen-devel] [PATCH 0096/1285] Replace numeric parameter like 0444 with macro

2016-08-02 Thread Baole Ni
I find that the developers often just specified the numeric value
when calling a macro which is defined with a parameter for access permission.
As we know, these numeric value for access permission have had the 
corresponding macro,
and that using macro can improve the robustness and readability of the code,
thus, I suggest replacing the numeric parameter with the macro.

Signed-off-by: Chuansheng Liu 
Signed-off-by: Baole Ni 
---
 drivers/block/xen-blkback/blkback.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/block/xen-blkback/blkback.c 
b/drivers/block/xen-blkback/blkback.c
index 4809c15..73251ce 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -63,7 +63,7 @@
  */
 
 static int xen_blkif_max_buffer_pages = 1024;
-module_param_named(max_buffer_pages, xen_blkif_max_buffer_pages, int, 0644);
+module_param_named(max_buffer_pages, xen_blkif_max_buffer_pages, int, S_IRUSR 
| S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(max_buffer_pages,
 "Maximum number of free pages to keep in each block backend buffer");
 
@@ -79,7 +79,7 @@ MODULE_PARM_DESC(max_buffer_pages,
  */
 
 static int xen_blkif_max_pgrants = 1056;
-module_param_named(max_persistent_grants, xen_blkif_max_pgrants, int, 0644);
+module_param_named(max_persistent_grants, xen_blkif_max_pgrants, int, S_IRUSR 
| S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(max_persistent_grants,
  "Maximum number of grants to map persistently");
 
@@ -88,7 +88,7 @@ MODULE_PARM_DESC(max_persistent_grants,
  * are CPUs if user has not specified a value.
  */
 unsigned int xenblk_max_queues;
-module_param_named(max_queues, xenblk_max_queues, uint, 0644);
+module_param_named(max_queues, xenblk_max_queues, uint, S_IRUSR | S_IWUSR | 
S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(max_queues,
 "Maximum number of hardware queues per virtual disk." \
 "By default it is the number of online CPUs.");
@@ -116,7 +116,7 @@ MODULE_PARM_DESC(max_ring_page_order, "Maximum order of 
pages to be used for the
 
 /* Run-time switchable: /sys/module/blkback/parameters/ */
 static unsigned int log_stats;
-module_param(log_stats, int, 0644);
+module_param(log_stats, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 
 #define BLKBACK_INVALID_HANDLE (~0)
 
-- 
2.9.2


___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


[Xen-devel] [PATCH 0806/1285] Replace numeric parameter like 0444 with macro

2016-08-02 Thread Baole Ni
I find that the developers often just specified the numeric value
when calling a macro which is defined with a parameter for access permission.
As we know, these numeric value for access permission have had the 
corresponding macro,
and that using macro can improve the robustness and readability of the code,
thus, I suggest replacing the numeric parameter with the macro.

Signed-off-by: Chuansheng Liu 
Signed-off-by: Baole Ni 
---
 drivers/net/xen-netfront.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 96ccd4e..70c86fa 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -58,7 +58,7 @@
 
 /* Module parameters */
 static unsigned int xennet_max_queues;
-module_param_named(max_queues, xennet_max_queues, uint, 0644);
+module_param_named(max_queues, xennet_max_queues, uint, S_IRUSR | S_IWUSR | 
S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(max_queues,
 "Maximum number of queues per virtual interface");
 
-- 
2.9.2


___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


[Xen-devel] [PATCH 0805/1285] Replace numeric parameter like 0444 with macro

2016-08-02 Thread Baole Ni
I find that the developers often just specified the numeric value
when calling a macro which is defined with a parameter for access permission.
As we know, these numeric value for access permission have had the 
corresponding macro,
and that using macro can improve the robustness and readability of the code,
thus, I suggest replacing the numeric parameter with the macro.

Signed-off-by: Chuansheng Liu 
Signed-off-by: Baole Ni 
---
 drivers/net/xen-netback/netback.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/xen-netback/netback.c 
b/drivers/net/xen-netback/netback.c
index edbae0b..e6e6598 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -53,22 +53,22 @@
  * enabled by default.
  */
 bool separate_tx_rx_irq = true;
-module_param(separate_tx_rx_irq, bool, 0644);
+module_param(separate_tx_rx_irq, bool, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 
 /* The time that packets can stay on the guest Rx internal queue
  * before they are dropped.
  */
 unsigned int rx_drain_timeout_msecs = 1;
-module_param(rx_drain_timeout_msecs, uint, 0444);
+module_param(rx_drain_timeout_msecs, uint, S_IRUSR | S_IRGRP | S_IROTH);
 
 /* The length of time before the frontend is considered unresponsive
  * because it isn't providing Rx slots.
  */
 unsigned int rx_stall_timeout_msecs = 6;
-module_param(rx_stall_timeout_msecs, uint, 0444);
+module_param(rx_stall_timeout_msecs, uint, S_IRUSR | S_IRGRP | S_IROTH);
 
 unsigned int xenvif_max_queues;
-module_param_named(max_queues, xenvif_max_queues, uint, 0644);
+module_param_named(max_queues, xenvif_max_queues, uint, S_IRUSR | S_IWUSR | 
S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(max_queues,
 "Maximum number of queues per virtual interface");
 
@@ -78,7 +78,7 @@ MODULE_PARM_DESC(max_queues,
  */
 #define FATAL_SKB_SLOTS_DEFAULT 20
 static unsigned int fatal_skb_slots = FATAL_SKB_SLOTS_DEFAULT;
-module_param(fatal_skb_slots, uint, 0444);
+module_param(fatal_skb_slots, uint, S_IRUSR | S_IRGRP | S_IROTH);
 
 /* The amount to copy out of the first guest Tx slot into the skb's
  * linear area.  If the first slot has more data, it will be mapped
@@ -92,7 +92,7 @@ module_param(fatal_skb_slots, uint, 0444);
 /* This is the maximum number of flows in the hash cache. */
 #define XENVIF_HASH_CACHE_SIZE_DEFAULT 64
 unsigned int xenvif_hash_cache_size = XENVIF_HASH_CACHE_SIZE_DEFAULT;
-module_param_named(hash_cache_size, xenvif_hash_cache_size, uint, 0644);
+module_param_named(hash_cache_size, xenvif_hash_cache_size, uint, S_IRUSR | 
S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(hash_cache_size, "Number of flows in the hash cache");
 
 static void xenvif_idx_release(struct xenvif_queue *queue, u16 pending_idx,
-- 
2.9.2


___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


[Xen-devel] [PATCH 0828/1285] Replace numeric parameter like 0444 with macro

2016-08-02 Thread Baole Ni
I find that the developers often just specified the numeric value
when calling a macro which is defined with a parameter for access permission.
As we know, these numeric value for access permission have had the 
corresponding macro,
and that using macro can improve the robustness and readability of the code,
thus, I suggest replacing the numeric parameter with the macro.

Signed-off-by: Chuansheng Liu 
Signed-off-by: Baole Ni 
---
 drivers/pci/xen-pcifront.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
index 5f70fee..4008d5f 100644
--- a/drivers/pci/xen-pcifront.c
+++ b/drivers/pci/xen-pcifront.c
@@ -77,7 +77,7 @@ static DEFINE_SPINLOCK(pcifront_dev_lock);
 static struct pcifront_device *pcifront_dev;
 
 static int verbose_request;
-module_param(verbose_request, int, 0644);
+module_param(verbose_request, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 
 static int errno_to_pcibios_err(int errno)
 {
-- 
2.9.2


___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


[Xen-devel] [PATCH 1028/1285] Replace numeric parameter like 0444 with macro

2016-08-02 Thread Baole Ni
I find that the developers often just specified the numeric value
when calling a macro which is defined with a parameter for access permission.
As we know, these numeric value for access permission have had the 
corresponding macro,
and that using macro can improve the robustness and readability of the code,
thus, I suggest replacing the numeric parameter with the macro.

Signed-off-by: Chuansheng Liu 
Signed-off-by: Baole Ni 
---
 drivers/xen/gntalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/gntalloc.c b/drivers/xen/gntalloc.c
index 4547a91..1451b98 100644
--- a/drivers/xen/gntalloc.c
+++ b/drivers/xen/gntalloc.c
@@ -71,7 +71,7 @@
 #include 
 
 static int limit = 1024;
-module_param(limit, int, 0644);
+module_param(limit, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(limit, "Maximum number of grants that may be allocated by "
"the gntalloc device");
 
-- 
2.9.2


___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


[Xen-devel] [PATCH 1030/1285] Replace numeric parameter like 0444 with macro

2016-08-02 Thread Baole Ni
I find that the developers often just specified the numeric value
when calling a macro which is defined with a parameter for access permission.
As we know, these numeric value for access permission have had the 
corresponding macro,
and that using macro can improve the robustness and readability of the code,
thus, I suggest replacing the numeric parameter with the macro.

Signed-off-by: Chuansheng Liu 
Signed-off-by: Baole Ni 
---
 drivers/xen/xen-acpi-processor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-processor.c
index 076970a..3d2d055 100644
--- a/drivers/xen/xen-acpi-processor.c
+++ b/drivers/xen/xen-acpi-processor.c
@@ -36,7 +36,7 @@
 
 static int no_hypercall;
 MODULE_PARM_DESC(off, "Inhibit the hypercall.");
-module_param_named(off, no_hypercall, int, 0400);
+module_param_named(off, no_hypercall, int, S_IRUSR);
 
 /*
  * Note: Do not convert the acpi_id* below to cpumask_var_t or use cpumask_bit
-- 
2.9.2


___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


[Xen-devel] [PATCH 1029/1285] Replace numeric parameter like 0444 with macro

2016-08-02 Thread Baole Ni
I find that the developers often just specified the numeric value
when calling a macro which is defined with a parameter for access permission.
As we know, these numeric value for access permission have had the 
corresponding macro,
and that using macro can improve the robustness and readability of the code,
thus, I suggest replacing the numeric parameter with the macro.

Signed-off-by: Chuansheng Liu 
Signed-off-by: Baole Ni 
---
 drivers/xen/gntdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
index 6793957..8cb7759 100644
--- a/drivers/xen/gntdev.c
+++ b/drivers/xen/gntdev.c
@@ -51,7 +51,7 @@ MODULE_AUTHOR("Derek G. Murray , "
 MODULE_DESCRIPTION("User-space granted page access driver");
 
 static int limit = 1024*1024;
-module_param(limit, int, 0644);
+module_param(limit, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(limit, "Maximum number of grants that may be mapped by "
"the gntdev device");
 
-- 
2.9.2


___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


[Xen-devel] [PATCH 1032/1285] Replace numeric parameter like 0444 with macro

2016-08-02 Thread Baole Ni
I find that the developers often just specified the numeric value
when calling a macro which is defined with a parameter for access permission.
As we know, these numeric value for access permission have had the 
corresponding macro,
and that using macro can improve the robustness and readability of the code,
thus, I suggest replacing the numeric parameter with the macro.

Signed-off-by: Chuansheng Liu 
Signed-off-by: Baole Ni 
---
 drivers/xen/xen-pciback/conf_space.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/xen-pciback/conf_space.c 
b/drivers/xen/xen-pciback/conf_space.c
index 8e67336..e1fb906 100644
--- a/drivers/xen/xen-pciback/conf_space.c
+++ b/drivers/xen/xen-pciback/conf_space.c
@@ -17,7 +17,7 @@
 #include "conf_space_quirks.h"
 
 bool xen_pcibk_permissive;
-module_param_named(permissive, xen_pcibk_permissive, bool, 0644);
+module_param_named(permissive, xen_pcibk_permissive, bool, S_IRUSR | S_IWUSR | 
S_IRGRP | S_IROTH);
 
 /* This is where xen_pcibk_read_config_byte, xen_pcibk_read_config_word,
  * xen_pcibk_write_config_word, and xen_pcibk_write_config_byte are created. */
-- 
2.9.2


___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


[Xen-devel] [PATCH 1034/1285] Replace numeric parameter like 0444 with macro

2016-08-02 Thread Baole Ni
I find that the developers often just specified the numeric value
when calling a macro which is defined with a parameter for access permission.
As we know, these numeric value for access permission have had the 
corresponding macro,
and that using macro can improve the robustness and readability of the code,
thus, I suggest replacing the numeric parameter with the macro.

Signed-off-by: Chuansheng Liu 
Signed-off-by: Baole Ni 
---
 drivers/xen/xen-pciback/pciback_ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/xen-pciback/pciback_ops.c 
b/drivers/xen/xen-pciback/pciback_ops.c
index 2f19dd7..27e19c2 100644
--- a/drivers/xen/xen-pciback/pciback_ops.c
+++ b/drivers/xen/xen-pciback/pciback_ops.c
@@ -14,7 +14,7 @@
 #include "pciback.h"
 
 int verbose_request;
-module_param(verbose_request, int, 0644);
+module_param(verbose_request, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 
 static irqreturn_t xen_pcibk_guest_interrupt(int irq, void *dev_id);
 
-- 
2.9.2


___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


[Xen-devel] [PATCH 1033/1285] Replace numeric parameter like 0444 with macro

2016-08-02 Thread Baole Ni
I find that the developers often just specified the numeric value
when calling a macro which is defined with a parameter for access permission.
As we know, these numeric value for access permission have had the 
corresponding macro,
and that using macro can improve the robustness and readability of the code,
thus, I suggest replacing the numeric parameter with the macro.

Signed-off-by: Chuansheng Liu 
Signed-off-by: Baole Ni 
---
 drivers/xen/xen-pciback/pci_stub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/xen-pciback/pci_stub.c 
b/drivers/xen/xen-pciback/pci_stub.c
index 258b7c3..cf67c9c 100644
--- a/drivers/xen/xen-pciback/pci_stub.c
+++ b/drivers/xen/xen-pciback/pci_stub.c
@@ -31,7 +31,7 @@ wait_queue_head_t xen_pcibk_aer_wait_queue;
 * We want to avoid in middle of AER ops, xen_pcibk devices is being removed
 */
 static DECLARE_RWSEM(pcistub_sem);
-module_param_named(hide, pci_devs_to_hide, charp, 0444);
+module_param_named(hide, pci_devs_to_hide, charp, S_IRUSR | S_IRGRP | S_IROTH);
 
 struct pcistub_device_id {
struct list_head slot_list;
-- 
2.9.2


___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


[Xen-devel] [PATCH 1031/1285] Replace numeric parameter like 0444 with macro

2016-08-02 Thread Baole Ni
I find that the developers often just specified the numeric value
when calling a macro which is defined with a parameter for access permission.
As we know, these numeric value for access permission have had the 
corresponding macro,
and that using macro can improve the robustness and readability of the code,
thus, I suggest replacing the numeric parameter with the macro.

Signed-off-by: Chuansheng Liu 
Signed-off-by: Baole Ni 
---
 drivers/xen/xen-balloon.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/xen/xen-balloon.c b/drivers/xen/xen-balloon.c
index 79865b8..0a8cad2 100644
--- a/drivers/xen/xen-balloon.c
+++ b/drivers/xen/xen-balloon.c
@@ -124,10 +124,10 @@ BALLOON_SHOW(current_kb, "%lu\n", 
PAGES2KB(balloon_stats.current_pages));
 BALLOON_SHOW(low_kb, "%lu\n", PAGES2KB(balloon_stats.balloon_low));
 BALLOON_SHOW(high_kb, "%lu\n", PAGES2KB(balloon_stats.balloon_high));
 
-static DEVICE_ULONG_ATTR(schedule_delay, 0444, balloon_stats.schedule_delay);
-static DEVICE_ULONG_ATTR(max_schedule_delay, 0644, 
balloon_stats.max_schedule_delay);
-static DEVICE_ULONG_ATTR(retry_count, 0444, balloon_stats.retry_count);
-static DEVICE_ULONG_ATTR(max_retry_count, 0644, balloon_stats.max_retry_count);
+static DEVICE_ULONG_ATTR(schedule_delay, S_IRUSR | S_IRGRP | S_IROTH, 
balloon_stats.schedule_delay);
+static DEVICE_ULONG_ATTR(max_schedule_delay, S_IRUSR | S_IWUSR | S_IRGRP | 
S_IROTH, balloon_stats.max_schedule_delay);
+static DEVICE_ULONG_ATTR(retry_count, S_IRUSR | S_IRGRP | S_IROTH, 
balloon_stats.retry_count);
+static DEVICE_ULONG_ATTR(max_retry_count, S_IRUSR | S_IWUSR | S_IRGRP | 
S_IROTH, balloon_stats.max_retry_count);
 
 static ssize_t show_target_kb(struct device *dev, struct device_attribute 
*attr,
  char *buf)
-- 
2.9.2


___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


[Xen-devel] [PATCH 1035/1285] Replace numeric parameter like 0444 with macro

2016-08-02 Thread Baole Ni
I find that the developers often just specified the numeric value
when calling a macro which is defined with a parameter for access permission.
As we know, these numeric value for access permission have had the 
corresponding macro,
and that using macro can improve the robustness and readability of the code,
thus, I suggest replacing the numeric parameter with the macro.

Signed-off-by: Chuansheng Liu 
Signed-off-by: Baole Ni 
---
 drivers/xen/xen-scsiback.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
index d6950e0..a9fd45a 100644
--- a/drivers/xen/xen-scsiback.c
+++ b/drivers/xen/xen-scsiback.c
@@ -185,10 +185,10 @@ struct scsiback_tpg {
 #define SCSIBACK_INVALID_HANDLE (~0)
 
 static bool log_print_stat;
-module_param(log_print_stat, bool, 0644);
+module_param(log_print_stat, bool, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 
 static int scsiback_max_buffer_pages = 1024;
-module_param_named(max_buffer_pages, scsiback_max_buffer_pages, int, 0644);
+module_param_named(max_buffer_pages, scsiback_max_buffer_pages, int, S_IRUSR | 
S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(max_buffer_pages,
 "Maximum number of free pages to keep in backend buffer");
 
-- 
2.9.2


___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel