Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762230AbcJaIUX (ORCPT ); Mon, 31 Oct 2016 04:20:23 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:32945 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762085AbcJaIUW (ORCPT ); Mon, 31 Oct 2016 04:20:22 -0400 Date: Mon, 31 Oct 2016 13:50:11 +0530 From: Nadim Almas 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 Message-ID: <20161031082011.GA4131@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 965 Lines: 39 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 --- 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