Skip to contentSkip to conversation

init: Define rotate conditionally on ! CONFIG_390

PATCH New Tom Rix 1 participant 1 message Apr 28, 2023 VFS

lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 init: Define rotate conditionally on ! CONFIG_390

For s390, gcc with W=1 reports init/do_mounts_rd.c:192:24: error: variable
'rotate' set but not used [-Werror=unused-but-set-variable]
192 | unsigned short rotate = 0;
| ^~~~~~

rotate is not used for s390 so should be conditionally defined.

---
 init/do_mounts_rd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
init/do_mounts_rd.c +3 -1
index ac021ae6e6fa..cbc4c496cb5f 100644
@@ -189,9 +189,9 @@ int __init rd_load_image(char *from)
 	unsigned long rd_blocks, devblocks;
 	int nblocks, i;
 	char *buf = NULL;
-	unsigned short rotate = 0;
 	decompress_fn decompressor = NULL;
 #if !defined(CONFIG_S390)
+	unsigned short rotate = 0;
 	char rotator[4] = { '|' , '/' , '-' , '\\' };
 #endif
 
@@ -249,7 +249,9 @@ int __init rd_load_image(char *from)
 	for (i = 0; i < nblocks; i++) {
 		if (i && (i % devblocks == 0)) {
 			pr_cont("done disk #1.\n");
+#if !defined(CONFIG_S390)
 			rotate = 0;
+#endif
 			fput(in_file);
 			break;
 		}
Signature · 1 line
2.27.0