From: Christoph Hellwig Date: Fri, 28 Nov 2025 06:29:46 +0000 (+0100) Subject: logprint: cleanup xlog_print_trans_qoff X-Git-Tag: v6.18.0~63 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=36609bf8b1a639cfaf10d211969b50bb5a5ff54d;p=xfsprogs-dev.git logprint: cleanup xlog_print_trans_qoff Re-indent, drop typedefs and invert a conditional to allow for an early return. Signed-off-by: Christoph Hellwig Reviewed-by: Andrey Albershteyn --- diff --git a/logprint/log_misc.c b/logprint/log_misc.c index 533f57bd..227a0c84 100644 --- a/logprint/log_misc.c +++ b/logprint/log_misc.c @@ -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(