Message ID | 20230418091555.2605961-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2707654vqo; Tue, 18 Apr 2023 02:30:40 -0700 (PDT) X-Google-Smtp-Source: AKy350YguMIDmOyYNJLohF4eC8eufl1RxR46frdtDcXD+ytgyzXLsbMgCsDp1g38zhZeU2zkQ6fR X-Received: by 2002:a17:902:c412:b0:1a6:e583:80ef with SMTP id k18-20020a170902c41200b001a6e58380efmr2048222plk.18.1681810240492; Tue, 18 Apr 2023 02:30:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681810240; cv=none; d=google.com; s=arc-20160816; b=gqct/L43XbiREcmPMMf57aU5GEd6V3s3QXXwQtMiwInNxQxKgja38akc+Aesd/5vqE crXioIomLBz+FalkiBO2Di5sygU7C0ecpFhtXAiszgyKmNvkE6E6vqapJYFnwZPgTAGH 1t8FRSjv0gtCJa57EoEuGxy/YMeuGgr+n4GUbZKSrzkjERFoXW2vl0tuI48YL966rtTi hu+YBwTVyUsUuiluNs+FnFF+xBrbSb/MaPki50jPIxZKkQ0RRdn3MtrQ8rXile5GactO lloNP8eX7Yle3FqOiGC5+8TRG0Bog03XJCJ1eLZIPuv/bOpTbXz7g5ju2SpbUN3j7iIr QGGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=OS1Vr4Po6VtNOcBE/CG7s2VLA71TQqzK4JuGlQ9FNoU=; b=ncsltK/T4lqBkm7F9dcRPcA0B7NQ3jvmcDWtzUzxIDHpfu/HfkM07nWZuSDfuVTMXp ipBvdsJAs6u2J2MDN4pgrWi4zKez1oPvoFUesRZCU0KrMgg2cwHr6XxLjG77meygzgfP Hpwn/U6F/c8HYFRduz65byZXyq3NLR/iH5GSIIPBaNKrsnQuGeMctAohsqFQlKA5dK7o SKiOIhxcnQxv2N6AEcY5qEtuyxMcULMO/OBDHTjRB1MV5qbf9vdOfd8y3SxQyMGgndH2 OAOx+Pk01xbJzIcGiYOamXgtd3nQSmSuxiUW0TkK+lwHvBS4iSQC+Li+AJD/gxvNpDlx iUrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="T/hrPpv3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ba2-20020a170902720200b001a6d4eab483si4760547plb.49.2023.04.18.02.30.28; Tue, 18 Apr 2023 02:30:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="T/hrPpv3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231222AbjDRJQG (ORCPT <rfc822;leviz.kernel.dev@gmail.com> + 99 others); Tue, 18 Apr 2023 05:16:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229901AbjDRJQC (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 18 Apr 2023 05:16:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEE50D1; Tue, 18 Apr 2023 02:16:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8706960F87; Tue, 18 Apr 2023 09:16:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59289C433D2; Tue, 18 Apr 2023 09:15:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681809360; bh=i8nVDFAokOgYqujZXdzkVQr8aJvHUufQtj/uWLHRiLQ=; h=From:To:Cc:Subject:Date:From; b=T/hrPpv3I+K/TuV8sg7CAaDvM+g0MlH/1F4N39W5MjPOLifXQdoP9DIPgZTXfe0o3 fduBrg0+trdeWQiQzxjk3y+OFm3PLHFzDJXY4xldPcxsYCdmkOVI1C7Sqd47dgY3F9 4G6ZGDdAcUIEewnWGRYlyk/PZC5nopW/izCFwAsuSheiAHwjBvnSR6D7WR2RK+3OWS r83r6QFzfm/pidwR7+JspzU1Zsp/7SUKVjLwtsbU9qqwXLhT8LhIH/Pi+a7DqLlo5U NrJRwVdNDMwfegNk18HSWHDEASy1fmUlreNmQjCDbAFeQ8kPNkxWVDLmv8JKRaxx0S ldUqYvFlD8Exg== From: Arnd Bergmann <arnd@kernel.org> To: Mauro Carvalho Chehab <mchehab@kernel.org>, Matthias Brugger <matthias.bgg@gmail.com>, Hans Verkuil <hverkuil-cisco@xs4all.nl>, Moudy Ho <moudy.ho@mediatek.com> Cc: Arnd Bergmann <arnd@arndb.de>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Sun Ke <sunke32@huawei.com>, Ping-Hsun Wu <ping-hsun.wu@mediatek.com>, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH] media: platform: mtk-mdp3: work around unused-variable warning Date: Tue, 18 Apr 2023 11:15:48 +0200 Message-Id: <20230418091555.2605961-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763505854481982494?= X-GMAIL-MSGID: =?utf-8?q?1763505854481982494?= |
Series |
media: platform: mtk-mdp3: work around unused-variable warning
|
|
Commit Message
Arnd Bergmann
April 18, 2023, 9:15 a.m. UTC
From: Arnd Bergmann <arnd@arndb.de> When CONFIG_OF is disabled, the 'data' variable is not used at all because of_match_node() turns into a dummy macro: drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c: In function 'mdp_comp_sub_create': drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c:1038:36: error: unused variable 'data' [-Werror=unused-variable] 1038 | const struct mtk_mdp_driver_data *data = mdp->mdp_data; | ^~~~ Remove the variable again by moving the pointer dereference into the of_match_node call. Fixes: b385b991ef2f ("media: platform: mtk-mdp3: chip config split about subcomponents") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Comments
On 18/04/2023 11:15, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > When CONFIG_OF is disabled, the 'data' variable is not used at all > because of_match_node() turns into a dummy macro: > > drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c: In function 'mdp_comp_sub_create': > drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c:1038:36: error: unused variable 'data' [-Werror=unused-variable] > 1038 | const struct mtk_mdp_driver_data *data = mdp->mdp_data; > | ^~~~ > > Remove the variable again by moving the pointer dereference into the > of_match_node call. > > Fixes: b385b991ef2f ("media: platform: mtk-mdp3: chip config split about subcomponents") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> > --- > drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c > index 75c92e282fa2..19a4a085f73a 100644 > --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c > +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c > @@ -1035,7 +1035,6 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp) > { > struct device *dev = &mdp->pdev->dev; > struct device_node *node, *parent; > - const struct mtk_mdp_driver_data *data = mdp->mdp_data; > > parent = dev->of_node->parent; > > @@ -1045,7 +1044,7 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp) > int id, alias_id; > struct mdp_comp *comp; > > - of_id = of_match_node(data->mdp_sub_comp_dt_ids, node); > + of_id = of_match_node(mdp->mdp_data->mdp_sub_comp_dt_ids, node); > if (!of_id) > continue; > if (!of_device_is_available(node)) {
diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c index 75c92e282fa2..19a4a085f73a 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c @@ -1035,7 +1035,6 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp) { struct device *dev = &mdp->pdev->dev; struct device_node *node, *parent; - const struct mtk_mdp_driver_data *data = mdp->mdp_data; parent = dev->of_node->parent; @@ -1045,7 +1044,7 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp) int id, alias_id; struct mdp_comp *comp; - of_id = of_match_node(data->mdp_sub_comp_dt_ids, node); + of_id = of_match_node(mdp->mdp_data->mdp_sub_comp_dt_ids, node); if (!of_id) continue; if (!of_device_is_available(node)) {