]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
logprint: cleanup xlog_print_trans_header
authorChristoph Hellwig <hch@lst.de>
Fri, 28 Nov 2025 06:29:43 +0000 (07:29 +0100)
committerAndrey Albershteyn <aalbersh@kernel.org>
Wed, 3 Dec 2025 10:48:04 +0000 (11:48 +0100)
Re-indent and drop typedef use.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
logprint/log_misc.c

index a4fba0333a60725339c099de36baffc90c62ad92..48611c746beaf583800457aff4e16e0054be08fe 100644 (file)
@@ -192,36 +192,35 @@ xlog_print_find_tid(
 }
 
 static int
-xlog_print_trans_header(char **ptr, int len)
+xlog_print_trans_header(
+       char                    **ptr,
+       int                     len)
 {
-    xfs_trans_header_t  *h;
-    char               *cptr = *ptr;
-    uint32_t          magic;
-    char                *magic_c = (char *)&magic;
-
-    *ptr += len;
-
-    magic = *(uint32_t *)cptr; /* XXX be32_to_cpu soon */
+       struct xfs_trans_header *h;
+       char                    *cptr = *ptr;
+       uint32_t                magic;
+       char                    *magic_c = (char *)&magic;
 
-    if (len >= 4) {
+       *ptr += len;
+       magic = *(uint32_t *)cptr; /* XXX be32_to_cpu soon */
+       if (len >= 4) {
 #if __BYTE_ORDER == __LITTLE_ENDIAN
-       printf("%c%c%c%c:",
-               magic_c[3], magic_c[2], magic_c[1], magic_c[0]);
+               printf("%c%c%c%c:",
+                       magic_c[3], magic_c[2], magic_c[1], magic_c[0]);
 #else
-       printf("%c%c%c%c:",
-               magic_c[0], magic_c[1], magic_c[2], magic_c[3]);
+               printf("%c%c%c%c:",
+                       magic_c[0], magic_c[1], magic_c[2], magic_c[3]);
 #endif
-    }
-    if (len != sizeof(xfs_trans_header_t)) {
-       printf(_("   Not enough data to decode further\n"));
-       return 1;
-    }
-    h = (xfs_trans_header_t *)cptr;
-    printf(_("     tid: %x  num_items: %d\n"),
-          h->th_tid, h->th_num_items);
-    return 0;
-}      /* xlog_print_trans_header */
-
+       }
+       if (len != sizeof(struct xfs_trans_header)) {
+               printf(_("   Not enough data to decode further\n"));
+               return 1;
+       }
+       h = (struct xfs_trans_header *)cptr;
+       printf(_("     tid: %x  num_items: %d\n"),
+               h->th_tid, h->th_num_items);
+       return 0;
+}
 
 static int
 xlog_print_trans_buffer(char **ptr, int len, int *i, int num_ops)