diff options
author | Nathan Chancellor <nathan@kernel.org> | 2021-07-27 16:36:56 -0700 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2021-08-22 01:56:39 +0900 |
commit | c626f3864bbbb28bbe06476b0b497c1330aa4463 (patch) | |
tree | 2e19929043b36e3c19723eefb265cb24b1f68eb7 /drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | |
parent | 8c27cc5b90ed00ed0dc5956b99e455a494ac8970 (diff) |
drm/exynos: Always initialize mapping in exynos_drm_register_dma()
In certain randconfigs, clang warns:
drivers/gpu/drm/exynos/exynos_drm_dma.c:121:19: warning: variable
'mapping' is uninitialized when used here [-Wuninitialized]
priv->mapping = mapping;
^~~~~~~
drivers/gpu/drm/exynos/exynos_drm_dma.c:111:16: note: initialize the
variable 'mapping' to silence this warning
void *mapping;
^
= NULL
1 warning generated.
This occurs when CONFIG_EXYNOS_IOMMU is enabled and both
CONFIG_ARM_DMA_USE_IOMMU and CONFIG_IOMMU_DMA are disabled, which makes
the code look like
void *mapping;
if (0)
mapping = arm_iommu_create_mapping()
else if (0)
mapping = iommu_get_domain_for_dev()
...
priv->mapping = mapping;
Add an else branch that initializes mapping to the -ENODEV error pointer
so that there is no more warning and the driver does not change during
runtime.
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h')
0 files changed, 0 insertions, 0 deletions