Re: [PATCH] staging: fbtft: fix macro flow control warning and empty macro argument in fbtft-bus.c
From: Dan Carpenter
Date: Mon Feb 02 2026 - 15:03:46 EST
On Mon, Feb 02, 2026 at 09:58:26PM +0530, KrishnaAgarwal1308 wrote:
> Fix checkpatch warning by adding identity modifier for define_fbtft_write_reg().
> No functional change.
>
This commit does two things. It introduces fbtft_identity()
and it flips the if (ret < 0) condition around to avoid the goto
inside a macro. Only the first change is mentioned in the commit
message.
I have see the fbtft_identity() approach before and I don't like it.
https://lore.kernel.org/all/20250718191935.5918-2-abronzo@xxxxxxx/
The name identity() doesn't mean anything. It's a real word and
it has a meaning but it doesn't have a meaning which is at all
related to this code.
I think I would be okay with this the macro were called nop_endian()
or cpu_to_cpu_endian() or something. Or another approach is to just
leave the code as-is. Or maybe we could add a comment?
Regarding the flipped condition, the new code is badly formatted and
uglier than the original. I would prefer to leave it as-is.
regards,
dan carpenter