From: Baole Ni <baolex.ni@intel.com>
To: alexander.deucher@amd.com, christian.koenig@amd.com,
airlied@linux.ie, kyungmin.park@samsung.com, kgene@kernel.org,
k.kozlowski@samsung.com, dougthompson@xmission.com, bp@alien8.de
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
chuansheng.liu@intel.com, baolex.ni@intel.com,
treding@nvidia.com, ville.syrjala@linux.intel.com
Subject: [PATCH 0211/1285] Replace numeric parameter like 0444 with macro
Date: Tue, 2 Aug 2016 18:50:06 +0800 [thread overview]
Message-ID: <20160802105006.27825-1-baolex.ni@intel.com> (raw)
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@intel.com>
Signed-off-by: Baole Ni <baolex.ni@intel.com>
---
drivers/gpu/drm/radeon/radeon_drv.c | 64 ++++++++++++++++++-------------------
1 file changed, 32 insertions(+), 32 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index b55aa74..be6f5cc 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -203,100 +203,100 @@ int radeon_uvd = 1;
int radeon_vce = 1;
MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers");
-module_param_named(no_wb, radeon_no_wb, int, 0444);
+module_param_named(no_wb, radeon_no_wb, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(modeset, "Disable/Enable modesetting");
-module_param_named(modeset, radeon_modeset, int, 0400);
+module_param_named(modeset, radeon_modeset, int, S_IRUSR);
MODULE_PARM_DESC(dynclks, "Disable/Enable dynamic clocks");
-module_param_named(dynclks, radeon_dynclks, int, 0444);
+module_param_named(dynclks, radeon_dynclks, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(r4xx_atom, "Enable ATOMBIOS modesetting for R4xx");
-module_param_named(r4xx_atom, radeon_r4xx_atom, int, 0444);
+module_param_named(r4xx_atom, radeon_r4xx_atom, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes");
-module_param_named(vramlimit, radeon_vram_limit, int, 0600);
+module_param_named(vramlimit, radeon_vram_limit, int, S_IRUSR | S_IWUSR);
MODULE_PARM_DESC(agpmode, "AGP Mode (-1 == PCI)");
-module_param_named(agpmode, radeon_agpmode, int, 0444);
+module_param_named(agpmode, radeon_agpmode, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(gartsize, "Size of PCIE/IGP gart to setup in megabytes (32, 64, etc., -1 = auto)");
-module_param_named(gartsize, radeon_gart_size, int, 0600);
+module_param_named(gartsize, radeon_gart_size, int, S_IRUSR | S_IWUSR);
MODULE_PARM_DESC(benchmark, "Run benchmark");
-module_param_named(benchmark, radeon_benchmarking, int, 0444);
+module_param_named(benchmark, radeon_benchmarking, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(test, "Run tests");
-module_param_named(test, radeon_testing, int, 0444);
+module_param_named(test, radeon_testing, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(connector_table, "Force connector table");
-module_param_named(connector_table, radeon_connector_table, int, 0444);
+module_param_named(connector_table, radeon_connector_table, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(tv, "TV enable (0 = disable)");
-module_param_named(tv, radeon_tv, int, 0444);
+module_param_named(tv, radeon_tv, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(audio, "Audio enable (-1 = auto, 0 = disable, 1 = enable)");
-module_param_named(audio, radeon_audio, int, 0444);
+module_param_named(audio, radeon_audio, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(disp_priority, "Display Priority (0 = auto, 1 = normal, 2 = high)");
-module_param_named(disp_priority, radeon_disp_priority, int, 0444);
+module_param_named(disp_priority, radeon_disp_priority, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(hw_i2c, "hw i2c engine enable (0 = disable)");
-module_param_named(hw_i2c, radeon_hw_i2c, int, 0444);
+module_param_named(hw_i2c, radeon_hw_i2c, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(pcie_gen2, "PCIE Gen2 mode (-1 = auto, 0 = disable, 1 = enable)");
-module_param_named(pcie_gen2, radeon_pcie_gen2, int, 0444);
+module_param_named(pcie_gen2, radeon_pcie_gen2, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(msi, "MSI support (1 = enable, 0 = disable, -1 = auto)");
-module_param_named(msi, radeon_msi, int, 0444);
+module_param_named(msi, radeon_msi, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default 10000 = 10 seconds, 0 = disable)");
-module_param_named(lockup_timeout, radeon_lockup_timeout, int, 0444);
+module_param_named(lockup_timeout, radeon_lockup_timeout, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(fastfb, "Direct FB access for IGP chips (0 = disable, 1 = enable)");
-module_param_named(fastfb, radeon_fastfb, int, 0444);
+module_param_named(fastfb, radeon_fastfb, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(dpm, "DPM support (1 = enable, 0 = disable, -1 = auto)");
-module_param_named(dpm, radeon_dpm, int, 0444);
+module_param_named(dpm, radeon_dpm, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(aspm, "ASPM support (1 = enable, 0 = disable, -1 = auto)");
-module_param_named(aspm, radeon_aspm, int, 0444);
+module_param_named(aspm, radeon_aspm, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(runpm, "PX runtime pm (1 = force enable, 0 = disable, -1 = PX only default)");
-module_param_named(runpm, radeon_runtime_pm, int, 0444);
+module_param_named(runpm, radeon_runtime_pm, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(hard_reset, "PCI config reset (1 = force enable, 0 = disable (default))");
-module_param_named(hard_reset, radeon_hard_reset, int, 0444);
+module_param_named(hard_reset, radeon_hard_reset, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(vm_size, "VM address space size in gigabytes (default 4GB)");
-module_param_named(vm_size, radeon_vm_size, int, 0444);
+module_param_named(vm_size, radeon_vm_size, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(vm_block_size, "VM page table size in bits (default depending on vm_size)");
-module_param_named(vm_block_size, radeon_vm_block_size, int, 0444);
+module_param_named(vm_block_size, radeon_vm_block_size, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(deep_color, "Deep Color support (1 = enable, 0 = disable (default))");
-module_param_named(deep_color, radeon_deep_color, int, 0444);
+module_param_named(deep_color, radeon_deep_color, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(use_pflipirq, "Pflip irqs for pageflip completion (0 = disable, 1 = as fallback, 2 = exclusive (default))");
-module_param_named(use_pflipirq, radeon_use_pflipirq, int, 0444);
+module_param_named(use_pflipirq, radeon_use_pflipirq, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(bapm, "BAPM support (1 = enable, 0 = disable, -1 = auto)");
-module_param_named(bapm, radeon_bapm, int, 0444);
+module_param_named(bapm, radeon_bapm, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(backlight, "backlight support (1 = enable, 0 = disable, -1 = auto)");
-module_param_named(backlight, radeon_backlight, int, 0444);
+module_param_named(backlight, radeon_backlight, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(auxch, "Use native auxch experimental support (1 = enable, 0 = disable, -1 = auto)");
-module_param_named(auxch, radeon_auxch, int, 0444);
+module_param_named(auxch, radeon_auxch, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(mst, "DisplayPort MST experimental support (1 = enable, 0 = disable)");
-module_param_named(mst, radeon_mst, int, 0444);
+module_param_named(mst, radeon_mst, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(uvd, "uvd enable/disable uvd support (1 = enable, 0 = disable)");
-module_param_named(uvd, radeon_uvd, int, 0444);
+module_param_named(uvd, radeon_uvd, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(vce, "vce enable/disable vce support (1 = enable, 0 = disable)");
-module_param_named(vce, radeon_vce, int, 0444);
+module_param_named(vce, radeon_vce, int, S_IRUSR | S_IRGRP | S_IROTH);
static struct pci_device_id pciidlist[] = {
radeon_PCI_IDS
--
2.9.2
reply other threads:[~2016-08-02 18:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160802105006.27825-1-baolex.ni@intel.com \
--to=baolex.ni@intel.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=bp@alien8.de \
--cc=christian.koenig@amd.com \
--cc=chuansheng.liu@intel.com \
--cc=dougthompson@xmission.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=k.kozlowski@samsung.com \
--cc=kgene@kernel.org \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=treding@nvidia.com \
--cc=ville.syrjala@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®