From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Alexandru Hossu <hossu.alexandru@gmail.com>
Cc: andy@kernel.org, gregkh@linuxfoundation.org,
dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: fbtft: fbtft-bus: replace function-defining macro with concrete functions
Date: Fri, 24 Apr 2026 12:38:45 +0300 [thread overview]
Message-ID: <aes6JY3Ht6p1VpFa@ashevche-desk.local> (raw)
In-Reply-To: <20260424092818.3322248-1-hossu.alexandru@gmail.com>
On Fri, Apr 24, 2026 at 11:28:18AM +0200, Alexandru Hossu wrote:
> The define_fbtft_write_reg macro defines full function bodies including
> a goto statement and a trailing semicolon on EXPORT_SYMBOL(), which
> violates kernel coding style (checkpatch reports 2 ERRORs, 2 WARNINGs,
> and 5 CHECKs).
OK.
> Replace it with three concrete C functions that are semantically
> identical to the macro expansions:
> - fbtft_write_reg8_bus8 (u8 buffer, u8 data)
> - fbtft_write_reg16_bus8 (__be16 buffer, u16 data, cpu_to_be16)
> - fbtft_write_reg16_bus16 (u16 buffer, u16 data)
>
> The function declarations in fbtft.h are already present and unchanged.
I'm not sure this patch improves the code. What I see it's harder to follow.
NAK.
You can consider different approach(es), using _Generic() or so, but I forecast
that none of them will be better than the current code.
You also can address just a small chunk of that, exempli gratia, moving out
EXPORT_*() along with some wrappers leaving the main body of the macro
untouched. This might be a compromise. Dunno. If Greg has no objections, you
can try it out.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-04-24 9:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-24 9:28 [PATCH] staging: fbtft: fbtft-bus: replace function-defining macro with concrete functions Alexandru Hossu
2026-04-24 9:38 ` Andy Shevchenko [this message]
2026-04-24 9:40 ` Alexandru Hossu
2026-04-24 9:47 ` Andy Shevchenko
2026-04-24 9:49 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aes6JY3Ht6p1VpFa@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=hossu.alexandru@gmail.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox