Thread (41 messages) 41 messages, 4 authors, 2018-10-11
STALE2831d

[PATCH 14/18] xfs_logprint: fix shadow var in xlog_print_trans_buffer

From: Eric Sandeen <hidden>
Date: 2018-10-11 03:25:21
Subsystem: the rest · Maintainer: Linus Torvalds

xlog_print_trans_buffer takes 'i' as an argument, but then uses it later
as a local byte counter.  Give the local var more useful, non-shadow
name of "byte"

Signed-off-by: Eric Sandeen <redacted>
---
 logprint/log_misc.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/logprint/log_misc.c b/logprint/log_misc.c
index 99d9920..c325f04 100644
--- a/logprint/log_misc.c
+++ b/logprint/log_misc.c
@@ -395,15 +395,15 @@ xlog_print_trans_buffer(char **ptr, int len, int *i, int num_ops)
 		if (print_data) {
 			uint *dp  = (uint *)*ptr;
 			int  nums = be32_to_cpu(head->oh_len) >> 2;
-			int  i = 0;
+			int  byte = 0;
 
-			while (i < nums) {
-				if ((i % 8) == 0)
-					printf("%2x ", i);
+			while (byte < nums) {
+				if ((byte % 8) == 0)
+					printf("%2x ", byte);
 				printf("%8x ", *dp);
 				dp++;
-				i++;
-				if ((i % 8) == 0)
+				byte++;
+				if ((byte % 8) == 0)
 					printf("\n");
 			}
 			printf("\n");
-- 
1.8.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help