From patchwork Wed May 1 09:32:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sylwester Nawrocki X-Patchwork-Id: 16553 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f71.google.com (mail-qe0-f71.google.com [209.85.128.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 01ECF23942 for ; Wed, 1 May 2013 09:32:17 +0000 (UTC) Received: by mail-qe0-f71.google.com with SMTP id 1sf2657322qee.2 for ; Wed, 01 May 2013 02:32:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:x-beenthere:x-received:received-spf:x-received :x-forwarded-to:x-forwarded-for:delivered-to:x-received:received-spf :x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type:content-transfer-encoding; bh=zCg4lAoT9gQpIEMfLae/7dNmzzbeq2NHi4mE5jWavLs=; b=TaHeKtQTno9f7fGHuZi0+HWuXBIdtmYTcKdMOT9klQLqdy+P9DO2l8VxQabRy+NK4Y nvsWLF8tCcRgjQw96L/x24zIw4Z+GbNaJ+oUo14TGgGJNU383afb3ndFBiAFkKKQGF7e oQ4/cfEk4dglsJZg5naACMzGYzAX4LaTerA57Oj58lt0QkERZXShCGlBYoixGC3enusn rzyNk4SScQjWn4wuiYAk4WjBILShpN+KtT86O4wTl1//CU2R5eQ8mLHvO1R0Hn+n73ZG WcI9aqZZub3UqCUeMpsPFrOQG29dBBBraW3R+7U2n0uA03ZHWOOhi8rOl+1V10f+G1ae GTGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-beenthere:x-received:received-spf:x-received :x-forwarded-to:x-forwarded-for:delivered-to:x-received:received-spf :x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type:content-transfer-encoding; bh=zCg4lAoT9gQpIEMfLae/7dNmzzbeq2NHi4mE5jWavLs=; b=TAU+YqgwUtMXSAxqQ4KduEWfh0OT7gFKdKtYBIDqkQeJ+CT4tqR93cyv2wz6HphK8j qbu7FxqTuA8sWtgMWzsGpK5ZnXqjUVY+m09FxgVd4XOUmmEdWKsImJD7j8AddBwooOaa OBDN48mosLloLIS6nfobX/GIoTvs/y1wd+yJhrirVw6EMcpb5LXTS/OK4YH1pspj7JWV QL2B2gmVv5Zb4yTGAjbzIiJAJuyEFkpq0iAzF6Hkkao9WiSu1hvRAn8UO43i1DO+qz65 d+r6O3xP0om+0XANrcVr7wakUoS85Cb4xoxuCtuuP/4Z5/BJFUnvx7+yIr5jrBRDmSxM 2uPw== X-Received: by 10.236.32.67 with SMTP id n43mr1563399yha.0.1367400733006; Wed, 01 May 2013 02:32:13 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.37.33 with SMTP id v1ls614786qej.76.gmail; Wed, 01 May 2013 02:32:12 -0700 (PDT) X-Received: by 10.52.21.173 with SMTP id w13mr525278vde.99.1367400732614; Wed, 01 May 2013 02:32:12 -0700 (PDT) Received: from mail-vb0-x22f.google.com (mail-vb0-x22f.google.com [2607:f8b0:400c:c02::22f]) by mx.google.com with ESMTPS id t8si919316vcz.74.2013.05.01.02.32.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 May 2013 02:32:12 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::22f; Received: by mail-vb0-f47.google.com with SMTP id x14so1102479vbb.6 for ; Wed, 01 May 2013 02:32:12 -0700 (PDT) X-Received: by 10.58.173.36 with SMTP id bh4mr669968vec.9.1367400732506; Wed, 01 May 2013 02:32:12 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp146162veb; Wed, 1 May 2013 02:32:11 -0700 (PDT) X-Received: by 10.14.213.67 with SMTP id z43mr5939741eeo.16.1367400731382; Wed, 01 May 2013 02:32:11 -0700 (PDT) Received: from mail-ee0-f51.google.com (mail-ee0-f51.google.com [74.125.83.51]) by mx.google.com with ESMTPS id f3si2275045eev.237.2013.05.01.02.32.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 May 2013 02:32:11 -0700 (PDT) Received-SPF: pass (google.com: domain of sylvester.nawrocki@gmail.com designates 74.125.83.51 as permitted sender) client-ip=74.125.83.51; Received: by mail-ee0-f51.google.com with SMTP id c1so591234eek.24 for ; Wed, 01 May 2013 02:32:10 -0700 (PDT) X-Received: by 10.14.9.71 with SMTP id 47mr5939760ees.21.1367400730285; Wed, 01 May 2013 02:32:10 -0700 (PDT) Received: from [192.168.1.110] (093105185086.warszawa.vectranet.pl. [93.105.185.86]) by mx.google.com with ESMTPSA id w52sm2635813eev.12.2013.05.01.02.32.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 May 2013 02:32:09 -0700 (PDT) Message-ID: <5180E117.1020006@gmail.com> Date: Wed, 01 May 2013 11:32:07 +0200 From: Sylwester Nawrocki User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120412 Thunderbird/11.0.1 MIME-Version: 1.0 To: Sachin Kamat 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 References: <1367302581-15478-1-git-send-email-sachin.kamat@linaro.org> In-Reply-To: <1367302581-15478-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQm6C5loZrH6xXBgrEaoxINvvPCF/GNGfGeViLfE/qPMGt8taTgsLI48y9fi4JukQMUn7gNP X-Original-Sender: sylvester.nawrocki@gmail.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gmail.com Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 > --- > 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: Thanks! Sylwester 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])) {