Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

char: misc: Rename a local variable in misc_init()

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 <zijun.hu@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250625-fix_mischar-v2-1-25a80f41b090@oss.qualcomm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Zijun Hu and committed by
Greg Kroah-Hartman
626e8941 bd80e3cc

+3 -3
+3 -3
drivers/char/misc.c
··· 289 289 static int __init misc_init(void) 290 290 { 291 291 int err; 292 - struct proc_dir_entry *ret; 292 + struct proc_dir_entry *misc_proc_file; 293 293 294 - ret = proc_create_seq("misc", 0, NULL, &misc_seq_ops); 294 + misc_proc_file = proc_create_seq("misc", 0, NULL, &misc_seq_ops); 295 295 err = class_register(&misc_class); 296 296 if (err) 297 297 goto fail_remove; ··· 305 305 pr_err("unable to get major %d for misc devices\n", MISC_MAJOR); 306 306 class_unregister(&misc_class); 307 307 fail_remove: 308 - if (ret) 308 + if (misc_proc_file) 309 309 remove_proc_entry("misc", NULL); 310 310 return err; 311 311 }