lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <34acf346-a3d8-6f75-8d4f-0c68cda19506@gmail.com>
Date:   Tue, 18 Apr 2023 13:49:24 +0200
From:   Matthias Brugger <matthias.bgg@...il.com>
To:     Arnd Bergmann <arnd@...nel.org>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Hans Verkuil <hverkuil-cisco@...all.nl>,
        Moudy Ho <moudy.ho@...iatek.com>
Cc:     Arnd Bergmann <arnd@...db.de>,
        AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>,
        Sun Ke <sunke32@...wei.com>,
        Ping-Hsun Wu <ping-hsun.wu@...iatek.com>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH] media: platform: mtk-mdp3: work around unused-variable
 warning



On 18/04/2023 11:15, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.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@...db.de>

Reviewed-by: Matthias Brugger <matthias.bgg@...il.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)) {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ