Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1290208

Re: [PATCH 10/10] usb: host: ehci-sched: remove unnecessary braces

From Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Newsgroups linux.kernel
Subject Re: [PATCH 10/10] usb: host: ehci-sched: remove unnecessary braces
Date 2015-12-12 16:00 +0100
Message-ID <qETOq-3rt-5@gated-at.bofh.it> (permalink)
References <qEH0S-3KF-3@gated-at.bofh.it> <qEHay-3O5-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/10] usb: host: ehci-sched: cleanup "Geyslan G. Bem" <geyslan@gmail.com> - 2015-12-12 02:20 +0100
  [PATCH 04/10] usb: host: ehci-sched: add spaces around operators "Geyslan G. Bem" <geyslan@gmail.com> - 2015-12-12 02:30 +0100
  [PATCH 08/10] usb: host: ehci-sched: add line after declarations "Geyslan G. Bem" <geyslan@gmail.com> - 2015-12-12 02:30 +0100
  [PATCH 10/10] usb: host: ehci-sched: remove unnecessary braces "Geyslan G. Bem" <geyslan@gmail.com> - 2015-12-12 02:30 +0100
    Re: [PATCH 10/10] usb: host: ehci-sched: remove unnecessary braces Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-12-12 16:00 +0100
      Re: [PATCH 10/10] usb: host: ehci-sched: remove unnecessary braces "Geyslan G. Bem" <geyslan@gmail.com> - 2015-12-12 16:50 +0100
  [PATCH 03/10] usb: host: ehci-sched: remove useless assignments "Geyslan G. Bem" <geyslan@gmail.com> - 2015-12-12 02:30 +0100
    Re: [PATCH 03/10] usb: host: ehci-sched: remove useless assignments Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-12-12 15:50 +0100
      Re: [PATCH 03/10] usb: host: ehci-sched: remove useless assignments "Geyslan G. Bem" <geyslan@gmail.com> - 2015-12-12 16:50 +0100
  [PATCH 06/10] usb: host: ehci-sched: remove useless else branch "Geyslan G. Bem" <geyslan@gmail.com> - 2015-12-12 02:30 +0100
  [PATCH 01/10] usb: host: ehci-sched: refactor scan_isoc function "Geyslan G. Bem" <geyslan@gmail.com> - 2015-12-12 02:30 +0100
    Re: [PATCH 01/10] usb: host: ehci-sched: refactor scan_isoc function Alan Stern <stern@rowland.harvard.edu> - 2015-12-12 17:20 +0100
      Re: [PATCH 01/10] usb: host: ehci-sched: refactor scan_isoc function "Geyslan G. Bem" <geyslan@gmail.com> - 2015-12-12 18:00 +0100
        Re: [PATCH 01/10] usb: host: ehci-sched: refactor scan_isoc function Alan Stern <stern@rowland.harvard.edu> - 2015-12-12 18:20 +0100
  [PATCH 07/10] usb: host: ehci-sched: use C89-style comments "Geyslan G. Bem" <geyslan@gmail.com> - 2015-12-12 02:30 +0100
  [PATCH 05/10] usb: host: ehci-sched: remove prohibited spaces "Geyslan G. Bem" <geyslan@gmail.com> - 2015-12-12 02:30 +0100
  [PATCH 09/10] usb: host: ehci-sched: use sizeof operator with parens "Geyslan G. Bem" <geyslan@gmail.com> - 2015-12-12 02:30 +0100
  [PATCH 02/10] usb: host: ehci-sched: move constants to right "Geyslan G. Bem" <geyslan@gmail.com> - 2015-12-12 02:30 +0100

csiph-web