Skip to content

Commit a695cad

Browse files
rmurphy-armjoergroedel
authored andcommitted
iommu/mediatek-v1: Tidy up probe_finalize
Krzysztof points out that although the driver now supports COMPILE_TEST for other architectures, it does not build cleanly with W=1 where the stubbed-out ARM API can lead to an unused variable warning. Since this is effectively the correct intent of the code in such cases, mark it as __maybe_unused, tidying up some cruft in the process. Reported-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Robin Murphy <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Yong Wu <[email protected]> Link: https://lore.kernel.org/r/7c78149504900bc6c98a9c48f4418934b72d89ac.1751036478.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel <[email protected]>
1 parent 86731a2 commit a695cad

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/iommu/mtk_iommu_v1.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -509,14 +509,10 @@ static struct iommu_device *mtk_iommu_v1_probe_device(struct device *dev)
509509

510510
static void mtk_iommu_v1_probe_finalize(struct device *dev)
511511
{
512-
struct dma_iommu_mapping *mtk_mapping;
513-
struct mtk_iommu_v1_data *data;
512+
__maybe_unused struct mtk_iommu_v1_data *data = dev_iommu_priv_get(dev);
514513
int err;
515514

516-
data = dev_iommu_priv_get(dev);
517-
mtk_mapping = data->mapping;
518-
519-
err = arm_iommu_attach_device(dev, mtk_mapping);
515+
err = arm_iommu_attach_device(dev, data->mapping);
520516
if (err)
521517
dev_err(dev, "Can't create IOMMU mapping - DMA-OPS will not work\n");
522518
}

0 commit comments

Comments
 (0)