Skip to contentSkip to conversation

Input: edt-ft5x06 - replace DEFINE_SIMPLE_ATTRIBUTE with DEFINE_DEBUGFS_ATTRIBUTE

PATCH In review Bo Liu 3 participants 3 messages Nov 1, 2022

Subsystems (2)
lore
Share & tools
lore

Bo Liu

author
#0 lore raw

PATCH 1/1 Input: edt-ft5x06 - replace DEFINE_SIMPLE_ATTRIBUTE with DEFINE_DEBUGFS_ATTRIBUTE

Fix the following coccicheck warning:
drivers/input/touchscreen/edt-ft5x06.c:756:0-23: WARNING:
debugfs_mode_fops should be defined with DEFINE_DEBUGFS_ATTRIBUTE

---
 drivers/input/touchscreen/edt-ft5x06.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/edt-ft5x06.c +1 -1
index 9ac1378610bc..a184425b6985 100644
@@ -753,7 +753,7 @@ static int edt_ft5x06_debugfs_mode_set(void *data, u64 mode)
 	return retval;
 };
 
-DEFINE_SIMPLE_ATTRIBUTE(debugfs_mode_fops, edt_ft5x06_debugfs_mode_get,
+DEFINE_DEBUGFS_ATTRIBUTE(debugfs_mode_fops, edt_ft5x06_debugfs_mode_get,
 			edt_ft5x06_debugfs_mode_set, "%llu\n");
 
 static ssize_t edt_ft5x06_debugfs_raw_data_read(struct file *file,
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines

Am 01.11.2022 um 09:14 schrieb Bo Liu <[email protected]>:

Fix the following coccicheck warning:
drivers/input/touchscreen/edt-ft5x06.c:756:0-23: WARNING:
debugfs_mode_fops should be defined with DEFINE_DEBUGFS_ATTRIBUTE

Quoted 20 lines

---
drivers/input/touchscreen/edt-ft5x06.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/edt-ft5x06.c +1 -1
index 9ac1378610bc..a184425b6985 100644
@@ -753,7 +753,7 @@ static int edt_ft5x06_debugfs_mode_set(void *data, u64 mode)
 	return retval;
 };
 
-DEFINE_SIMPLE_ATTRIBUTE(debugfs_mode_fops, edt_ft5x06_debugfs_mode_get,
+DEFINE_DEBUGFS_ATTRIBUTE(debugfs_mode_fops, edt_ft5x06_debugfs_mode_get,
 			edt_ft5x06_debugfs_mode_set, "%llu\n");
 
 static ssize_t edt_ft5x06_debugfs_raw_data_read(struct file *file,
Signature · 1 line
2.27.0
maintainer
#2 lore raw
In reply to Bo Liu

Hi Bo,

Quoted 3 lines · Bo Liu

Fix the following coccicheck warning:
drivers/input/touchscreen/edt-ft5x06.c:756:0-23: WARNING:
debugfs_mode_fops should be defined with DEFINE_DEBUGFS_ATTRIBUTE

This is not a great justification for a change. Could you please update the patch description to document why DEFINE_DEBUGFS_ATTRIBUTE is preferred over DEFINE_SIMPLE_ATTRIBUTE?

Quoted 22 lines
---
 drivers/input/touchscreen/edt-ft5x06.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/edt-ft5x06.c +1 -1
index 9ac1378610bc..a184425b6985 100644
@@ -753,7 +753,7 @@ static int edt_ft5x06_debugfs_mode_set(void *data, u64 mode)
 	return retval;
 };
 
-DEFINE_SIMPLE_ATTRIBUTE(debugfs_mode_fops, edt_ft5x06_debugfs_mode_get,
+DEFINE_DEBUGFS_ATTRIBUTE(debugfs_mode_fops, edt_ft5x06_debugfs_mode_get,
 			edt_ft5x06_debugfs_mode_set, "%llu\n");
 
 static ssize_t edt_ft5x06_debugfs_raw_data_read(struct file *file,
Signature · 1 line
2.27.0

Thanks.

Signature · 1 line
Dmitry