From: Daniel Gomez <da.gomez@kernel.org>
To: Petr Pavlu <petr.pavlu@suse.com>,
Luis Chamberlain <mcgrof@kernel.org>,
Sami Tolvanen <samitolvanen@google.com>,
Daniel Gomez <da.gomez@samsung.com>
Cc: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] module: Avoid unnecessary return value initialization in move_module()
Date: Tue, 10 Jun 2025 20:56:22 +0200 [thread overview]
Message-ID: <4c5d1ff8-7018-489c-b238-d838080b66ce@kernel.org> (raw)
In-Reply-To: <20250607161823.409691-3-petr.pavlu@suse.com>
On 07/06/2025 18.16, Petr Pavlu wrote:
> All error conditions in move_module() set the return value by updating the
> ret variable. Therefore, it is not necessary to the initialize the variable
> when declaring it.
>
> Remove the unnecessary initialization.
>
> Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Reviewed-by: Daniel Gomez <da.gomez@samsung.com>
> ---
> kernel/module/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/module/main.c b/kernel/module/main.c
> index 322b38c0a782..06511607075c 100644
> --- a/kernel/module/main.c
> +++ b/kernel/module/main.c
> @@ -2615,7 +2615,7 @@ static int move_module(struct module *mod, struct load_info *info)
> {
> int i;
> enum mod_mem_type t;
> - int ret = -ENOMEM;
> + int ret;
Nit:
We can "merge" all integers in one line.
prev parent reply other threads:[~2025-06-10 18:56 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-07 16:16 [PATCH 0/2] module: Fix memory deallocation on error path " Petr Pavlu
2025-06-07 16:16 ` [PATCH 1/2] " Petr Pavlu
2025-06-08 7:25 ` Petr Pavlu
2025-06-09 22:12 ` Sami Tolvanen
2025-06-10 18:51 ` Daniel Gomez
2025-06-12 10:48 ` Petr Pavlu
2025-06-14 21:28 ` Daniel Gomez
2025-06-16 13:58 ` Petr Pavlu
2025-06-17 9:47 ` Daniel Gomez
2025-06-17 15:41 ` Petr Pavlu
2025-06-17 17:17 ` Daniel Gomez
2025-06-07 16:16 ` [PATCH 2/2] module: Avoid unnecessary return value initialization " Petr Pavlu
2025-06-09 22:13 ` Sami Tolvanen
2025-06-10 18:56 ` Daniel Gomez [this message]
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=4c5d1ff8-7018-489c-b238-d838080b66ce@kernel.org \
--to=da.gomez@kernel.org \
--cc=da.gomez@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=petr.pavlu@suse.com \
--cc=samitolvanen@google.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®