(Dropping the bazillion lists)

Quoting Wolfram Sang (2018-04-19 07:05:30)
> 
> Here is the cocci-script I created (after <n> iterations by manually checking
> samples):
> 
> @@
> struct device* d;
> identifier pdev;
> expression *ptr;
> @@
> (
> -       struct platform_device *pdev = to_platform_device(d);
> |
> -       struct platform_device *pdev;
>         ...
> -       pdev = to_platform_device(d);
> )
>         <... when != pdev
> -       &pdev->dev
> +       d
>         ...>
> 
>         ptr =
> -       platform_get_drvdata(pdev)
> +       dev_get_drvdata(d)
> 
>         <... when != pdev
> -       &pdev->dev
> +       d
>         ...>
> 

Can you throw this into scripts/coccinelle/ so we can have the build
testers run this all the time?

Reply via email to