Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1540514ybb; Thu, 2 Apr 2020 02:48:38 -0700 (PDT) X-Google-Smtp-Source: APiQypK/StJFVaAZsqEVKqnr2z5GF/XUBVt/7s4W7SimmMs9dxZe82CJsxQqOP2nfel8RhMqtZS2 X-Received: by 2002:aca:ecd0:: with SMTP id k199mr1629137oih.60.1585820918732; Thu, 02 Apr 2020 02:48:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585820918; cv=none; d=google.com; s=arc-20160816; b=vbvii/zK5fkg4oExp9tEovhlPbF/IIJMwNqSM0NoKH0rP//KWePd7yTGBxuzZqsYDU WrEDZT7TGV8FswiWWihwyAAoBDmVXiQLFo4WPz5HNWUVb/yGtYFJe9yvdi5pEq8+EGKq UVec5cVRqP+7q44E7aWkG7vNXp6an5RSrxoVLUrHcAdHoDEw0u4w5cKPdJ7nYNMWyFTq 6jCsWbF3fPoepP43GCFuUIFFbx3sIuJGCa95k7jxdVE+RE9xm3hE9n7yS8UrmfZB5eO0 euXsLVJADvQXpCBMgr+LqpHEBNzdtuKm//Z8+qck6EJyLhicECM0u3Wko43Vk7yPHA6b vEFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=M6M8eg1K5OW0Fw3QHpSJRSjLCVol2VbLMowPP/trwZ4=; b=fLbWdphwrx1my/Uc6woFn5jnk1DchMnj0TcrJRe1KxiGJ4v3GNhF4inTH9BDtN/cyT bi3NRB6uv8Br4vEmLRsz+nM+s6k6ppbvDJsxCgmzz+z3EOZ4KQ9wRBx7uCExZ7NVj4b4 WlPmZgoPieEx96le/3vqPBcpDbdXl9hZ6sVgNGK/1HjdOaD19dyIIssos1RuCQi16Ko4 imOBrn4R1xjL73hFXnot7NHGEznUWFxUMYEoS1Y7Y95S1+/qUG2KoPtSli9uIvu3fjns zzAs1NxsF2D8JB7Ihw64ZuP3bYbyeVnSwUSnc7JdZF4aPRvZ195x3MA7s9TYePv7d085 +LgQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c19si2751009ots.118.2020.04.02.02.48.26; Thu, 02 Apr 2020 02:48:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387800AbgDBJsE (ORCPT + 99 others); Thu, 2 Apr 2020 05:48:04 -0400 Received: from foss.arm.com ([217.140.110.172]:40708 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725965AbgDBJsE (ORCPT ); Thu, 2 Apr 2020 05:48:04 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BB46E31B; Thu, 2 Apr 2020 02:48:03 -0700 (PDT) Received: from [10.57.59.199] (unknown [10.57.59.199]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B477A3F71E; Thu, 2 Apr 2020 02:48:01 -0700 (PDT) Subject: Re: [PATCH 1/3] rkisp1: Get rid of unused variable warning To: Ezequiel Garcia , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Hans Verkuil , kernel@collabora.com References: <20200401213721.24173-1-ezequiel@collabora.com> <20200401213721.24173-2-ezequiel@collabora.com> From: Robin Murphy Message-ID: Date: Thu, 2 Apr 2020 10:47:58 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200401213721.24173-2-ezequiel@collabora.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-04-01 10:37 pm, Ezequiel Garcia wrote: > If CONFIG_OF is not selected, the compiler will complain: > > drivers/staging/media/rkisp1/rkisp1-dev.c: In function ‘rkisp1_probe’: > drivers/staging/media/rkisp1/rkisp1-dev.c:457:22: warning: unused variable ‘node’ [-Wunused-variable] > 457 | struct device_node *node = pdev->dev.of_node; > > Rework the code slightly and make the compiler happy. > > Signed-off-by: Ezequiel Garcia > --- > drivers/staging/media/rkisp1/rkisp1-dev.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/staging/media/rkisp1/rkisp1-dev.c b/drivers/staging/media/rkisp1/rkisp1-dev.c > index b1b3c058e957..5e7e797aad71 100644 > --- a/drivers/staging/media/rkisp1/rkisp1-dev.c > +++ b/drivers/staging/media/rkisp1/rkisp1-dev.c > @@ -454,7 +454,6 @@ static void rkisp1_debug_init(struct rkisp1_device *rkisp1) > > static int rkisp1_probe(struct platform_device *pdev) > { > - struct device_node *node = pdev->dev.of_node; > const struct rkisp1_match_data *clk_data; > const struct of_device_id *match; > struct device *dev = &pdev->dev; > @@ -463,7 +462,7 @@ static int rkisp1_probe(struct platform_device *pdev) > unsigned int i; > int ret, irq; > > - match = of_match_node(rkisp1_of_match, node); > + match = of_match_node(rkisp1_of_match, pdev->dev.of_node); FWIW you could clean up "match" too by using of_device_get_match_data(). Robin. > rkisp1 = devm_kzalloc(dev, sizeof(*rkisp1), GFP_KERNEL); > if (!rkisp1) > return -ENOMEM; >