public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: "Geyslan G. Bem" <geyslan@gmail.com>, peter.senna@gmail.com
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Alan Stern <stern@rowland.harvard.edu>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH 10/10] usb: host: ehci-sched: remove unnecessary braces
Date: Sat, 12 Dec 2015 17:50:25 +0300	[thread overview]
Message-ID: <566C3431.1090808@cogentembedded.com> (raw)
In-Reply-To: <1449883170-21225-11-git-send-email-geyslan@gmail.com>

On 12/12/2015 4:19 AM, Geyslan G. Bem wrote:

> This patch removes unnecessary braces in single statement blocks at the
> same time as replaces the if statement with a ternary conditional.
>
> Tested by compilation only.
> Caught by checkpatch.
>
> Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
> ---
>   drivers/usb/host/ehci-sched.c | 6 +-----
>   1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
> index 1dc1d5c..f6e828a 100644
> --- a/drivers/usb/host/ehci-sched.c
> +++ b/drivers/usb/host/ehci-sched.c
> @@ -1060,11 +1060,7 @@ iso_stream_init(
>   	epnum = usb_pipeendpoint(urb->pipe);
>   	is_input = usb_pipein(urb->pipe) ? USB_DIR_IN : 0;
>   	maxp = usb_endpoint_maxp(&urb->ep->desc);
> -	if (is_input) {
> -		buf1 = (1 << 11);
> -	} else {
> -		buf1 = 0;
> -	}
> +	buf1 = (is_input) ? (1 << 11) : 0;

    Parens not needed, especially the first ones.

[...]

MBR, Sergei


  reply	other threads:[~2015-12-12 14:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-12  1:19 [PATCH 00/10] usb: host: ehci-sched: cleanup Geyslan G. Bem
2015-12-12  1:19 ` [PATCH 01/10] usb: host: ehci-sched: refactor scan_isoc function Geyslan G. Bem
2015-12-12 16:15   ` Alan Stern
2015-12-12 16:52     ` Geyslan G. Bem
2015-12-12 17:11       ` Alan Stern
2015-12-12  1:19 ` [PATCH 02/10] usb: host: ehci-sched: move constants to right Geyslan G. Bem
2015-12-12  1:19 ` [PATCH 03/10] usb: host: ehci-sched: remove useless assignments Geyslan G. Bem
2015-12-12 14:48   ` Sergei Shtylyov
2015-12-12 15:43     ` Geyslan G. Bem
2015-12-12  1:19 ` [PATCH 04/10] usb: host: ehci-sched: add spaces around operators Geyslan G. Bem
2015-12-12  1:19 ` [PATCH 05/10] usb: host: ehci-sched: remove prohibited spaces Geyslan G. Bem
2015-12-12  1:19 ` [PATCH 06/10] usb: host: ehci-sched: remove useless else branch Geyslan G. Bem
2015-12-12  1:19 ` [PATCH 07/10] usb: host: ehci-sched: use C89-style comments Geyslan G. Bem
2015-12-12  1:19 ` [PATCH 08/10] usb: host: ehci-sched: add line after declarations Geyslan G. Bem
2015-12-12  1:19 ` [PATCH 09/10] usb: host: ehci-sched: use sizeof operator with parens Geyslan G. Bem
2015-12-12  1:19 ` [PATCH 10/10] usb: host: ehci-sched: remove unnecessary braces Geyslan G. Bem
2015-12-12 14:50   ` Sergei Shtylyov [this message]
2015-12-12 15:48     ` Geyslan G. Bem

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=566C3431.1090808@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=geyslan@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.senna@gmail.com \
    --cc=stern@rowland.harvard.edu \
    /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