From: Zijun Hu <zijun_hu@icloud.com>
To: Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Zijun Hu <zijun_hu@icloud.com>,
linux-kernel@vger.kernel.org,
Zijun Hu <zijun.hu@oss.qualcomm.com>
Subject: [PATCH v2] char: misc: Rename a local variable in misc_init()
Date: Wed, 25 Jun 2025 21:53:20 +0800 [thread overview]
Message-ID: <20250625-fix_mischar-v2-1-25a80f41b090@oss.qualcomm.com> (raw)
From: Zijun Hu <zijun.hu@oss.qualcomm.com>
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>
---
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/20250620-fix_mischar-v1-0-6c2716bbf1fa@oss.qualcomm.com
---
drivers/char/misc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index 5247d0ec0f4c5363d5ecd2881741510158295779..558302a64dd908aee30341547a5413df1af71459 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -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,
--
Zijun Hu <zijun.hu@oss.qualcomm.com>
reply other threads:[~2025-06-25 13:53 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=20250625-fix_mischar-v2-1-25a80f41b090@oss.qualcomm.com \
--to=zijun_hu@icloud.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zijun.hu@oss.qualcomm.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®