diff mbox

[4/6,OPW,kernel] Staging: media: lirc: fixed else after return or break warning

Message ID d5d08adeba607bff21ad86f4d0b51801c09e008f.1411278275.git.tapaswenipathak@gmail.com
State New, archived
Headers show

Commit Message

Tapasweni Pathak Sept. 21, 2014, 6:21 a.m. UTC
This patch fixes checkpatch.pl warning in file lirc_serial.c
WARNING : else is not generally useful after a break or return

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
---
 drivers/staging/media/lirc/lirc_serial.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

--
1.7.0.4

Comments

Julia Lawall Sept. 21, 2014, 6:24 a.m. UTC | #1
Instead of using "fix" all the time in the subject, it could be better to
use a word that describes what you did to fix it.  There are no breaks in
your case, so there is no need to mention that in the subject.  You could
just say "remove else after return".

julia

On Sun, 21 Sep 2014, Tapasweni Pathak wrote:

> This patch fixes checkpatch.pl warning in file lirc_serial.c
> WARNING : else is not generally useful after a break or return
>
> Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
> ---
>  drivers/staging/media/lirc/lirc_serial.c |    9 ++++-----
>  1 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/media/lirc/lirc_serial.c b/drivers/staging/media/lirc/lirc_serial.c
> index 1eb5b32..95763ac 100644
> --- a/drivers/staging/media/lirc/lirc_serial.c
> +++ b/drivers/staging/media/lirc/lirc_serial.c
> @@ -529,11 +529,10 @@ static long send_pulse_homebrew(unsigned long length)
>
>  	if (softcarrier)
>  		return send_pulse_homebrew_softcarrier(length);
> -	else {
> -		on();
> -		safe_udelay(length);
> -		return 0;
> -	}
> +
> +	on();
> +	safe_udelay(length);
> +	return 0;
>  }
>
>  static void send_space_irdeo(long length)
> --
> 1.7.0.4
>
> --
> You received this message because you are subscribed to the Google Groups "opw-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opw-kernel+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
diff mbox

Patch

diff --git a/drivers/staging/media/lirc/lirc_serial.c b/drivers/staging/media/lirc/lirc_serial.c
index 1eb5b32..95763ac 100644
--- a/drivers/staging/media/lirc/lirc_serial.c
+++ b/drivers/staging/media/lirc/lirc_serial.c
@@ -529,11 +529,10 @@  static long send_pulse_homebrew(unsigned long length)

 	if (softcarrier)
 		return send_pulse_homebrew_softcarrier(length);
-	else {
-		on();
-		safe_udelay(length);
-		return 0;
-	}
+
+	on();
+	safe_udelay(length);
+	return 0;
 }

 static void send_space_irdeo(long length)