All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nadim Almas <nadim.902@gmail.com>
To: gregkh@linuxfoundation.org, janani.rvchndrn@gmail.com
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH] Staging:emxx_udc:emxx_udc: Compression of lines for immediate return
Date: Mon, 31 Oct 2016 13:50:11 +0530	[thread overview]
Message-ID: <20161031082011.GA4131@gmail.com> (raw)

This patch compresses two lines into a single line
if immediate return statement is found. Remove variable data as
it is no longer needed.

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

@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;

Signed-off-by: Nadim Almas <nadim.902@gmail.com>
---
 drivers/staging/emxx_udc/emxx_udc.c       | 4 +---
 
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c
index abe2aaf..31f4206 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -2979,9 +2979,7 @@ static int nbu2ss_gad_get_frame(struct usb_gadget *pgadget)
 	if (data == 0)
 		return -EINVAL;
 
-	data = _nbu2ss_readl(&udc->p_regs->USB_ADDRESS) & FRAME;
-
-	return data;
+	return _nbu2ss_readl(&udc->p_regs->USB_ADDRESS) & FRAME;
 }
 
 
2.7.4

                 reply	other threads:[~2016-10-31  8:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20161031082011.GA4131@gmail.com \
    --to=nadim.902@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=janani.rvchndrn@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.