From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Lisa Nguyen <lisa@xenapiadmin.com>
Cc: prabhakar.csengg@gmail.com,
davinci-linux-open-source@linux.davincidsp.com,
linux-media@vger.kernel.org, m.chehab@samsung.com
Subject: Re: [PATCH v2] staging: media: davinci_vpfe: Rewrite return statement in vpfe_video.c
Date: Tue, 10 Dec 2013 17:50:41 +0100 [thread overview]
Message-ID: <2939201.P8qvUzaVN6@avalon> (raw)
In-Reply-To: <20131210160541.GA15282@ubuntu>
Hi Lisa,
Thank you for the patch.
On Tuesday 10 December 2013 08:05:42 Lisa Nguyen wrote:
> 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 <lisa@xenapiadmin.com>
> ---
> 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(-)
>
> diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.c
> b/drivers/staging/media/davinci_vpfe/vpfe_video.c index 24d98a6..22e31d2
> 100644
> --- 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) }
> 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)
> }
>
> /*
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2013-12-10 16:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-10 16:05 [PATCH v2] staging: media: davinci_vpfe: Rewrite return statement in vpfe_video.c Lisa Nguyen
2013-12-10 16:50 ` Laurent Pinchart [this message]
2013-12-10 17:57 ` Lisa Nguyen
2013-12-11 3:04 ` Prabhakar Lad
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2939201.P8qvUzaVN6@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=davinci-linux-open-source@linux.davincidsp.com \
--cc=linux-media@vger.kernel.org \
--cc=lisa@xenapiadmin.com \
--cc=m.chehab@samsung.com \
--cc=prabhakar.csengg@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.