[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20260107064009.15380-1-alexs@kernel.org>
Date: Wed, 7 Jan 2026 14:40:09 +0800
From: alexs@...nel.org
To: Richard Weinberger <richard@....at>,
Anton Ivanov <anton.ivanov@...bridgegreys.com>,
Johannes Berg <johannes@...solutions.net>,
linux-um@...ts.infradead.org (open list:USER-MODE LINUX (UML)),
linux-kernel@...r.kernel.org (open list)
Cc: linux-kernel@...r.kernel.org,
Alex Shi <alexs@...nel.org>,
kernel test robot <lkp@...el.com>,
linux-um@...ts.infradead.org
Subject: [PATCH] arch/um: remove unused varible err in remove_files_and_dir()
From: Alex Shi <alexs@...nel.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@...el.com>
Signed-off-by: Alex Shi <alexs@...nel.org>
Cc: linux-um@...ts.infradead.org
Cc: Johannes Berg <johannes@...solutions.net>
Cc: Anton Ivanov <anton.ivanov@...bridgegreys.com>
Cc: Richard Weinberger <richard@....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
Powered by blists - more mailing lists