lkml.org 
[lkml]   [2023]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 3/4] rculist.h: Fix parentheses around macro pointer parameter use
On Thu, 4 May 2023 12:19:38 -0400
Joel Fernandes <joel@joelfernandes.org> wrote:

> > void f(void)
> > {
> > struct test *t1;
> > struct test **t2 = &t1;
> >
> > list_for_each_entry_rcu((*t2), &testlist, node) { /* works */
> > //...
> > }
> > list_for_each_entry_rcu(*t2, &testlist, node) { /* broken */
> > //...
> > }
>
> Yeah it is not clear why anyone would ever want to use it like this.
> Why don't they just pass t1 to list_for_each_entry_rcu() ? I would
> rather it break them and they re-think their code ;).

Remember interfaces should not be enforcing policy unless it's key to the
way the interface works.

-- Steve

\
 
 \ /
  Last update: 2023-05-05 16:07    [W:0.057 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site