public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arch/um: remove unused varible err in remove_files_and_dir()
@ 2026-01-07  6:40 alexs
  0 siblings, 0 replies; only message in thread
From: alexs @ 2026-01-07  6:40 UTC (permalink / raw)
  To: Richard Weinberger, Anton Ivanov, Johannes Berg,
	open list:USER-MODE LINUX (UML), open list
  Cc: linux-kernel, Alex Shi, kernel test robot, linux-um

From: Alex Shi <alexs@kernel.org>

err is duplicated with errno, and never used. So remove it to fix warnning:
arch/um/os-Linux/umid.c:139:16: warning: variable 'err' set but not used [-Wunused-but-set-variable]
  139 |         int fd, p, n, err;
      |                       ^

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Alex Shi <alexs@kernel.org>
Cc: linux-um@lists.infradead.org
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Cc: Richard Weinberger <richard@nod.at>
---
 arch/um/os-Linux/umid.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/um/os-Linux/umid.c b/arch/um/os-Linux/umid.c
index eb523ab1e218..6b488be2c545 100644
--- a/arch/um/os-Linux/umid.c
+++ b/arch/um/os-Linux/umid.c
@@ -136,7 +136,7 @@ static int remove_files_and_dir(char *dir)
 static inline int is_umdir_used(char *dir)
 {
 	char pid[sizeof("nnnnnnnnn")], *end, *file;
-	int fd, p, n, err;
+	int fd, p, n;
 	size_t filelen = strlen(dir) + sizeof("/pid") + 1;
 
 	file = malloc(filelen);
@@ -155,7 +155,6 @@ static inline int is_umdir_used(char *dir)
 		goto out;
 	}
 
-	err = 0;
 	n = read(fd, pid, sizeof(pid));
 	if (n < 0) {
 		printk(UM_KERN_ERR "is_umdir_used : couldn't read pid file "
-- 
2.43.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-01-07  6:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-07  6:40 [PATCH] arch/um: remove unused varible err in remove_files_and_dir() alexs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox