lkml.org 
[lkml]   [2022]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 4/5] device property: Constify fwnode_handle_get()
On Wed, Apr 13, 2022 at 09:23:17PM +0300, Andy Shevchenko wrote:
> On Wed, Apr 13, 2022 at 09:19:28PM +0300, Andy Shevchenko wrote:
> > On Wed, Apr 13, 2022 at 08:10:22PM +0200, Rafael J. Wysocki wrote:
> > > On Fri, Apr 8, 2022 at 8:49 PM Andy Shevchenko
> > > <andriy.shevchenko@linux.intel.com> wrote:
>
> ...
>
> > > > -struct fwnode_handle *fwnode_handle_get(struct fwnode_handle *fwnode)
> > > > +struct fwnode_handle *fwnode_handle_get(const struct fwnode_handle *fwnode)
> > > > {
> >
> > > > if (!fwnode_has_op(fwnode, get))
> > > > return fwnode;
> >
> > ^^^^, so it needs a casting, but then we have to comment why is so.
>
> Note, it means that the fwnode parameter either invalid or has no given option.
> It's not a problem to drop casting in the first case, but the second one should
> be justified and Sakari wants to be sure that the initial container is not
> const, which seems can't be achieved even with the original code.

I wonder if I'm missing something. The fwnode argument originally was not
const here.

--
Sakari Ailus

\
 
 \ /
  Last update: 2022-04-13 23:49    [W:0.072 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site