[PATCH v6 2/5] i3c: master: svc: Replace bool rnw with union for HDR support
Andy Shevchenko
andriy.shevchenko at intel.com
Thu Oct 23 01:26:37 PDT 2025
On Tue, Oct 14, 2025 at 12:40:01PM -0400, Frank Li wrote:
> Replace the bool rnw field with a union in preparation for adding HDR
> support. HDR uses a cmd field instead of the rnw bit to indicate read or
> write direction.
>
> Add helper function svc_cmd_is_read() to check transfer direction.
>
> Add a local variable 'rnw' in svc_i3c_master_priv_xfers() to avoid
> repeatedly accessing xfers[i].rnw.
>
> No functional change.
...
> struct svc_i3c_cmd {
> u8 addr;
> - bool rnw;
> + union {
> + bool rnw;
> + u8 cmd;
> + u32 rnw_cmd;
> + };
Same Q, what is the selector?
> u8 *in;
> const void *out;
> unsigned int len;
> }
> +static bool svc_cmd_is_read(u32 rnw_cmd, u32 type)
> +{
> + return rnw_cmd;
> +}
Useless?
--
With Best Regards,
Andy Shevchenko
More information about the linux-i3c
mailing list