lkml.org 
[lkml]   [2019]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH 3/5] Coccinelle: put_device: Merge four SmPL when constraints into one
    From
    Date
    From: Markus Elfring <elfring@users.sourceforge.net>
    Date: Sun, 12 May 2019 18:32:46 +0200

    An assignment target was repeated in four SmPL when constraints.
    Combine the exclusion specifications into disjunctions for the semantic
    patch language so that this target is referenced only once there.

    Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
    ---
    scripts/coccinelle/free/put_device.cocci | 5 +----
    1 file changed, 1 insertion(+), 4 deletions(-)

    diff --git a/scripts/coccinelle/free/put_device.cocci b/scripts/coccinelle/free/put_device.cocci
    index 120921366e84..aae79c02c1e0 100644
    --- a/scripts/coccinelle/free/put_device.cocci
    +++ b/scripts/coccinelle/free/put_device.cocci
    @@ -23,10 +23,7 @@ if (id == NULL || ...) { ... return ...; }
    when != platform_device_put(id)
    when != of_dev_put(id)
    when != if (id) { ... put_device(&id->dev) ... }
    - when != e1 = (T)id
    - when != e1 = (T)(&id->dev)
    - when != e1 = get_device(&id->dev)
    - when != e1 = (T1)platform_get_drvdata(id)
    + when != e1 = \( (T) \( id \| (&id->dev) \) \| get_device(&id->dev) \| (T1)platform_get_drvdata(id) \)
    (
    return
    ( id
    --
    2.21.0
    \
     
     \ /
      Last update: 2019-05-13 11:06    [W:2.094 / U:0.252 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site