Re: [PATCH] fs: iomap: replace the ternary conditional operator with max_t()

From: Matthew Wilcox
Date: Sun Jun 25 2023 - 23:56:51 EST


On Mon, Jun 26, 2023 at 10:22:12AM +0800, Lu Hongfei wrote:
> It would be better to replace the traditional ternary conditional
> operator with max_t() in iomap_iter

No it wouldn't.

There are two possible meanings for iter->processed. Either we
processed a positive number of bytes, or it's an errno. max_t()
doesn't express that. Your patch adds confusion, not reduces it.