未验证 提交 c9ba134e 编写于 作者: M Maíra Canal 提交者: Maíra Canal

drm/debugfs: use octal permissions instead of symbolic permissions

Currently, debugfs functions are using symbolic macros as permission
bits, but checkpatch reinforces permission bits in the octal form, as
they are more readable and easier to understand [1]. Moreover, using
the symbolic macro S_IFREG is redundant.

Therefore, use octal permission bits in all debugfs functions.

[1] https://docs.kernel.org/dev-tools/checkpatch.html#permissionsSuggested-by: NJani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: NMaíra Canal <mcanal@igalia.com>
Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: NJani Nikula <jani.nikula@intel.com>
Signed-off-by: NMaíra Canal <mairacanal@riseup.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20230105193039.287677-1-mcanal@igalia.com
上级 05375d5c
...@@ -207,7 +207,7 @@ void drm_debugfs_create_files(const struct drm_info_list *files, int count, ...@@ -207,7 +207,7 @@ void drm_debugfs_create_files(const struct drm_info_list *files, int count,
tmp->minor = minor; tmp->minor = minor;
tmp->dent = debugfs_create_file(files[i].name, tmp->dent = debugfs_create_file(files[i].name,
S_IFREG | S_IRUGO, root, tmp, 0444, root, tmp,
&drm_debugfs_fops); &drm_debugfs_fops);
tmp->info_ent = &files[i]; tmp->info_ent = &files[i];
...@@ -246,7 +246,7 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id, ...@@ -246,7 +246,7 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
dev->driver->debugfs_init(minor); dev->driver->debugfs_init(minor);
list_for_each_entry_safe(entry, tmp, &dev->debugfs_list, list) { list_for_each_entry_safe(entry, tmp, &dev->debugfs_list, list) {
debugfs_create_file(entry->file.name, S_IFREG | S_IRUGO, debugfs_create_file(entry->file.name, 0444,
minor->debugfs_root, entry, &drm_debugfs_entry_fops); minor->debugfs_root, entry, &drm_debugfs_entry_fops);
list_del(&entry->list); list_del(&entry->list);
} }
...@@ -263,7 +263,7 @@ void drm_debugfs_late_register(struct drm_device *dev) ...@@ -263,7 +263,7 @@ void drm_debugfs_late_register(struct drm_device *dev)
return; return;
list_for_each_entry_safe(entry, tmp, &dev->debugfs_list, list) { list_for_each_entry_safe(entry, tmp, &dev->debugfs_list, list) {
debugfs_create_file(entry->file.name, S_IFREG | S_IRUGO, debugfs_create_file(entry->file.name, 0444,
minor->debugfs_root, entry, &drm_debugfs_entry_fops); minor->debugfs_root, entry, &drm_debugfs_entry_fops);
list_del(&entry->list); list_del(&entry->list);
} }
...@@ -508,15 +508,15 @@ void drm_debugfs_connector_add(struct drm_connector *connector) ...@@ -508,15 +508,15 @@ void drm_debugfs_connector_add(struct drm_connector *connector)
connector->debugfs_entry = root; connector->debugfs_entry = root;
/* force */ /* force */
debugfs_create_file("force", S_IRUGO | S_IWUSR, root, connector, debugfs_create_file("force", 0644, root, connector,
&drm_connector_fops); &drm_connector_fops);
/* edid */ /* edid */
debugfs_create_file("edid_override", S_IRUGO | S_IWUSR, root, connector, debugfs_create_file("edid_override", 0644, root, connector,
&drm_edid_fops); &drm_edid_fops);
/* vrr range */ /* vrr range */
debugfs_create_file("vrr_range", S_IRUGO, root, connector, debugfs_create_file("vrr_range", 0444, root, connector,
&vrr_range_fops); &vrr_range_fops);
/* max bpc */ /* max bpc */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册