staging: media: davinci_vpfe: Rewrite return statement in vpfe_video.c
Subsystems (2)
PATCH v2 1/1 staging: media: davinci_vpfe: Rewrite return statement in vpfe_video.c
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.
---
Changes since v2:
- Aligned -ETIMEDOUT return statement with if condition
drivers/staging/media/davinci_vpfe/vpfe_video.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/staging/media/davinci_vpfe/vpfe_video.c +4 -1
@@ -346,7 +346,10 @@ static int vpfe_pipeline_disable(struct vpfe_pipeline *pipe) }mutex_unlock (&mdev->graph_mutex); -return (ret ==0 ) ? ret : -ETIMEDOUT ; +if (ret ==0 ) +return ret; + +return -ETIMEDOUT ; }/*
Signature · 1 line
1.7.9.5
Hi Lisa,
Thank you for the patch.
Quoted 19 lines · On Tuesday 10 December 2013 08:05:42 Lisa Nguyen wrote:
Rewrite the return statement in
vpfe_video.cto 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 <[email protected]>---
Changes since v2:
- Aligned-ETIMEDOUTreturn statement with if conditiondrivers/staging/media/davinci_vpfe/vpfe_video.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/staging/media/davinci_vpfe/vpfe_video.cindex 24d98a6..22e31d2 100644
drivers/staging/media/davinci_vpfe/vpfe_video.c static int vpfe_pipeline_disable(struct vpfe_pipeline · line 352
Quoted 8 lines
drivers/staging/media/davinci_vpfe/vpfe_video.c +4
-1@@ -346,7 +346,10 @@ static int vpfe_pipeline_disable(struct vpfe_pipeline *pipe) }mutex_unlock (&mdev->graph_mutex); -return (ret ==0 ) ? ret : -ETIMEDOUT ; +if (ret ==0 ) +return ret; + +return -ETIMEDOUT ;
I don't want to point the obvious, but what about just
return ret ? -ETIMEDOUT : 0;
or, if this is just about fixing the checkpatch.pl warning,
return ret == 0 ? ret : -ETIMEDOUT;
(I'd prefer the first)
Quoted 3 lines
drivers/staging/media/davinci_vpfe/vpfe_video.c +0
-0}/*
Signature · 3 lines
Regards, Laurent Pinchart
Hi Laurent,
Quoted 35 lines · Laurent Pinchart
Hi Lisa,
Thank you for the patch.
Quoted 19 lines · On Tuesday 10 December 2013 08:05:42 Lisa Nguyen wrote:
Rewrite the return statement in
vpfe_video.cto 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 <[email protected]>---
Changes since v2:
- Aligned-ETIMEDOUTreturn statement with if conditiondrivers/staging/media/davinci_vpfe/vpfe_video.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/staging/media/davinci_vpfe/vpfe_video.cindex 24d98a6..22e31d2 100644drivers/staging/media/davinci_vpfe/vpfe_video.c static int vpfe_pipeline_disable(struct vpfe_pipeline · line 352
Quoted 8 lines
drivers/staging/media/davinci_vpfe/vpfe_video.c +4
-1@@ -346,7 +346,10 @@ static int vpfe_pipeline_disable(struct vpfe_pipeline *pipe) }mutex_unlock (&mdev->graph_mutex); -return (ret ==0 ) ? ret : -ETIMEDOUT ; +if (ret ==0 ) +return ret; + +return -ETIMEDOUT ;I don't want to point the obvious, but what about just
Quoted 7 lines
return ret ? -ETIMEDOUT : 0;or, if this is just about fixing the checkpatch.pl warning,
return ret == 0 ? ret : -ETIMEDOUT;(I'd prefer the first)
I understand your point :) I was making changes based on Prabhakar's feedback he gave me a while back[1].
Should I wait until he says?
Lisa
[1] http://www.mail-archive.com/[email protected]/msg67833.html
Hi Lisa,
Quoted 41 lines · Lisa Nguyen
Hi Laurent,
Quoted 37 lines · Laurent Pinchart
Hi Lisa,
Thank you for the patch.
Quoted 19 lines · On Tuesday 10 December 2013 08:05:42 Lisa Nguyen wrote:
Rewrite the return statement in
vpfe_video.cto 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 <[email protected]>---
Changes since v2:
- Aligned-ETIMEDOUTreturn statement with if conditiondrivers/staging/media/davinci_vpfe/vpfe_video.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/staging/media/davinci_vpfe/vpfe_video.cindex 24d98a6..22e31d2 100644drivers/staging/media/davinci_vpfe/vpfe_video.c static int vpfe_pipeline_disable(struct vpfe_pipeline · line 352
Quoted 8 lines
drivers/staging/media/davinci_vpfe/vpfe_video.c +4
-1@@ -346,7 +346,10 @@ static int vpfe_pipeline_disable(struct vpfe_pipeline *pipe) }mutex_unlock (&mdev->graph_mutex); -return (ret ==0 ) ? ret : -ETIMEDOUT ; +if (ret ==0 ) +return ret; + +return -ETIMEDOUT ;I don't want to point the obvious, but what about just
return ret ? -ETIMEDOUT : 0;
Quoted 9 lines
Quoted 5 lines
or, if this is just about fixing the checkpatch.pl warning,
return ret == 0 ? ret : -ETIMEDOUT;(I'd prefer the first)
I understand your point :) I was making changes based on Prabhakar's feedback he gave me a while back[1].
Please go ahead as per Laurent's suggestion.
Thanks,
--Prabhakar Lad