[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f05fb969-0632-48a6-afcd-c526c8568d4b@t-8ch.de>
Date: Tue, 4 Feb 2025 17:50:14 +0100
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Billy Tsai <billy_tsai@...eedtech.com>
Cc: "alexandre.belloni@...tlin.com" <alexandre.belloni@...tlin.com>,
"pgaj@...ence.com" <pgaj@...ence.com>, "miquel.raynal@...tlin.com" <miquel.raynal@...tlin.com>,
"conor.culhane@...vaco.com" <conor.culhane@...vaco.com>, "aniketmaurya@...gle.com" <aniketmaurya@...gle.com>,
"Shyam-sundar.S-k@....com" <Shyam-sundar.S-k@....com>, "jarkko.nikula@...ux.intel.com" <jarkko.nikula@...ux.intel.com>,
"wsa+renesas@...g-engineering.com" <wsa+renesas@...g-engineering.com>, "xiaopei01@...inos.cn" <xiaopei01@...inos.cn>,
"Guruvendra.Punugupati@....com" <Guruvendra.Punugupati@....com>, "linux-i3c@...ts.infradead.org" <linux-i3c@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, BMC-SW <BMC-SW@...eedtech.com>
Subject: Re: [PATCH v2 1/2] i3c: Remove the const qualifier from i2c_msg
pointer in i2c_xfers API
Hi Billy,
On 2025-02-04 10:09:31+0000, Billy Tsai wrote:
> > On 2025-02-04 17:17:01+0800, Billy Tsai wrote:
> > > The change is necessary to enable the use of the
> > > `i2c_get_dma_safe_msg_buf()` API, which requires a non-const
> > > `struct i2c_msg *` to operate. The `i2c_get_dma_safe_msg_buf()` function
> > > ensures safe handling of I2C messages when using DMA, making it essential
> > > for scenarios where DMA transfers are involved. By removing the `const`
> > > qualifier, this patch allows drivers to prepare and manage DMA-safe
> > > buffers directly.
>
> > This is missing a changelog to v1 of the series.
>
> > Also I asked before why it is not possible to change the signature of
> > i2c_get_dma_safe_msg_buf() to accept 'const struct i2c_msg *' [0].
> > That looks like the nicer solution to me.
> The i2c_get_dma_safe_msg_buf() function has existed for a long time,
> but I do not know the original reason why it declares struct i2c_msg *
> without const.
I would guess that nobody ever cared before.
> However, I believe this is because the
> i2c_put_dma_safe_msg_buf() function modifies the buffer data, so for
> consistency, it is declared without const.
IMO that's a weak argument.
Maybe the maintainers have a preference?
Thomas
Powered by blists - more mailing lists