From: Christoph Hellwig Date: Fri, 28 Nov 2025 06:29:43 +0000 (+0100) Subject: logprint: cleanup xlog_print_trans_header X-Git-Tag: v6.18.0~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22ed13ab1df5883f53cbc00a08ca9c9092dfed85;p=thirdparty%2Fxfsprogs-dev.git logprint: cleanup xlog_print_trans_header Re-indent and drop typedef use. Signed-off-by: Christoph Hellwig Reviewed-by: Andrey Albershteyn --- diff --git a/logprint/log_misc.c b/logprint/log_misc.c index a4fba033..48611c74 100644 --- a/logprint/log_misc.c +++ b/logprint/log_misc.c @@ -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)