Staging: media: Remove unnecessary else after return
Subsystems (2)
PATCH 1/1 Staging: media: Remove unnecessary else after return
This patch fixes checkpatch.pl warning in files of media
WARNING: else is not generally useful after a break or return
--- drivers/staging/media/vino/saa7191.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/staging/media/vino/saa7191.c +3 -4
@@ -393,11 +393,10 @@ static int saa7191_autodetect_norm(struct v4l2_subdev *sd)/* 60hz signal -> NTSC */ dprintk ("NTSC\n" );return saa7191_s_std (sd,V4L2_STD_NTSC ); - }else { -/* 50hz signal -> PAL */ -dprintk ("PAL\n" ); -return saa7191_s_std (sd,V4L2_STD_PAL ); } +/* 50hz signal -> PAL */ +dprintk ("PAL\n" ); +return saa7191_s_std (sd,V4L2_STD_PAL ); }static int saa7191_g_ctrl (struct v4l2_subdev *sd,struct v4l2_control *ctrl)
Signature · 1 line
1.9.1
Quoted 14 lines · Dilek Uzulmez
This patch fixes checkpatch.pl warning in files of media
WARNING: else is not generally useful after a break or returnSigned-off-by Dilek Uzulmez <[email protected]>--- drivers/staging/media/vino/saa7191.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)drivers/staging/media/vino/saa7191.c +0
-0@@ -393,11 +393,10 @@ static int saa7191_autodetect_norm(struct v4l2_subdev *sd)/* 60hz signal -> NTSC */
drivers/staging/media/vino/saa7191.c static int saa7191_autodetect_norm(struct v4l2_subdev *sd) · line 399
Quoted 10 lines
drivers/staging/media/vino/saa7191.c +3
-4dprintk ("NTSC\n" );return saa7191_s_std (sd,V4L2_STD_NTSC ); - }else { -/* 50hz signal -> PAL */ -dprintk ("PAL\n" ); -return saa7191_s_std (sd,V4L2_STD_PAL ); } +/* 50hz signal -> PAL */ +dprintk ("PAL\n" ); +return saa7191_s_std (sd,V4L2_STD_PAL );
It looks like the existing code is more parallel and easier to understand.
The checkpatch comment applies more to the case where one branch represents a failure. But that is not the case here.
julia
Quoted 13 lines
drivers/staging/media/vino/saa7191.c +0
-1}static int saa7191_g_ctrl (struct v4l2_subdev *sd,struct v4l2_control *ctrl) --1.9.1
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1424622517-7849-1-git-send-email-dilekuzulmez%40gmail.com.
For more options, visit https://groups.google.com/d/optout.