Re: [PATCH] checkpatch: Error out if deprecated RCU API used

From: Joe Perches
Date: Mon Mar 06 2023 - 22:23:37 EST


On Mon, 2023-03-06 at 22:10 -0500, Joel Fernandes wrote:
> On Mon, Mar 6, 2023 at 10:08 PM Joe Perches <joe@xxxxxxxxxxx> wrote:
> >
> > On Tue, 2023-03-07 at 03:04 +0000, Joel Fernandes (Google) wrote:
> > > Single-argument kvfree_rcu() usage is being deprecated [1] [2] as it is
> > > error-prone. However, till all users are converted, we would like to introduce
> > > checkpatch errors for new patches submitted.
> > >
> > > This patch adds support for the same. Tested with a trial patch.
> > >
> > > For now, we are only considering usages that don't have compound
> > > nesting, for example ignore: kvfree_rcu( (rcu_head_obj), rcu_head_name).
> > > This is sufficient as such usages are unlikely.
> > >
> > > Once all users are converted and we remove the old API, we can also revert this
> > > checkpatch patch then.
> >
> > I think this should be added to the deprecated_apis hash instead
> >
> > our %deprecated_apis = (
> > "synchronize_rcu_bh" => "synchronize_rcu",
> > "synchronize_rcu_bh_expedited" => "synchronize_rcu_expedited",
> > "call_rcu_bh" => "call_rcu",
> > "rcu_barrier_bh" => "rcu_barrier",
> > "synchronize_sched" => "synchronize_rcu",
> > "synchronize_sched_expedited" => "synchronize_rcu_expedited",
> > "call_rcu_sched" => "call_rcu",
> > "rcu_barrier_sched" => "rcu_barrier",
> > "get_state_synchronize_sched" => "get_state_synchronize_rcu",
> > "cond_synchronize_sched" => "cond_synchronize_rcu",
> > "kmap" => "kmap_local_page",
> > "kunmap" => "kunmap_local",
> > "kmap_atomic" => "kmap_local_page",
> > "kunmap_atomic" => "kunmap_local",
> > );
>
> This is not an API name change though, it is a "number of arguments"
> or argument list change. Is there a different way to do it?

Ah, no, not really.

btw: I don't see a single use of this call without a comma in the tree.