The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Thorsten Blum <thorsten.blum@linux.dev>
To: Christoph Hellwig <hch@lst.de>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>
Cc: Thorsten Blum <thorsten.blum@linux.dev>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] initrd: Remove unused parameter 'pos' from identify_ramdisk_image()
Date: Sat, 13 Sep 2025 16:33:02 +0200	[thread overview]
Message-ID: <20250913143300.1796122-3-thorsten.blum@linux.dev> (raw)

Commit bef173299613 ("initrd: switch initrd loading to struct file based
APIs") added the parameter 'loff_t pos' to the identify_ramdisk_image()
function and passed 'in_pos' from rd_load_image(). However, the passed
value is immediately overwritten inside identify_ramdisk_image() and
therefore never used.

Replace the function parameter with a local variable and update the call
site accordingly.

No functional changes intended.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 init/do_mounts_rd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c
index 9283fdd605f0..2085c864e9ca 100644
--- a/init/do_mounts_rd.c
+++ b/init/do_mounts_rd.c
@@ -55,8 +55,7 @@ static int __init crd_load(decompress_fn deco);
  *	lz4
  */
 static int __init
-identify_ramdisk_image(struct file *file, loff_t pos,
-		decompress_fn *decompressor)
+identify_ramdisk_image(struct file *file, decompress_fn *decompressor)
 {
 	const int size = 512;
 	struct minix_super_block *minixsb;
@@ -68,6 +67,7 @@ identify_ramdisk_image(struct file *file, loff_t pos,
 	const char *compress_name;
 	unsigned long n;
 	int start_block = rd_image_start;
+	loff_t pos;
 
 	buf = kmalloc(size, GFP_KERNEL);
 	if (!buf)
@@ -202,7 +202,7 @@ int __init rd_load_image(char *from)
 		goto noclose_input;
 
 	in_pos = rd_image_start * BLOCK_SIZE;
-	nblocks = identify_ramdisk_image(in_file, in_pos, &decompressor);
+	nblocks = identify_ramdisk_image(in_file, &decompressor);
 	if (nblocks < 0)
 		goto done;
 
-- 
2.51.0


             reply	other threads:[~2025-09-13 14:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-13 14:33 Thorsten Blum [this message]
2025-09-14 18:05 ` [PATCH] initrd: Remove unused parameter 'pos' from identify_ramdisk_image() Askar Safin

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=20250913143300.1796122-3-thorsten.blum@linux.dev \
    --to=thorsten.blum@linux.dev \
    --cc=brauner@kernel.org \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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