All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@xilinx.com>
To: "Gustavo A. R. Silva" <garsilva@embeddedor.com>,
	"Felipe Balbi" <balbi@kernel.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Michal Simek" <michal.simek@xilinx.com>,
	"Sören Brinkmann" <soren.brinkmann@xilinx.com>
Cc: <linux-usb@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb: gadget: udc-xilinx: compress return logic into one line
Date: Mon, 10 Jul 2017 08:32:55 +0200	[thread overview]
Message-ID: <73e25e50-c65a-bd43-d51c-1291a9168cd2@xilinx.com> (raw)
In-Reply-To: <20170710030458.GA14639@embeddedgus>

On 10.7.2017 05:04, Gustavo A. R. Silva wrote:
> Simplify return logic to avoid unnecessary variable assignment.
> 
> This issue was detected using Coccinelle and the following
> semantic patch:
> 
> @@
> local idexpression ret;
> expression e;
> @@
> 
> -ret =
> +return
>      e;
> -return ret;
> 
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
>  drivers/usb/gadget/udc/udc-xilinx.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c
> index de207a9..552389d 100644
> --- a/drivers/usb/gadget/udc/udc-xilinx.c
> +++ b/drivers/usb/gadget/udc/udc-xilinx.c
> @@ -1217,14 +1217,13 @@ static const struct usb_ep_ops xusb_ep_ops = {
>  static int xudc_get_frame(struct usb_gadget *gadget)
>  {
>  	struct xusb_udc *udc;
> -	int frame;
>  
>  	if (!gadget)
>  		return -ENODEV;
>  
>  	udc = to_udc(gadget);
> -	frame = udc->read_fn(udc->addr + XUSB_FRAMENUM_OFFSET);
> -	return frame;
> +
> +	return udc->read_fn(udc->addr + XUSB_FRAMENUM_OFFSET);
>  }
>  
>  /**
> 

Acked-by: Michal Simek <michal.simek@xilinx.com>

Thanks,
Michal

WARNING: multiple messages have this Message-ID (diff)
From: michal.simek@xilinx.com (Michal Simek)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] usb: gadget: udc-xilinx: compress return logic into one line
Date: Mon, 10 Jul 2017 08:32:55 +0200	[thread overview]
Message-ID: <73e25e50-c65a-bd43-d51c-1291a9168cd2@xilinx.com> (raw)
In-Reply-To: <20170710030458.GA14639@embeddedgus>

On 10.7.2017 05:04, Gustavo A. R. Silva wrote:
> Simplify return logic to avoid unnecessary variable assignment.
> 
> This issue was detected using Coccinelle and the following
> semantic patch:
> 
> @@
> local idexpression ret;
> expression e;
> @@
> 
> -ret =
> +return
>      e;
> -return ret;
> 
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
>  drivers/usb/gadget/udc/udc-xilinx.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c
> index de207a9..552389d 100644
> --- a/drivers/usb/gadget/udc/udc-xilinx.c
> +++ b/drivers/usb/gadget/udc/udc-xilinx.c
> @@ -1217,14 +1217,13 @@ static const struct usb_ep_ops xusb_ep_ops = {
>  static int xudc_get_frame(struct usb_gadget *gadget)
>  {
>  	struct xusb_udc *udc;
> -	int frame;
>  
>  	if (!gadget)
>  		return -ENODEV;
>  
>  	udc = to_udc(gadget);
> -	frame = udc->read_fn(udc->addr + XUSB_FRAMENUM_OFFSET);
> -	return frame;
> +
> +	return udc->read_fn(udc->addr + XUSB_FRAMENUM_OFFSET);
>  }
>  
>  /**
> 

Acked-by: Michal Simek <michal.simek@xilinx.com>

Thanks,
Michal

  reply	other threads:[~2017-07-10  6:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-10  3:04 [PATCH] usb: gadget: udc-xilinx: compress return logic into one line Gustavo A. R. Silva
2017-07-10  3:04 ` Gustavo A. R. Silva
2017-07-10  6:32 ` Michal Simek [this message]
2017-07-10  6:32   ` Michal Simek

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=73e25e50-c65a-bd43-d51c-1291a9168cd2@xilinx.com \
    --to=michal.simek@xilinx.com \
    --cc=balbi@kernel.org \
    --cc=garsilva@embeddedor.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=soren.brinkmann@xilinx.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 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.