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 <chuansheng.liu(a)intel.com>
Signed-off-by: Baole Ni <baolex.ni(a)intel.com>
---
…
[View More]drivers/gpu/drm/msm/msm_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 9c65409..9f5ddfb 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -51,7 +51,7 @@ int msm_register_mmu(struct drm_device *dev, struct msm_mmu *mmu)
#ifdef CONFIG_DRM_MSM_REGISTER_LOGGING
static bool reglog = false;
MODULE_PARM_DESC(reglog, "Enable register read/write logging");
-module_param(reglog, bool, 0600);
+module_param(reglog, bool, S_IRUSR | S_IWUSR);
#else
#define reglog 0
#endif
@@ -59,7 +59,7 @@ module_param(reglog, bool, 0600);
#ifdef CONFIG_DRM_FBDEV_EMULATION
static bool fbdev = true;
MODULE_PARM_DESC(fbdev, "Enable fbdev compat layer");
-module_param(fbdev, bool, 0600);
+module_param(fbdev, bool, S_IRUSR | S_IWUSR);
#endif
static char *vram = "16m";
--
2.9.2
[View Less]
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 <chuansheng.liu(a)intel.com>
Signed-off-by: Baole Ni <baolex.ni(a)intel.com>
---
…
[View More]drivers/gpu/drm/msm/adreno/adreno_device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c
index 5127b75..fdc7916 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_device.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_device.c
@@ -23,7 +23,7 @@
bool hang_debug = false;
MODULE_PARM_DESC(hang_debug, "Dump registers when hang is detected (can be slow!)");
-module_param_named(hang_debug, hang_debug, bool, 0600);
+module_param_named(hang_debug, hang_debug, bool, S_IRUSR | S_IWUSR);
struct msm_gpu *a3xx_gpu_init(struct drm_device *dev);
struct msm_gpu *a4xx_gpu_init(struct drm_device *dev);
--
2.9.2
[View Less]
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 <chuansheng.liu(a)intel.com>
Signed-off-by: Baole Ni <baolex.ni(a)intel.com>
---
…
[View More]drivers/gpu/drm/mgag200/mgag200_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c b/drivers/gpu/drm/mgag200/mgag200_drv.c
index ebb470f..e4b9d55 100644
--- a/drivers/gpu/drm/mgag200/mgag200_drv.c
+++ b/drivers/gpu/drm/mgag200/mgag200_drv.c
@@ -24,7 +24,7 @@
int mgag200_modeset = -1;
MODULE_PARM_DESC(modeset, "Disable/Enable modesetting");
-module_param_named(modeset, mgag200_modeset, int, 0400);
+module_param_named(modeset, mgag200_modeset, int, S_IRUSR);
static struct drm_driver driver;
--
2.9.2
[View Less]
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 <chuansheng.liu(a)intel.com>
Signed-off-by: Baole Ni <baolex.ni(a)intel.com>
---
…
[View More]drivers/gpu/drm/imx/imx-drm-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
index 8265665..8159ff2 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -50,7 +50,7 @@ struct imx_drm_crtc {
#if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION)
static int legacyfb_depth = 16;
-module_param(legacyfb_depth, int, 0444);
+module_param(legacyfb_depth, int, S_IRUSR | S_IRGRP | S_IROTH);
#endif
unsigned int imx_drm_crtc_id(struct imx_drm_crtc *crtc)
--
2.9.2
[View Less]
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 <chuansheng.liu(a)intel.com>
Signed-off-by: Baole Ni <baolex.ni(a)intel.com>
---
…
[View More]drivers/gpu/drm/i2c/ch7006_drv.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i2c/ch7006_drv.c b/drivers/gpu/drm/i2c/ch7006_drv.c
index 0594c45..bfb4219 100644
--- a/drivers/gpu/drm/i2c/ch7006_drv.c
+++ b/drivers/gpu/drm/i2c/ch7006_drv.c
@@ -530,17 +530,17 @@ static void __exit ch7006_exit(void)
}
int ch7006_debug;
-module_param_named(debug, ch7006_debug, int, 0600);
+module_param_named(debug, ch7006_debug, int, S_IRUSR | S_IWUSR);
MODULE_PARM_DESC(debug, "Enable debug output.");
char *ch7006_tv_norm;
-module_param_named(tv_norm, ch7006_tv_norm, charp, 0600);
+module_param_named(tv_norm, ch7006_tv_norm, charp, S_IRUSR | S_IWUSR);
MODULE_PARM_DESC(tv_norm, "Default TV norm.\n"
"\t\tSupported: PAL, PAL-M, PAL-N, PAL-Nc, PAL-60, NTSC-M, NTSC-J.\n"
"\t\tDefault: PAL");
int ch7006_scale = 1;
-module_param_named(scale, ch7006_scale, int, 0600);
+module_param_named(scale, ch7006_scale, int, S_IRUSR | S_IWUSR);
MODULE_PARM_DESC(scale, "Default scale.\n"
"\t\tSupported: 0 -> Select video modes with a higher blanking ratio.\n"
"\t\t\t1 -> Select default video modes.\n"
--
2.9.2
[View Less]
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 <chuansheng.liu(a)intel.com>
Signed-off-by: Baole Ni <baolex.ni(a)intel.com>
---
…
[View More]drivers/gpu/drm/gma500/mdfld_dsi_output.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_output.c b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
index 907cb51..67b5d18 100644
--- a/drivers/gpu/drm/gma500/mdfld_dsi_output.c
+++ b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
@@ -39,7 +39,7 @@
static int LABC_control = 1;
#ifdef MODULE
-module_param(LABC_control, int, 0644);
+module_param(LABC_control, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
#else
static int __init parse_LABC_control(char *arg)
--
2.9.2
[View Less]
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 <chuansheng.liu(a)intel.com>
Signed-off-by: Baole Ni <baolex.ni(a)intel.com>
---
…
[View More]drivers/gpu/drm/exynos/exynos_drm_vidi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
index 608b0af..8f1bd21 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
@@ -269,7 +269,7 @@ static ssize_t vidi_store_connection(struct device *dev,
return len;
}
-static DEVICE_ATTR(connection, 0644, vidi_show_connection,
+static DEVICE_ATTR(connection, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, vidi_show_connection,
vidi_store_connection);
int vidi_connection_ioctl(struct drm_device *drm_dev, void *data,
--
2.9.2
[View Less]
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 <chuansheng.liu(a)intel.com>
Signed-off-by: Baole Ni <baolex.ni(a)intel.com>
---
…
[View More]drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index ff6aa5d..b38929b 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -35,7 +35,7 @@ static const struct platform_device_id gpu_ids[] = {
};
static bool etnaviv_dump_core = true;
-module_param_named(dump_core, etnaviv_dump_core, bool, 0600);
+module_param_named(dump_core, etnaviv_dump_core, bool, S_IRUSR | S_IWUSR);
/*
* Driver functions:
--
2.9.2
[View Less]
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 <chuansheng.liu(a)intel.com>
Signed-off-by: Baole Ni <baolex.ni(a)intel.com>
---
…
[View More]drivers/gpu/drm/etnaviv/etnaviv_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
index 3d4f56d..86b3bbd 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
@@ -26,7 +26,7 @@
#ifdef CONFIG_DRM_ETNAVIV_REGISTER_LOGGING
static bool reglog;
MODULE_PARM_DESC(reglog, "Enable register read/write logging");
-module_param(reglog, bool, 0600);
+module_param(reglog, bool, S_IRUSR | S_IWUSR);
#else
#define reglog 0
#endif
--
2.9.2
[View Less]
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 <chuansheng.liu(a)intel.com>
Signed-off-by: Baole Ni <baolex.ni(a)intel.com>
---
…
[View More]drivers/gpu/drm/drm_probe_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index 0329080..8fa1d7b 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -59,7 +59,7 @@
*/
static bool drm_kms_helper_poll = true;
-module_param_named(poll, drm_kms_helper_poll, bool, 0600);
+module_param_named(poll, drm_kms_helper_poll, bool, S_IRUSR | S_IWUSR);
static enum drm_mode_status
drm_mode_validate_flag(const struct drm_display_mode *mode,
--
2.9.2
[View Less]