Re: [PATCH 2/5] driver core: Introduce an API constify_device_find_child_helper()

From: Greg Kroah-Hartman
Date: Tue Aug 13 2024 - 05:45:57 EST


On Sun, Aug 11, 2024 at 08:18:08AM +0800, Zijun Hu wrote:
> From: Zijun Hu <quic_zijuhu@xxxxxxxxxxx>
>
> Introduce constify_device_find_child_helper() to replace existing
> device_find_child()'s usages whose match functions will modify
> caller's match data.

Ick, that's not a good name, it should be "noun_verb" with the subsystem being on the prefix always.

But why is this even needed? Device pointers are NOT const for the
obvious reason that they can be changed by loads of different things.
Trying to force them to be const is going to be hard, if not impossible.

thanks,

greg k-h