Re: [PRE-REVIEW PATCH 11/16] treewide: Globally replace tasklet_init() by tasklet_setup()

Romain Perier
2019-10-01T17:18:50Z

[-- Attachment #1: Type: text/plain, Size: 2179 bytes --]

On Mon, Sep 30, 2019 at 03:46:29PM -0700, Kees Cook wrote:
> On Sun, Sep 29, 2019 at 06:30:23PM +0200, Romain Perier wrote:
> > This converts all remaining cases of the old tasklet_init() API into
> > tasklet_setup(), where the callback argument is the structure already
> > holding the struct tasklet_struct. These should have no behavioral changes,
> > since they just change which pointer is passed into the callback with
> > the same available pointers after conversion. Moreover, all callbacks
> > that were not passing a pointer of structure holding the struct
> > tasklet_struct has already been converted.
>
> Was this done mechanically with Coccinelle or manually? (If done with
> Coccinelle, please include the script in the commit log.) To land a
> treewide change like this usually you'll need to separate the mechanical
> from the manual as Linus likes to run those changes himself sometimes.

Hi,

This was done with both technics mechanically with a "buggy" Coccinelle
script, after what I have fixed building errors and mismatches (even if it's
clearly super powerful, it was my first complex cocci script). 80% of trivial
replacements were done with a Cocci script, the rest was done manually.
That's complicated to remember which one was mechanically or manually to
be honnest :=D

What I can propose is the following:

- A commit for trivial tasklet_init() -> tasklet_setup() replacements:
it would contain basic replacements of the calls "tasklet_init() ->
tasklet_setup()" and addition of "from_tasklet()" without any other
changes.

- A second commit for more complicated replacements:
It would contain replacements of functions that are in different
modules, or modules that use function pointer for tasklet handlers
etc... Basically everything that is not covered by the first commit

What do you think ?
Moreover, the cocci script I have used is... ugly... so I don't want to
see Linus's eyes bleed :=D

PS: I can try to recover the cocci script in my git repo by using "git
reflog". And put the cocci script in the first commit (for trivial
replacements), in the worst case...

Regards,
Romain

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]