Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752029AbbLLQTT (ORCPT ); Sat, 12 Dec 2015 11:19:19 -0500 Received: from netrider.rowland.org ([192.131.102.5]:42926 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751827AbbLLQTQ (ORCPT ); Sat, 12 Dec 2015 11:19:16 -0500 Date: Sat, 12 Dec 2015 11:19:15 -0500 (EST) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: "Geyslan G. Bem" cc: joe@perches.com, , Greg Kroah-Hartman , , Subject: Re: [PATCH] usb: host: ehci-sched: silence checkpatch warning In-Reply-To: <1449885021-25261-1-git-send-email-geyslan@gmail.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1659 Lines: 54 On Fri, 11 Dec 2015, Geyslan G. Bem wrote: > This patch moves comment into the else branch avoiding the following > misleading warning. > > "braces {} are not necessary for single statement blocks" > > Caught by checkpatch. > > Signed-off-by: Geyslan G. Bem > Suggested-by: Joe Perches > --- > drivers/usb/host/ehci-sched.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c > index f6e828a..b2af0b3 100644 > --- a/drivers/usb/host/ehci-sched.c > +++ b/drivers/usb/host/ehci-sched.c > @@ -1560,13 +1560,10 @@ iso_stream_schedule( > (stream->ps.bw_period - 1); > stream->ps.phase_uf = start & 7; > reserve_release_iso_bandwidth(ehci, stream, 1); > - } > - > - /* New stream is already scheduled; use the upcoming slot */ > - else { > + } else { > + /* New stream is already scheduled; use the upcoming slot */ Please don't do this. The comment at the start of the "if" part of this statement comes before the "if" line, so the commend at the start of the "else" part should come before the "else" line. If you want to silence the warning about unnecessary braces, get rid of the braces. > start = (stream->ps.phase << 3) + stream->ps.phase_uf; > } > - Don't do this. > stream->next_uframe = start; > new_stream = true; > } Alan Stern -- 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/