Re: [PATCH 1/2] staging: media: davinci_vpfe: Rewrite return statement in vpfe_video.c

2013-10-30 Thread Dan Carpenter
On Mon, Oct 28, 2013 at 01:19:29PM -0700, Lisa Nguyen wrote: --- a/drivers/staging/media/davinci_vpfe/vpfe_video.c +++ b/drivers/staging/media/davinci_vpfe/vpfe_video.c @@ -346,7 +346,10 @@ static int vpfe_pipeline_disable(struct vpfe_pipeline *pipe) }

Re: [PATCH 1/2] staging: media: davinci_vpfe: Rewrite return statement in vpfe_video.c

2013-10-29 Thread Greg KH
On Tue, Oct 29, 2013 at 12:14:14AM +0100, Andi Shyti wrote: Hi Greg, If you write it like this: return !ret ? ret : -ETIMEDOUT; checkpatch shouldn't complain. No, but I will. That's horrid code, please be specific and readable, no one should ever use ?: syntax

[PATCH 1/2] staging: media: davinci_vpfe: Rewrite return statement in vpfe_video.c

2013-10-28 Thread Lisa Nguyen
Rewrite the return statement in vpfe_video.c to eliminate the use of a ternary operator. This will prevent the checkpatch.pl script from generating a warning saying to remove () from this particular return statement. Signed-off-by: Lisa Nguyen l...@xenapiadmin.com ---

Re: [PATCH 1/2] staging: media: davinci_vpfe: Rewrite return statement in vpfe_video.c

2013-10-28 Thread Lisa Nguyen
On Mon, Oct 28, 2013 at 3:11 PM, Greg KH gre...@linuxfoundation.org wrote: On Mon, Oct 28, 2013 at 10:51:38PM +0100, Andi Shyti wrote: - return (ret == 0) ? ret : -ETIMEDOUT ; + if (ret == 0) + return ret; + else + return -ETIMEDOUT; I actually like more the

Re: [PATCH 1/2] staging: media: davinci_vpfe: Rewrite return statement in vpfe_video.c

2013-10-28 Thread Andi Shyti
Hi Greg, If you write it like this: return !ret ? ret : -ETIMEDOUT; checkpatch shouldn't complain. No, but I will. That's horrid code, please be specific and readable, no one should ever use ?: syntax except within function parameters. why then don't we define it in the