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: 2507301 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 6CBA9DF230 for ; Wed, 1 May 2013 09:32:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757090Ab3EAJcM (ORCPT ); Wed, 1 May 2013 05:32:12 -0400 Received: from mail-ee0-f51.google.com ([74.125.83.51]:37533 "EHLO mail-ee0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754944Ab3EAJcL (ORCPT ); Wed, 1 May 2013 05:32:11 -0400 Received: by mail-ee0-f51.google.com with SMTP id c1so592098eek.10 for ; Wed, 01 May 2013 02:32:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=zCg4lAoT9gQpIEMfLae/7dNmzzbeq2NHi4mE5jWavLs=; b=VLVRtBu/78O0bn9GtQrAxCTeGb9PH2ODEe/U0qLoTUlQU+9fh5uKIrknoahMprz7nd VYQD06k9exLd0vLnBCj+efQUyWlTZUWXHkhgcmaitofC1BEucsbc8Jrg9Ua5B3A8Dqtr bJtECVGU+ef4lFLWfVBXI61CkxZGe/kv4m7TtI0vco9BHhd52vAoVy+k7ud2VXzFPO/b WSAJB/hWuTMHVkxrHOBIHDFFZIciSCi8ZPghz+d5laFiIOP4LZ7rh9U0RLMURjQfPh6t OmICgifqBGbGX0Wr2slUs4XYaNHi6Ijg3qpbkjGc9cYqJQ5tA0NTIf+XCX1c17GxNgFd D93Q== 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> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.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 > --- > 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 --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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])) {