show both 'before' and 'after' is just for debug, not so important. OK, I will delete 1st one.
________________________________________ From: Gao Xiang <hsiang...@linux.alibaba.com> Sent: Friday, August 22, 2025 17:25 To: Su, Friendy; linux-erofs@lists.ozlabs.org Cc: Mo, Yuezhang; Palmer, Daniel (SGC) Subject: Re: [PATCH v2] erofs-utils: mkfs: Implement 'dsunit' alignment on blobdev On 2025/8/22 17: 19, Friendy. Su@ sony. com wrote: >> + off_t off = lseek(blobfile, 0, SEEK_CUR); >> + >> + erofs_dbg("Try to round up 0x%llx to align on %d blocks (dsunit)", >> + off, sbi->bmgr->dsunit); >> + On 2025/8/22 17:19, friendy...@sony.com wrote: >> + off_t off = lseek(blobfile, 0, SEEK_CUR); >> + >> + erofs_dbg("Try to round up 0x%llx to align on %d blocks >> (dsunit)", >> + off, sbi->bmgr->dsunit); >> + off = roundup(off, sbi->bmgr->dsunit * erofs_blksiz(sbi)); >> + if (lseek(blobfile, off, SEEK_SET) != off) { >> + ret = -errno; >> + erofs_err("lseek to blobdev 0x%llx error", off); >> + goto err; >> + } >> + erofs_dbg("Aligned on 0x%llx", off); > > Could we combine these two debugging messages into one? > > Here, 'off' is changed after roundup(), we need show both 'before' and > 'after' by one variable 'off', it is hard to combine. > Do you have better idea? ^_^ It's just a debugging message, just wonder if the previous position is important? If it's really important, you could use another variable to keep the original one. Thanks, Gao Xiang