From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E4E5C47083 for ; Wed, 2 Jun 2021 10:07:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 690FB61263 for ; Wed, 2 Jun 2021 10:07:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231649AbhFBKI6 (ORCPT ); Wed, 2 Jun 2021 06:08:58 -0400 Received: from foss.arm.com ([217.140.110.172]:40214 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230178AbhFBKI4 (ORCPT ); Wed, 2 Jun 2021 06:08:56 -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 C349E1042; Wed, 2 Jun 2021 03:07:13 -0700 (PDT) Received: from [10.57.73.64] (unknown [10.57.73.64]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 22D5A3F73D; Wed, 2 Jun 2021 03:07:12 -0700 (PDT) Subject: Re: [PATCH] drm/rockchip: defined struct rockchip_dp_dt_ids[] under CONFIG_OF To: Souptick Joarder , hjc@rock-chips.com, heiko@sntech.de, airlied@linux.ie, daniel@ffwll.ch Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, kernel test robot References: <20210602080212.4992-1-jrdr.linux@gmail.com> From: Robin Murphy Message-ID: <8027801c-5260-8b1b-c758-fdfb8c18e9a7@arm.com> Date: Wed, 2 Jun 2021 11:07:06 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210602080212.4992-1-jrdr.linux@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-06-02 09:02, Souptick Joarder wrote: > Kernel test robot throws below warning when CONFIG_OF > is not set. > >>> drivers/gpu/drm/rockchip/analogix_dp-rockchip.c:457:34: > warning: unused variable 'rockchip_dp_dt_ids' [-Wunused-const-variable] > static const struct of_device_id rockchip_dp_dt_ids[] = { > > Fixed it by defining rockchip_dp_dt_ids[] under CONFIG_OF. I think the __maybe_unused annotation is generally preferred over #ifdefs these days. However, since these drivers only work with devicetree anyway, it probably makes more sense to just remove the of_match_ptr() uses which lead to these warnings in the first place. Robin. > Reported-by: kernel test robot > Signed-off-by: Souptick Joarder > --- > drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c > index ade2327a10e2..9b79ebaeae97 100644 > --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c > +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c > @@ -454,12 +454,14 @@ static const struct rockchip_dp_chip_data rk3288_dp = { > .chip_type = RK3288_DP, > }; > > +#ifdef CONFIG_OF > static const struct of_device_id rockchip_dp_dt_ids[] = { > {.compatible = "rockchip,rk3288-dp", .data = &rk3288_dp }, > {.compatible = "rockchip,rk3399-edp", .data = &rk3399_edp }, > {} > }; > MODULE_DEVICE_TABLE(of, rockchip_dp_dt_ids); > +#endif > > struct platform_driver rockchip_dp_driver = { > .probe = rockchip_dp_probe, >