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] [thread-next>] [day] [month] [year] [list]
Message-ID: <8f011126-c95a-4c71-8bc9-a6b0a5823c96@web.de>
Date: Mon, 5 Feb 2024 18:28:31 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: Geert Uytterhoeven <geert@...ux-m68k.org>,
 linux-mediatek@...ts.infradead.org, linux-arm-kernel@...ts.infradead.org,
 linux-pm@...r.kernel.org, kernel-janitors@...r.kernel.org,
 Angelo Gioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
 Heiko Stübner <heiko@...ech.de>,
 Jernej Skrabec <jernej.skrabec@...il.com>,
 Matthias Brugger <matthias.bgg@...il.com>, Rob Herring <robh@...nel.org>,
 Ulf Hansson <ulf.hansson@...aro.org>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] pmdomain: mediatek: Use
 devm_platform_get_and_ioremap_resource() in init_scp()

>> +++ b/drivers/pmdomain/mediatek/mtk-scpsys.c
>> @@ -441,8 +441,7 @@ static struct scp *init_scp(struct platform_device *pdev,
>>
>>         scp->dev = &pdev->dev;
>>
>> -       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> -       scp->base = devm_ioremap_resource(&pdev->dev, res);
>> +       scp->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
>
> Given res is further unused, please use devm_platform_ioremap_resource()
> instead, and remove the local variable res.

I got another idea after looking at the implementation of the function
“devm_platform_get_and_ioremap_resource” once more.
https://elixir.bootlin.com/linux/v6.8-rc3/source/drivers/base/platform.c#L87

It seems that it is supported to pass a null pointer for the last parameter
(while this possibility is not mentioned in the interface description so far).
How do you think about to benefit from such a design option any more
(instead of the determination of a corresponding platform device)?

Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ