From: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
To: Sachin Kamat <sachin.kamat@linaro.org>
Cc: linux-media@vger.kernel.org, s.nawrocki@samsung.com, patches@linaro.org
Subject: Re: [PATCH 1/4] [media] s3c-camif: Remove redundant NULL check
Date: Wed, 01 May 2013 11:32:07 +0200 [thread overview]
Message-ID: <5180E117.1020006@gmail.com> (raw)
In-Reply-To: <1367302581-15478-1-git-send-email-sachin.kamat@linaro.org>
On 04/30/2013 08:16 AM, Sachin Kamat wrote:
> clk_unprepare checks for NULL pointer. Hence convert IS_ERR_OR_NULL
> to IS_ERR only.
>
> Signed-off-by: Sachin Kamat<sachin.kamat@linaro.org>
> ---
> drivers/media/platform/s3c-camif/camif-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/s3c-camif/camif-core.c b/drivers/media/platform/s3c-camif/camif-core.c
> index 0d0fab1..2449f13 100644
> --- a/drivers/media/platform/s3c-camif/camif-core.c
> +++ b/drivers/media/platform/s3c-camif/camif-core.c
> @@ -341,7 +341,7 @@ static void camif_clk_put(struct camif_dev *camif)
> int i;
>
> for (i = 0; i< CLK_MAX_NUM; i++) {
> - if (IS_ERR_OR_NULL(camif->clock[i]))
> + if (IS_ERR(camif->clock[i]))
> continue;
> clk_unprepare(camif->clock[i]);
> clk_put(camif->clock[i]);
Patch applied for 3.11 with following chunk squashed to it:
diff --git a/drivers/media/platform/s3c-camif/camif-core.c
b/drivers/media/platform/s3c-camif/camif-core.c
index 2449f13..b385747 100644
--- a/drivers/media/platform/s3c-camif/camif-core.c
+++ b/drivers/media/platform/s3c-camif/camif-core.c
@@ -345,6 +345,7 @@ static void camif_clk_put(struct camif_dev *camif)
continue;
clk_unprepare(camif->clock[i]);
clk_put(camif->clock[i]);
+ camif->clock[i] = ERR_PTR(-EINVAL);
}
}
@@ -352,6 +353,9 @@ static int camif_clk_get(struct camif_dev *camif)
{
int ret, i;
+ for (i = 1; i < CLK_MAX_NUM; i++)
+ camif->clock[i] = ERR_PTR(-EINVAL);
+
for (i = 0; i < CLK_MAX_NUM; i++) {
camif->clock[i] = clk_get(camif->dev, camif_clocks[i]);
if (IS_ERR(camif->clock[i])) {
Thanks!
Sylwester
next prev parent reply other threads:[~2013-05-01 9:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-30 6:16 [PATCH 1/4] [media] s3c-camif: Remove redundant NULL check Sachin Kamat
2013-04-30 6:16 ` [PATCH 2/4] [media] s3c-camif: Fix incorrect variable type Sachin Kamat
2013-04-30 6:16 ` [PATCH 3/4] [media] s3c-camif: Staticize local symbols Sachin Kamat
2013-04-30 6:16 ` [PATCH 4/4] [media] s3c-camif: Use dev_info instead of printk Sachin Kamat
2013-05-01 9:32 ` Sylwester Nawrocki [this message]
2013-05-02 4:20 ` [PATCH 1/4] [media] s3c-camif: Remove redundant NULL check Sachin Kamat
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=5180E117.1020006@gmail.com \
--to=sylvester.nawrocki@gmail.com \
--cc=linux-media@vger.kernel.org \
--cc=patches@linaro.org \
--cc=s.nawrocki@samsung.com \
--cc=sachin.kamat@linaro.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox