From nobody Wed Sep 10 01:15:14 2025 Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0BB0F2248B4 for ; Mon, 8 Sep 2025 12:16:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.186 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757333765; cv=none; b=Od4woKv4+xIWqLsCe5FExnTy38i0WK83cSEJ1GTHXeFF/MqFQ2xHMSz3OZl8gb15x7pYvbNo271SP3DHmY1V3h0eSdWYkM8Ms3IYqi+gmQXxsACgSH+xuY4c8cBto1RZu531juzZdl1Hw8p6hz5tkD5HA4IjQH14m7aKLXzcd08= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757333765; c=relaxed/simple; bh=Yzki8UK5ivqU+xZSbkykGPPBdjgGpNIeynzagZ7/ITg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IDWRppPYHzl3y8iEjMobSisviJihmj+3NuXZWExDWFEOfEO97C1vYcf8i++/falxsBtd26kjC9sTEzgRkHSmhfU3P76QRS635uqXZZfuzoYwa/Jz5BZrKwkGUX7wA1xw3gWgEbaHTfs3Eu70oX9Am9vCqTzwBmYY2R2tBhGO9LI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=kBmgcFhJ; arc=none smtp.client-ip=91.218.175.186 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="kBmgcFhJ" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1757333751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=OI+lrpmwu6GMZxyp0oEbI2hfIoT0pSRjcFrJLPV8SDA=; b=kBmgcFhJF/0Bvc4I++B+oTSQb+1XkD90qSxBoHYPtw4ApxYKm1TRI9v+tkBDGQPaTNH6EI r7QV2LNXGRS4jtG0yZfS0/krjXEx2WdNhfn2dOKo+woY6gCOQBTptwvgpqTzT5f8SDh/rl /zhpUon9FVE8fm41SsOOXiCcGX5FEr4= From: Thorsten Blum To: Alexander Viro , Christian Brauner , Jan Kara Cc: linux-s390@vger.kernel.org, Thorsten Blum , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] initrd: Fix unused variable warning in rd_load_image() on s390 Date: Mon, 8 Sep 2025 14:13:04 +0200 Message-ID: <20250908121303.180886-2-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" The local variable 'rotate' is not used on s390, and building the kernel with W=3D1 generates the following warning: init/do_mounts_rd.c:192:17: warning: variable 'rotate' set but not used [-W= unused-but-set-variable] 192 | unsigned short rotate =3D 0; | ^ 1 warning generated. Fix this by declaring and using 'rotate' only when CONFIG_S390 is not defined. Signed-off-by: Thorsten Blum --- init/do_mounts_rd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c index ac021ae6e6fa..cbc4c496cb5f 100644 --- a/init/do_mounts_rd.c +++ b/init/do_mounts_rd.c @@ -189,9 +189,9 @@ int __init rd_load_image(char *from) unsigned long rd_blocks, devblocks; int nblocks, i; char *buf =3D NULL; - unsigned short rotate =3D 0; decompress_fn decompressor =3D NULL; #if !defined(CONFIG_S390) + unsigned short rotate =3D 0; char rotator[4] =3D { '|' , '/' , '-' , '\\' }; #endif =20 @@ -249,7 +249,9 @@ int __init rd_load_image(char *from) for (i =3D 0; i < nblocks; i++) { if (i && (i % devblocks =3D=3D 0)) { pr_cont("done disk #1.\n"); +#if !defined(CONFIG_S390) rotate =3D 0; +#endif fput(in_file); break; } --=20 2.51.0