lkml.org 
[lkml]   [2020]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] lib/list_sort: fix function type mismatches
On Sat, Jan 11, 2020 at 10:31 AM George Spelvin <lkml@sdf.org> wrote:
>
> > typedef int __attribute__((nonnull(2,3))) (*cmp_func)(void *,
> > - struct list_head const *, struct list_head const *);
> > + struct list_head *, struct list_head *);
>
> I'd prefer to leave the const there for documentation.

Not only. It's useful to show that we are not going to change those parameters.

> Does anyone object to fixing it in the other direction by *adding*
> const to all the call sites?

Agree.
Actually we have cmp_r_funct_t which might be used here (I didn't
check for the possibility, though).

>
> Andy Shevchenko posted a patch last 7 October that did that.
> <20191007135656.37734-1-andriy.shevchenko@linux.intel.com>
>
> (You could also try taking a second look at why __pure doesn't work,
> per AKPM's message of 16 April
> <20190416154522.65aaa348161fc581181b56d9@linux-foundation.org>)

Hint: When you post Message-Id you may prefix them with
https://lore.kernel.org/r/ which makes search a bit more convenient
and faster.


--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2020-01-11 11:37    [W:0.087 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site