diff mbox series

[1/2] btrfs-progs: remove variable e from cmd_inspect_list_chunks()

Message ID c01c5f2ec4a967a893f754870df436e01b6525c8.1695873867.git.wqu@suse.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: -Wshadow fixes | expand

Commit Message

Qu Wenruo Sept. 28, 2023, 4:06 a.m. UTC
The variable @e is only utilized to record the errno from ioctl() call,
and is only for the error message.

We can go with "%m" to replace the usage of variable @e, and remove the
variable shadowing, as later we will declare a local variable @e with a
different type.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 cmds/inspect.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/cmds/inspect.c b/cmds/inspect.c
index ef928895fa08..50f1ddc745a6 100644
--- a/cmds/inspect.c
+++ b/cmds/inspect.c
@@ -1026,7 +1026,6 @@  static int cmd_inspect_list_chunks(const struct cmd_struct *cmd,
 	int ret;
 	int fd;
 	int i;
-	int e;
 	DIR *dirstream = NULL;
 	unsigned unit_mode;
 	char *sortmode = NULL;
@@ -1114,9 +1113,8 @@  static int cmd_inspect_list_chunks(const struct cmd_struct *cmd,
 	while (1) {
 		sk->nr_items = 1;
 		ret = ioctl(fd, BTRFS_IOC_TREE_SEARCH, &args);
-		e = errno;
 		if (ret < 0) {
-			error("cannot perform the search: %s", strerror(e));
+			error("cannot perform the search: %m");
 			return 1;
 		}
 		if (sk->nr_items == 0)