Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2088220ybb; Thu, 2 Apr 2020 12:53:23 -0700 (PDT) X-Google-Smtp-Source: APiQypItnZ1tsHEgFW3wp9HE/bLYK8COC7WO7bkeLP9LPB2300ro853D/N5D5KpgxofwV9BPxjLr X-Received: by 2002:aca:57cd:: with SMTP id l196mr585249oib.1.1585857203600; Thu, 02 Apr 2020 12:53:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585857203; cv=none; d=google.com; s=arc-20160816; b=BPOV21CQVwm8IxSJdgrOuNNwLVmpSSzoxws3LDAKpYUI2Ao4KrTm7WU2ICuqZ3bCmR Fy4HfNhrCadlXFvIdB6P9y3w1ACNtB4OEGPr/9uOn2mNlhlGpk8H3zwaMgK41iHQ0Be+ pXK6I3/hrz5SQb5yukT/v8hLv826AOcvuvnxNbKLiNemoHXVW51d0heBvbvrzRV/BcJD Vv8+OUyA4PwAusSDh68lY8CBgRIqQzQjt4PQWb3mmFWucpPZ2k8BTpL77NLnvj0y7tUd nfGKyt5Lc24r/TCDPOJGVheDqAEzyRfOmAObq7GLm/NIGF8dNVs8qvmepHy56t90w9Si JoZQ== 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=LwjzChJ9HcWsZYrxuL3nmvQeX9bzI2asrd53azIoi80=; b=Lqc0OMss3CsihN+msr/VFVQ9ahyIgtx6Qzhsms0BaRJefoCsENVJ0IIsFGNfAQHljK 7tX3bJxuVuVEWIID2JBkhlKRkpY4eq14R3CK5kzAj8knzo34EKJ2QLarzYtQnYCB3kGJ vQW63lWOcsq+z88jjp7cRG3IJ+OxnhTbM9IynJ3N1Rb5L/AOvxV5zNwOHZkYnsUeKYzr KbzCwlHu+djEbt9W+d7lWRUoEzzMf0UWgtgWKZPiiH1iM1fhCpCkVnZEnbjKkApUBE4C OySBIcLyBboWnR2c8LOxgjSxWRGVOBl+wQoILw6ILiyWvk7WcYEkeNewMuyYN6Df4hlG ASew== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l15si2704940otl.297.2020.04.02.12.53.10; Thu, 02 Apr 2020 12:53:23 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388218AbgDBTv5 (ORCPT + 99 others); Thu, 2 Apr 2020 15:51:57 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:46466 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726617AbgDBTv5 (ORCPT ); Thu, 2 Apr 2020 15:51:57 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: koike) with ESMTPSA id 7AD4C297C74 Subject: Re: [PATCH v2 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: kernel@collabora.com, Hans Verkuil , Robin Murphy References: <20200402194504.5331-1-ezequiel@collabora.com> <20200402194504.5331-2-ezequiel@collabora.com> From: Helen Koike Message-ID: <3f751060-8af4-3d7a-785a-c06c56736a08@collabora.com> Date: Thu, 2 Apr 2020 16:51:48 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <20200402194504.5331-2-ezequiel@collabora.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/2/20 4:45 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. > > Suggested-by: Robin Murphy > Signed-off-by: Ezequiel Garcia Acked-by: Helen Koike > --- > drivers/staging/media/rkisp1/rkisp1-dev.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/media/rkisp1/rkisp1-dev.c b/drivers/staging/media/rkisp1/rkisp1-dev.c > index b1b3c058e957..3f6285709352 100644 > --- a/drivers/staging/media/rkisp1/rkisp1-dev.c > +++ b/drivers/staging/media/rkisp1/rkisp1-dev.c > @@ -454,16 +454,17 @@ 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; > struct rkisp1_device *rkisp1; > struct v4l2_device *v4l2_dev; > unsigned int i; > int ret, irq; > > - match = of_match_node(rkisp1_of_match, node); > + clk_data = of_device_get_match_data(&pdev->dev); > + if (!clk_data) > + return -ENODEV; > + > rkisp1 = devm_kzalloc(dev, sizeof(*rkisp1), GFP_KERNEL); > if (!rkisp1) > return -ENOMEM; > @@ -487,7 +488,6 @@ static int rkisp1_probe(struct platform_device *pdev) > } > > rkisp1->irq = irq; > - clk_data = match->data; > > for (i = 0; i < clk_data->size; i++) > rkisp1->clks[i].id = clk_data->clks[i]; >