From patchwork Wed Apr 8 15:52:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11480461 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7DC2B14DD for ; Wed, 8 Apr 2020 15:53:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 68A0B206F5 for ; Wed, 8 Apr 2020 15:53:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729773AbgDHPxw (ORCPT ); Wed, 8 Apr 2020 11:53:52 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:57159 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729726AbgDHPxw (ORCPT ); Wed, 8 Apr 2020 11:53:52 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPA (Nemesis) id 1MTAW9-1jjUM20lyh-00UXnC; Wed, 08 Apr 2020 17:53:29 +0200 From: Arnd Bergmann To: Mauro Carvalho Chehab , Helen Koike Cc: Arnd Bergmann , Jacob Chen , Shunqian Zheng , Yichong Zhong , Jacob Chen , Eddie Cai , Jeffy Chen , Allon Huang , Tomasz Figa , Laurent Pinchart , Ezequiel Garcia , Hans Verkuil , Mauro Carvalho Chehab , Greg Kroah-Hartman , Heiko Stuebner , Dafna Hirschfeld , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: staging: rkisp1: avoid unused variable warning Date: Wed, 8 Apr 2020 17:52:44 +0200 Message-Id: <20200408155325.2077345-1-arnd@arndb.de> X-Mailer: git-send-email 2.26.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XiFsfA79FVSJiRXwvkfRuEgSTU8339oKtVSgdJss1V2c6YWqGXjdXDKLJ/wknV XpcE4nsXJ9yRJBZpgY2faYkTbrppcROTcP+ag9ETP8jT0xI2rY= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org When compile-testing with CONFIG_OF disabled, we get a warning about an unused variable, and about inconsistent Kconfig dependencies: WARNING: unmet direct dependencies detected for PHY_ROCKCHIP_DPHY_RX0 Depends on [n]: STAGING [=y] && STAGING_MEDIA [=y] && MEDIA_SUPPORT [=m] && (ARCH_ROCKCHIP [=n] || COMPILE_TEST [=y]) && OF [=n] Selected by [m]: - VIDEO_ROCKCHIP_ISP1 [=m] && STAGING [=y] && STAGING_MEDIA [=y] && MEDIA_SUPPORT [=m] && VIDEO_V4L2 [=m] && VIDEO_V4L2_SUBDEV_API [=y] && (ARCH_ROCKCHIP [=n] || COMPILE_TEST [=y]) drivers/staging/media/rkisp1/rkisp1-dev.c: In function 'rkisp1_probe': drivers/staging/media/rkisp1/rkisp1-dev.c:457:22: error: unused variable 'node' [-Werror=unused-variable] 457 | struct device_node *node = pdev->dev.of_node; Simply open-coding the pointer dereference in the only place the variable is used avoids the warning in all configurations, so we can allow compile-testing as well. Fixes: d65dd85281fb ("media: staging: rkisp1: add Rockchip ISP1 base driver") Signed-off-by: Arnd Bergmann Reviewed-by: Laurent Pinchart --- drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig | 2 +- drivers/staging/media/rkisp1/rkisp1-dev.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig b/drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig index bd0147624de1..dd5d4d741bdd 100644 --- a/drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig +++ b/drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig @@ -2,7 +2,7 @@ config PHY_ROCKCHIP_DPHY_RX0 tristate "Rockchip MIPI Synopsys DPHY RX0 driver" - depends on (ARCH_ROCKCHIP || COMPILE_TEST) && OF + depends on (ARCH_ROCKCHIP && OF) || COMPILE_TEST select GENERIC_PHY_MIPI_DPHY select GENERIC_PHY help 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); rkisp1 = devm_kzalloc(dev, sizeof(*rkisp1), GFP_KERNEL); if (!rkisp1) return -ENOMEM;