[PATCH v5 1/7] of: Make of_graph_get_port_by_id take a const device_node
Maxime Ripard
maxime at cerno.tech
Thu Oct 21 00:48:43 PDT 2021
On Tue, Oct 19, 2021 at 03:02:13PM +0300, Laurent Pinchart wrote:
> Hi Maxime,
>
> Thank you for the patch.
>
> On Wed, Sep 29, 2021 at 10:42:28AM +0200, Maxime Ripard wrote:
> > of_graph_get_port_by_id doesn't modify the device_node pointer it takes
> > as argument, so we can make it const.
>
> From a C point of view that's right, but conceptually speaking, is it
> right to return a non-const child port node of a const device_node ?
I mean, I guess not, but you're the one that asked for it:
https://lore.kernel.org/dri-devel/YBAiztjg0Jji9voK@pendragon.ideasonboard.com/
I can change it if you want, but certainly not if the only comment I get
on this series for the next year is going to be over whether or not
arguments of functions unrelated to the main intent should be constified
or not.
Maxime
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20211021/d36f8b0c/attachment-0001.sig>
More information about the linux-arm-kernel
mailing list