lkml.org 
[lkml]   [2019]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 2/3] Coccinelle: pci_free_consistent: Reduce a bit of duplicate SmPL code
From
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 14 May 2019 17:18:24 +0200

A return statement was specified with a known value for three branches
of a SmPL disjunction.
Reduce duplicate SmPL code there by using another disjunction for
these return values.

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

diff --git a/scripts/coccinelle/free/pci_free_consistent.cocci b/scripts/coccinelle/free/pci_free_consistent.cocci
index 2056d6680cb8..45bc14ece151 100644
--- a/scripts/coccinelle/free/pci_free_consistent.cocci
+++ b/scripts/coccinelle/free/pci_free_consistent.cocci
@@ -25,11 +25,11 @@ if (id == NULL || ...) { ... return ...; }
when != e = (T)id
when exists
(
-return 0;
-|
-return 1;
-|
-return id;
+ return
+(0
+|1
+|id
+);
|
return@p2 ...;
)
--
2.21.0
\
 
 \ /
  Last update: 2019-05-14 18:51    [W:0.071 / U:3.732 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site