char: misc: Rename a local variable in misc_init()
PATCH v2 1/1 char: misc: Rename a local variable in misc_init()
From: Zijun Hu <[email protected]>
Local variable @ret is not used for return value in misc_init().
Give it a different name @misc_proc_file.
Signed-off-by Zijun Hu <[email protected]>
---
This patch series is to do trivial cleanup for miscdevice driver.
---
Changes in v2:
- Drop applied patches
- Rename the local variable name to @misc_proc_file based on Greg's suggestion.
- Link to v1: https://lore.kernel.org/r/[email protected]
--- drivers/char/misc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/char/misc.c +3 -3
@@ -289,9 +289,9 @@ EXPORT_SYMBOL(misc_deregister);static int __init misc_init (void ) {int err; -struct proc_dir_entry *ret; +struct proc_dir_entry *misc_proc_file; - ret =proc_create_seq ("misc" ,0 ,NULL , &misc_seq_ops); + misc_proc_file =proc_create_seq ("misc" ,0 ,NULL , &misc_seq_ops); err =class_register (&misc_class);if (err) goto fail_remove;
@@ -305,7 +305,7 @@ static int __init misc_init(void)pr_err ("unable to get major %d for misc devices\n" ,MISC_MAJOR );class_unregister (&misc_class); fail_remove: -if (ret) +if (misc_proc_file)remove_proc_entry ("misc" ,NULL );return err; }
---
base-commit: 421d3a860d3d795b816d3efbcc3c2001c1ee1325
change-id: 20250620-fix_mischar-794de4259592
Best regards,
Signature · 1 line
Zijun Hu <[email protected]>