]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
logprint: cleanup xlog_print_trans_qoff
authorChristoph Hellwig <hch@lst.de>
Fri, 28 Nov 2025 06:29:46 +0000 (07:29 +0100)
committerAndrey Albershteyn <aalbersh@kernel.org>
Wed, 3 Dec 2025 10:48:04 +0000 (11:48 +0100)
Re-indent, drop typedefs and invert a conditional to allow for an early
return.

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

index 533f57bdfc3688bdcaf9e6348352fd76e30f6cc6..227a0c84644f78d3fecf7b1aeb3c9e77b6f3352a 100644 (file)
@@ -510,23 +510,22 @@ xlog_print_trans_buffer(
 }
 
 static int
-xlog_print_trans_qoff(char **ptr, uint len)
+xlog_print_trans_qoff(
+       char                    **ptr,
+       uint                    len)
 {
-    xfs_qoff_logformat_t *f;
-    xfs_qoff_logformat_t lbuf;
+       struct xfs_qoff_logformat qlf;
 
-    memmove(&lbuf, *ptr, min(sizeof(xfs_qoff_logformat_t), len));
-    f = &lbuf;
-    *ptr += len;
-    if (len >= sizeof(xfs_qoff_logformat_t)) {
-       printf(_("QOFF:  #regs: %d    flags: 0x%x\n"), f->qf_size, f->qf_flags);
+       memmove(&qlf, *ptr, min(sizeof(qlf), len));
+       *ptr += len;
+       if (len < sizeof(qlf)) {
+               printf(_("QOFF: Not enough data to decode further\n"));
+               return 1;
+       }
+       printf(_("QOFF:  #regs: %d    flags: 0x%x\n"),
+                       qlf.qf_size, qlf.qf_flags);
        return 0;
-    } else {
-       printf(_("QOFF: Not enough data to decode further\n"));
-       return 1;
-    }
-}      /* xlog_print_trans_qoff */
-
+}
 
 static void
 xlog_print_trans_inode_core(