mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nadim almas <nadim.902@gmail.com>
To: gregkh@linuxfoundation.org
Cc: mmarek@suse.com, linux-kernel@vger.kernel.org,
	devel@driverdev.osuosl.org, Nadim almas <nadim.902@gmail.com>
Subject: [PATCH 32/32] Staging/octeon-usb/octeon-hcd.c: Compression of lines for immediate return This patch compresses two lines in to a single line in file octeon-hcd.c
Date: Fri, 22 Jul 2016 03:17:17 -0700	[thread overview]
Message-ID: <1469182637-4419-1-git-send-email-nadim.902@gmail.com> (raw)

if immediate return statement is found. It also removes variable
bytes_written as
it is no longer needed.

It is done using script Coccinelle. And coccinelle uses following
semantic
patch for this compression function:

@@
expression ret;
identifier f;
@@

-ret =
+return
     f(...);
-return ret;

Signed-off-by: Nadim Almas<nadim.902@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
---
 Makefile                                |  2 +-
 drivers/staging/octeon-usb/octeon-hcd.c | 16 ++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index 4fb6bea..3d9d77a6 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 4
 PATCHLEVEL = 7
 SUBLEVEL = 0
-EXTRAVERSION = -rc4
+EXTRAVERSION = -eudyptula-rc4
 NAME = Psychotic Stoned Sheep
 
 # *DOCUMENTATION*
diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c
index 17442b3..b801c8a 100644
--- a/drivers/staging/octeon-usb/octeon-hcd.c
+++ b/drivers/staging/octeon-usb/octeon-hcd.c
@@ -508,15 +508,15 @@ static int octeon_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb,
 {
 	int ret;
 
-	ret = octeon_alloc_temp_buffer(urb, mem_flags);
-	if (ret)
-		return ret;
+     
+	if (octeon_alloc_temp_buffer(urb, mem_flags))
+		return octeon_alloc_temp_buffer(urb, mem_flags);
 
-	ret = usb_hcd_map_urb_for_dma(hcd, urb, mem_flags);
-	if (ret)
+
+	if (usb_hcd_map_urb_for_dma(hcd, urb, mem_flags))
 		octeon_free_temp_buffer(urb);
 
-	return ret;
+	return usb_hcd_map_urb_for_dma(hcd, urb, mem_flags);
 }
 
 /**
@@ -542,8 +542,8 @@ static void octeon_unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb)
  */
 static inline u32 cvmx_usb_read_csr32(struct octeon_hcd *usb, u64 address)
 {
-	u32 result = cvmx_read64_uint32(address ^ 4);
-	return result;
+	 
+	return cvmx_read64_uint32(address ^ 4);
 }
 
 /**
-- 
2.7.4

             reply	other threads:[~2016-07-22 10:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-22 10:17 Nadim almas [this message]
2016-07-23 21:02 ` Markus Böhme
2016-07-23 21:10   ` Julia Lawall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469182637-4419-1-git-send-email-nadim.902@gmail.com \
    --to=nadim.902@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®