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: <f47513f3-e1a9-1764-9954-cdf6931281a9@gmail.com>
Date:   Thu, 16 Jun 2022 15:03:44 +0200
From:   Matthias Brugger <matthias.bgg@...il.com>
To:     AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>, yong.wu@...iatek.com
Cc:     joro@...tes.org, will@...nel.org, robh+dt@...nel.org,
        krzysztof.kozlowski+dt@...aro.org,
        iommu@...ts.linux-foundation.org,
        linux-mediatek@...ts.infradead.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        krzysztof.kozlowski@...aro.org, miles.chen@...iatek.com
Subject: Re: [PATCH v4 5/5] iommu/mediatek: Cleanup pericfg lookup flow



On 16/06/2022 13:08, AngeloGioacchino Del Regno wrote:
> Since only the INFRA type IOMMU needs to modify register(s) in the
> pericfg iospace, it's safe to drop the pericfg_comp_str NULL check;
> also, directly assign the regmap handle to data->pericfg instead of
> to the infracfg variable to improve code readability.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>

Reviewed-by: Matthias Brugger <matthias.bgg@...il.com>

> ---
>   drivers/iommu/mtk_iommu.c | 12 +++++-------
>   1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
> index 90685946fcbe..b2ae84046249 100644
> --- a/drivers/iommu/mtk_iommu.c
> +++ b/drivers/iommu/mtk_iommu.c
> @@ -1217,15 +1217,13 @@ static int mtk_iommu_probe(struct platform_device *pdev)
>   			dev_err(dev, "mm dts parse fail(%d).", ret);
>   			goto out_runtime_disable;
>   		}
> -	} else if (MTK_IOMMU_IS_TYPE(data->plat_data, MTK_IOMMU_TYPE_INFRA) &&
> -		   data->plat_data->pericfg_comp_str) {
> -		infracfg = syscon_regmap_lookup_by_compatible(data->plat_data->pericfg_comp_str);
> -		if (IS_ERR(infracfg)) {
> -			ret = PTR_ERR(infracfg);
> +	} else if (MTK_IOMMU_IS_TYPE(data->plat_data, MTK_IOMMU_TYPE_INFRA)) {
> +		p = data->plat_data->pericfg_comp_str;
> +		data->pericfg = syscon_regmap_lookup_by_compatible(p);
> +		if (IS_ERR(data->pericfg)) {
> +			ret = PTR_ERR(data->pericfg);
>   			goto out_runtime_disable;
>   		}
> -
> -		data->pericfg = infracfg;
>   	}
>   
>   	platform_set_drvdata(pdev, data);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ