[PATCH -next] drm/v3d: fix double kfree in v3d_submit_cl_ioctl()

2020-09-22 Thread Zheng Bin
If v3d_job_init() returns with an error, the storage
addressed by 'bin' is freed a second time. This patch fixes that.

Fixes: 0d352a3a8a1f ("drm/v3d: don't leak bin job if v3d_job_init fails.")
Fixes: 29cd13cfd762 ("drm/v3d: Fix memory leak in v3d_submit_cl_ioctl")
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/v3d/v3d_gem.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c
index 915f8bfdb58c..182c586525eb 100644
--- a/drivers/gpu/drm/v3d/v3d_gem.c
+++ b/drivers/gpu/drm/v3d/v3d_gem.c
@@ -568,7 +568,6 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data,
ret = v3d_job_init(v3d, file_priv, >base,
   v3d_job_free, args->in_sync_bcl);
if (ret) {
-   kfree(bin);
v3d_job_put(>base);
kfree(bin);
return ret;
--
2.25.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH -next 8/8] drm/amd/amdgpu: fix comparison pointer to bool warning in sdma_v4_0.c

2020-09-10 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:1003:4-9: WARNING: Comparison to bool
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c:1083:5-11: WARNING: Comparison to bool

Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c 
b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
index f975dc4b143a..e8e7d4228b92 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
@@ -1000,7 +1000,7 @@ static void sdma_v4_0_page_stop(struct amdgpu_device 
*adev)
sdma[i] = >sdma.instance[i].page;

if ((adev->mman.buffer_funcs_ring == sdma[i]) &&
-   (unset == false)) {
+   (!unset)) {
amdgpu_ttm_set_buffer_funcs_status(adev, false);
unset = true;
}
@@ -1080,7 +1080,7 @@ static void sdma_v4_0_enable(struct amdgpu_device *adev, 
bool enable)
u32 f32_cntl;
int i;

-   if (enable == false) {
+   if (!enable) {
sdma_v4_0_gfx_stop(adev);
sdma_v4_0_rlc_stop(adev);
if (adev->sdma.has_page_queue)
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH -next 0/8] drm/amd/amdgpu: fix comparison pointer to bool warning

2020-09-10 Thread Zheng Bin
Zheng Bin (8):
  drm/amd/amdgpu: fix comparison pointer to bool warning in gfx_v9_0.c
  drm/amd/amdgpu: fix comparison pointer to bool warning in gfx_v10_0.c
  drm/amd/amdgpu: fix comparison pointer to bool warning in sdma_v5_0.c
  drm/amd/amdgpu: fix comparison pointer to bool warning in sdma_v5_2.c
  drm/amd/amdgpu: fix comparison pointer to bool warning in si.c
  drm/amd/amdgpu: fix comparison pointer to bool warning in uvd_v6_0.c
  drm/amd/amdgpu: fix comparison pointer to bool warning in
amdgpu_atpx_handler.c
  drm/amd/amdgpu: fix comparison pointer to bool warning in sdma_v4_0.c

 drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 4 ++--
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c   | 2 +-
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c| 2 +-
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c   | 4 ++--
 drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c   | 2 +-
 drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c   | 2 +-
 drivers/gpu/drm/amd/amdgpu/si.c  | 2 +-
 drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c| 4 ++--
 8 files changed, 11 insertions(+), 11 deletions(-)

--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH -next 2/8] drm/amd/amdgpu: fix comparison pointer to bool warning in gfx_v10_0.c

2020-09-10 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:3563:5-31: WARNING: Comparison to bool

Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index 2db195ec8d0c..a78c0dbda968 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -3560,7 +3560,7 @@ static void gfx_v10_0_check_fw_write_wait(struct 
amdgpu_device *adev)
break;
}

-   if (adev->gfx.cp_fw_write_wait == false)
+   if (!adev->gfx.cp_fw_write_wait)
DRM_WARN_ONCE("CP firmware version too old, please update!");
 }

--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH -next 6/8] drm/amd/amdgpu: fix comparison pointer to bool warning in uvd_v6_0.c

2020-09-10 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c:1243:14-25: WARNING: Comparison to bool

Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c 
b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
index 0a880bc101b8..ed30fb48b9db 100644
--- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
@@ -1240,8 +1240,8 @@ static int uvd_v6_0_process_interrupt(struct 
amdgpu_device *adev,
break;
}

-   if (false == int_handled)
-   DRM_ERROR("Unhandled interrupt: %d %d\n",
+   if (!int_handled)
+   DRM_ERROR("Unhandled interrupt: %d %d\n",
  entry->src_id, entry->src_data[0]);

return 0;
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH -next 7/8] drm/amd/amdgpu: fix comparison pointer to bool warning in amdgpu_atpx_handler.c

2020-09-10 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c:619:15-49: WARNING: Comparison 
to bool
drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c:629:15-49: WARNING: Comparison 
to bool

Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
index 3e35a8f2c5e5..7abe9500c0c6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
@@ -616,7 +616,7 @@ static bool amdgpu_atpx_detect(void)
while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != 
NULL) {
vga_count++;

-   has_atpx |= (amdgpu_atpx_pci_probe_handle(pdev) == true);
+   has_atpx |= amdgpu_atpx_pci_probe_handle(pdev);

parent_pdev = pci_upstream_bridge(pdev);
d3_supported |= parent_pdev && parent_pdev->bridge_d3;
@@ -626,7 +626,7 @@ static bool amdgpu_atpx_detect(void)
while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_OTHER << 8, pdev)) != 
NULL) {
vga_count++;

-   has_atpx |= (amdgpu_atpx_pci_probe_handle(pdev) == true);
+   has_atpx |= amdgpu_atpx_pci_probe_handle(pdev);

parent_pdev = pci_upstream_bridge(pdev);
d3_supported |= parent_pdev && parent_pdev->bridge_d3;
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH -next] drm/bridge/tc358775: Remove unneeded semicolon

2020-09-10 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/bridge/tc358775.c:488:2-3: Unneeded semicolon

Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/bridge/tc358775.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/tc358775.c 
b/drivers/gpu/drm/bridge/tc358775.c
index d951cdc58297..2272adcc5b4a 100644
--- a/drivers/gpu/drm/bridge/tc358775.c
+++ b/drivers/gpu/drm/bridge/tc358775.c
@@ -485,7 +485,7 @@ static void tc_bridge_enable(struct drm_bridge *bridge)
val |= TC358775_LVCFG_PCLKDIV(DIVIDE_BY_6);
} else {
val |= TC358775_LVCFG_PCLKDIV(DIVIDE_BY_3);
-   };
+   }
d2l_write(tc->i2c, LVCFG, val);
 }

--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH -next 4/8] drm/amd/amdgpu: fix comparison pointer to bool warning in sdma_v5_2.c

2020-09-10 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c:562:5-11: WARNING: Comparison to bool

Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c 
b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
index 46a9617fee5f..34ccf376ee45 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
@@ -559,7 +559,7 @@ static void sdma_v5_2_enable(struct amdgpu_device *adev, 
bool enable)
u32 f32_cntl;
int i;

-   if (enable == false) {
+   if (!enable) {
sdma_v5_2_gfx_stop(adev);
sdma_v5_2_rlc_stop(adev);
}
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH -next 1/8] drm/amd/amdgpu: fix comparison pointer to bool warning in gfx_v9_0.c

2020-09-10 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:2805:5-11: WARNING: Comparison to bool

Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index fed2690d1380..20d8a03ca866 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -2802,7 +2802,7 @@ static void pwr_10_0_gfxip_control_over_cgpg(struct 
amdgpu_device *adev,
uint32_t default_data = 0;

default_data = data = RREG32(SOC15_REG_OFFSET(PWR, 0, 
mmPWR_MISC_CNTL_STATUS));
-   if (enable == true) {
+   if (enable) {
/* enable GFXIP control over CGPG */
data |= PWR_MISC_CNTL_STATUS__PWR_GFX_RLC_CGPG_EN_MASK;
if(default_data != data)
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH -next 5/8] drm/amd/amdgpu: fix comparison pointer to bool warning in si.c

2020-09-10 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/amd/amdgpu/si.c:1342:5-10: WARNING: Comparison to bool

Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/amd/amdgpu/si.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c
index 455d5e366c69..e5e336fd9e94 100644
--- a/drivers/gpu/drm/amd/amdgpu/si.c
+++ b/drivers/gpu/drm/amd/amdgpu/si.c
@@ -1339,7 +1339,7 @@ static void si_vga_set_state(struct amdgpu_device *adev, 
bool state)
uint32_t temp;

temp = RREG32(CONFIG_CNTL);
-   if (state == false) {
+   if (!state) {
temp &= ~(1<<0);
temp |= (1<<1);
} else {
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH -next 3/8] drm/amd/amdgpu: fix comparison pointer to bool warning in sdma_v5_0.c

2020-09-10 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c:619:5-11: WARNING: Comparison to bool

Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c 
b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
index e2232dd12d8e..48c95a78a173 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
@@ -616,7 +616,7 @@ static void sdma_v5_0_enable(struct amdgpu_device *adev, 
bool enable)
u32 f32_cntl;
int i;

-   if (enable == false) {
+   if (!enable) {
sdma_v5_0_gfx_stop(adev);
sdma_v5_0_rlc_stop(adev);
}
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 08/14] drm/radeon: remove comparison to bool in r300.c

2020-05-07 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/radeon/r300.c:1544:5-37: WARNING: Comparison to bool

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/radeon/r300.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index 3b7ead5be5bf..26448b6e97e6 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -1541,7 +1541,7 @@ int r300_init(struct radeon_device *rdev)
RREG32(R_0007C0_CP_STAT));
}
/* check if cards are posted or not */
-   if (radeon_boot_test_post_card(rdev) == false)
+   if (!radeon_boot_test_post_card(rdev))
return -EINVAL;
/* Set asic errata */
r300_errata(rdev);
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 01/14] drm/radeon: remove comparison to bool in btc_dpm.c

2020-05-07 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/radeon/btc_dpm.c:2115:5-26: WARNING: Comparison to bool

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/radeon/btc_dpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/btc_dpm.c b/drivers/gpu/drm/radeon/btc_dpm.c
index d1d8aaf8323c..60b32eba6f46 100644
--- a/drivers/gpu/drm/radeon/btc_dpm.c
+++ b/drivers/gpu/drm/radeon/btc_dpm.c
@@ -2112,7 +2112,7 @@ static void btc_apply_state_adjust_rules(struct 
radeon_device *rdev,
else
max_limits = >pm.dpm.dyn_state.max_clock_voltage_on_dc;

-   if (rdev->pm.dpm.ac_power == false) {
+   if (!rdev->pm.dpm.ac_power) {
if (ps->high.mclk > max_limits->mclk)
ps->high.mclk = max_limits->mclk;
if (ps->high.sclk > max_limits->sclk)
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 07/14] drm/radeon: remove comparison to bool in r100.c

2020-05-07 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/radeon/r100.c:4065:5-37: WARNING: Comparison to bool

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/radeon/r100.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index 24c8db673931..298a9c22074a 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -4062,7 +4062,7 @@ int r100_init(struct radeon_device *rdev)
RREG32(R_0007C0_CP_STAT));
}
/* check if cards are posted or not */
-   if (radeon_boot_test_post_card(rdev) == false)
+   if (!radeon_boot_test_post_card(rdev))
return -EINVAL;
/* Set asic errata */
r100_errata(rdev);
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 12/14] drm/radeon: remove comparison to bool in rv6xx_dpm.c

2020-05-07 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/radeon/rv6xx_dpm.c:1571:5-20: WARNING: Comparison to bool

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/radeon/rv6xx_dpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/rv6xx_dpm.c 
b/drivers/gpu/drm/radeon/rv6xx_dpm.c
index 69d380fff22a..ebdb937730c2 100644
--- a/drivers/gpu/drm/radeon/rv6xx_dpm.c
+++ b/drivers/gpu/drm/radeon/rv6xx_dpm.c
@@ -1568,7 +1568,7 @@ int rv6xx_dpm_enable(struct radeon_device *rdev)
rv6xx_program_engine_speed_parameters(rdev);

rv6xx_enable_display_gap(rdev, true);
-   if (pi->display_gap == false)
+   if (!pi->display_gap)
rv6xx_enable_display_gap(rdev, false);

rv6xx_program_power_level_enter_state(rdev);
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 10/14] drm/radeon: remove comparison to bool in rs600.c

2020-05-07 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/radeon/rs600.c:1132:5-37: WARNING: Comparison to bool

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/radeon/rs600.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c
index c88b4906f7bc..a7ff0609a3eb 100644
--- a/drivers/gpu/drm/radeon/rs600.c
+++ b/drivers/gpu/drm/radeon/rs600.c
@@ -1129,7 +1129,7 @@ int rs600_init(struct radeon_device *rdev)
RREG32(R_0007C0_CP_STAT));
}
/* check if cards are posted or not */
-   if (radeon_boot_test_post_card(rdev) == false)
+   if (!radeon_boot_test_post_card(rdev))
return -EINVAL;

/* Initialize clocks */
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 05/14] drm/radeon: remove comparison to bool in radeon_object.c

2020-05-07 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/radeon/radeon_object.c:427:6-35: WARNING: Comparison to bool

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/radeon/radeon_object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_object.c 
b/drivers/gpu/drm/radeon/radeon_object.c
index 140d94cc080d..f06c5e9dc72c 100644
--- a/drivers/gpu/drm/radeon/radeon_object.c
+++ b/drivers/gpu/drm/radeon/radeon_object.c
@@ -424,7 +424,7 @@ int radeon_bo_evict_vram(struct radeon_device *rdev)
/* late 2.6.33 fix IGP hibernate - we need pm ops to do this correct */
 #ifndef CONFIG_HIBERNATION
if (rdev->flags & RADEON_IS_IGP) {
-   if (rdev->mc.igp_sideport_enabled == false)
+   if (!rdev->mc.igp_sideport_enabled)
/* Useless to evict on IGP chips */
return 0;
}
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 04/14] drm/radeon: remove comparison to bool in radeon_atpx_handler.c

2020-05-07 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/radeon/radeon_atpx_handler.c:561:15-49: WARNING: Comparison to 
bool
drivers/gpu/drm/radeon/radeon_atpx_handler.c:571:15-49: WARNING: Comparison to 
bool

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/radeon/radeon_atpx_handler.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_atpx_handler.c 
b/drivers/gpu/drm/radeon/radeon_atpx_handler.c
index 6f93f54bf651..6131917322b4 100644
--- a/drivers/gpu/drm/radeon/radeon_atpx_handler.c
+++ b/drivers/gpu/drm/radeon/radeon_atpx_handler.c
@@ -558,7 +558,7 @@ static bool radeon_atpx_detect(void)
while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != 
NULL) {
vga_count++;

-   has_atpx |= (radeon_atpx_pci_probe_handle(pdev) == true);
+   has_atpx |= radeon_atpx_pci_probe_handle(pdev);

parent_pdev = pci_upstream_bridge(pdev);
d3_supported |= parent_pdev && parent_pdev->bridge_d3;
@@ -568,7 +568,7 @@ static bool radeon_atpx_detect(void)
while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_OTHER << 8, pdev)) != 
NULL) {
vga_count++;

-   has_atpx |= (radeon_atpx_pci_probe_handle(pdev) == true);
+   has_atpx |= radeon_atpx_pci_probe_handle(pdev);

parent_pdev = pci_upstream_bridge(pdev);
d3_supported |= parent_pdev && parent_pdev->bridge_d3;
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 13/14] drm/radeon: remove comparison to bool in rv515.c

2020-05-07 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/radeon/rv515.c:666:5-37: WARNING: Comparison to bool

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/radeon/rv515.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
index 147e5cf8348d..77e6b9dcdb69 100644
--- a/drivers/gpu/drm/radeon/rv515.c
+++ b/drivers/gpu/drm/radeon/rv515.c
@@ -663,7 +663,7 @@ int rv515_init(struct radeon_device *rdev)
RREG32(R_0007C0_CP_STAT));
}
/* check if cards are posted or not */
-   if (radeon_boot_test_post_card(rdev) == false)
+   if (!radeon_boot_test_post_card(rdev))
return -EINVAL;
/* Initialize clocks */
radeon_get_clock_info(rdev->ddev);
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 02/14] drm/radeon: remove comparison to bool in ci_dpm.c

2020-05-07 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/radeon/ci_dpm.c:814:5-26: WARNING: Comparison to bool
drivers/gpu/drm/radeon/ci_dpm.c:2916:6-21: WARNING: Comparison to bool

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/radeon/ci_dpm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c
index 134aa2b01f90..c77ca911a8b6 100644
--- a/drivers/gpu/drm/radeon/ci_dpm.c
+++ b/drivers/gpu/drm/radeon/ci_dpm.c
@@ -811,7 +811,7 @@ static void ci_apply_state_adjust_rules(struct 
radeon_device *rdev,
else
max_limits = >pm.dpm.dyn_state.max_clock_voltage_on_dc;

-   if (rdev->pm.dpm.ac_power == false) {
+   if (!rdev->pm.dpm.ac_power) {
for (i = 0; i < ps->performance_level_count; i++) {
if (ps->performance_levels[i].mclk > max_limits->mclk)
ps->performance_levels[i].mclk = 
max_limits->mclk;
@@ -2913,7 +2913,7 @@ static int ci_populate_single_memory_level(struct 
radeon_device *rdev,

if (pi->mclk_stutter_mode_threshold &&
(memory_clock <= pi->mclk_stutter_mode_threshold) &&
-   (pi->uvd_enabled == false) &&
+   !pi->uvd_enabled &&
(RREG32(DPG_PIPE_STUTTER_CONTROL) & STUTTER_ENABLE) &&
(rdev->pm.dpm.new_active_crtc_count <= 2))
memory_level->StutterEnable = true;
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 00/14] drm/radeon: remove comparison to bool

2020-05-07 Thread Zheng Bin
Zheng Bin (14):
  drm/radeon: remove comparison to bool in btc_dpm.c
  drm/radeon: remove comparison to bool in ci_dpm.c
  drm/radeon: remove comparison to bool in ni_dpm.c
  drm/radeon: remove comparison to bool in radeon_atpx_handler.c
  drm/radeon: remove comparison to bool in radeon_object.c
  drm/radeon: remove comparison to bool in radeon_ttm.c
  drm/radeon: remove comparison to bool in r100.c
  drm/radeon: remove comparison to bool in r300.c
  drm/radeon: remove comparison to bool in r600.c
  drm/radeon: remove comparison to bool in rs600.c
  drm/radeon: remove comparison to bool in rs690.c
  drm/radeon: remove comparison to bool in rv6xx_dpm.c
  drm/radeon: remove comparison to bool in rv515.c
  drm/radeon: remove comparison to bool in si_dpm.c

 drivers/gpu/drm/radeon/btc_dpm.c | 2 +-
 drivers/gpu/drm/radeon/ci_dpm.c  | 4 ++--
 drivers/gpu/drm/radeon/ni_dpm.c  | 6 +++---
 drivers/gpu/drm/radeon/r100.c| 2 +-
 drivers/gpu/drm/radeon/r300.c| 2 +-
 drivers/gpu/drm/radeon/r600.c| 3 ++-
 drivers/gpu/drm/radeon/radeon_atpx_handler.c | 4 ++--
 drivers/gpu/drm/radeon/radeon_object.c   | 2 +-
 drivers/gpu/drm/radeon/radeon_ttm.c  | 2 +-
 drivers/gpu/drm/radeon/rs600.c   | 2 +-
 drivers/gpu/drm/radeon/rs690.c   | 3 ++-
 drivers/gpu/drm/radeon/rv515.c   | 2 +-
 drivers/gpu/drm/radeon/rv6xx_dpm.c   | 2 +-
 drivers/gpu/drm/radeon/si_dpm.c  | 6 +++---
 14 files changed, 22 insertions(+), 20 deletions(-)

--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 03/14] drm/radeon: remove comparison to bool in ni_dpm.c

2020-05-07 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/radeon/ni_dpm.c:807:5-26: WARNING: Comparison to bool
drivers/gpu/drm/radeon/ni_dpm.c:2466:5-36: WARNING: Comparison to boo
drivers/gpu/drm/radeon/ni_dpm.c:3146:5-22: WARNING: Comparison to bool

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/radeon/ni_dpm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c
index b57c37ddd164..66c48ce107a5 100644
--- a/drivers/gpu/drm/radeon/ni_dpm.c
+++ b/drivers/gpu/drm/radeon/ni_dpm.c
@@ -804,7 +804,7 @@ static void ni_apply_state_adjust_rules(struct 
radeon_device *rdev,
else
max_limits = >pm.dpm.dyn_state.max_clock_voltage_on_dc;

-   if (rdev->pm.dpm.ac_power == false) {
+   if (!rdev->pm.dpm.ac_power) {
for (i = 0; i < ps->performance_level_count; i++) {
if (ps->performance_levels[i].mclk > max_limits->mclk)
ps->performance_levels[i].mclk = 
max_limits->mclk;
@@ -2463,7 +2463,7 @@ static int ni_populate_power_containment_values(struct 
radeon_device *rdev,
u32 power_boost_limit;
u8 max_ps_percent;

-   if (ni_pi->enable_power_containment == false)
+   if (!ni_pi->enable_power_containment)
return 0;

if (state->performance_level_count == 0)
@@ -3143,7 +3143,7 @@ static int ni_initialize_smc_cac_tables(struct 
radeon_device *rdev)
int i, ret;
u32 reg;

-   if (ni_pi->enable_cac == false)
+   if (!ni_pi->enable_cac)
return 0;

cac_tables = kzalloc(sizeof(PP_NIslands_CACTABLES), GFP_KERNEL);
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 06/14] drm/radeon: remove comparison to bool in radeon_ttm.c

2020-05-07 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/radeon/radeon_ttm.c:141:6-62: WARNING: Comparison to bool

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c 
b/drivers/gpu/drm/radeon/radeon_ttm.c
index 5d50c9edbe80..d1fcb5f995b0 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -138,7 +138,7 @@ static void radeon_evict_flags(struct ttm_buffer_object *bo,
rbo = container_of(bo, struct radeon_bo, tbo);
switch (bo->mem.mem_type) {
case TTM_PL_VRAM:
-   if (rbo->rdev->ring[radeon_copy_ring_index(rbo->rdev)].ready == 
false)
+   if (!rbo->rdev->ring[radeon_copy_ring_index(rbo->rdev)].ready)
radeon_ttm_placement_from_domain(rbo, 
RADEON_GEM_DOMAIN_CPU);
else if (rbo->rdev->mc.visible_vram_size < 
rbo->rdev->mc.real_vram_size &&
 bo->mem.start < (rbo->rdev->mc.visible_vram_size >> 
PAGE_SHIFT)) {
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 09/14] drm/radeon: remove comparison to bool in r600.c

2020-05-07 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/radeon/r600.c:1494:8-37: WARNING: Comparison to bool

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/radeon/r600.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index d9a33ca768f3..a37f50907107 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -1491,7 +1491,8 @@ static int r600_mc_init(struct radeon_device *rdev)
/* FastFB shall be used with UMA memory. Here 
it is simply disabled when sideport
* memory is present.
*/
-   if (rdev->mc.igp_sideport_enabled == false && 
radeon_fastfb == 1) {
+   if (!rdev->mc.igp_sideport_enabled &&
+   radeon_fastfb == 1) {
DRM_INFO("Direct mapping: aper base at 
0x%llx, replaced by direct mapping base 0x%llx.\n",
(unsigned long 
long)rdev->mc.aper_base, k8_addr);
rdev->mc.aper_base = 
(resource_size_t)k8_addr;
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 14/14] drm/radeon: remove comparison to bool in si_dpm.c

2020-05-07 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/radeon/si_dpm.c:1885:7-44: WARNING: Comparison to bool
drivers/gpu/drm/radeon/si_dpm.c:2463:5-22: WARNING: Comparison to bool
drivers/gpu/drm/radeon/si_dpm.c:3015:5-26: WARNING: Comparison to bool

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/radeon/si_dpm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c
index a167e1c36d24..98e288e5d8c9 100644
--- a/drivers/gpu/drm/radeon/si_dpm.c
+++ b/drivers/gpu/drm/radeon/si_dpm.c
@@ -1882,7 +1882,7 @@ static void si_initialize_powertune_defaults(struct 
radeon_device *rdev)
update_dte_from_pl2 = true;
break;
default:
-   if (si_pi->dte_data.enable_dte_by_default == true)
+   if (si_pi->dte_data.enable_dte_by_default)
DRM_ERROR("DTE is not enabled!\n");
break;
}
@@ -2460,7 +2460,7 @@ static int si_initialize_smc_dte_tables(struct 
radeon_device *rdev)
if (dte_data == NULL)
si_pi->enable_dte = false;

-   if (si_pi->enable_dte == false)
+   if (!si_pi->enable_dte)
return 0;

if (dte_data->k <= 0)
@@ -3012,7 +3012,7 @@ static void si_apply_state_adjust_rules(struct 
radeon_device *rdev,
if (ps->performance_levels[i].vddc > 
ps->performance_levels[i+1].vddc)
ps->performance_levels[i].vddc = 
ps->performance_levels[i+1].vddc;
}
-   if (rdev->pm.dpm.ac_power == false) {
+   if (!rdev->pm.dpm.ac_power) {
for (i = 0; i < ps->performance_level_count; i++) {
if (ps->performance_levels[i].mclk > max_limits->mclk)
ps->performance_levels[i].mclk = 
max_limits->mclk;
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 11/14] drm/radeon: remove comparison to bool in rs690.c

2020-05-07 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/radeon/rs690.c:190:6-35: WARNING: Comparison to bool
drivers/gpu/drm/radeon/rs690.c:844:5-37: WARNING: Comparison to bool

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/radeon/rs690.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c
index c296f94f9700..ddc3bfbb557c 100644
--- a/drivers/gpu/drm/radeon/rs690.c
+++ b/drivers/gpu/drm/radeon/rs690.c
@@ -187,7 +187,8 @@ static void rs690_mc_init(struct radeon_device *rdev)
/* FastFB shall be used with UMA memory. Here it is simply 
disabled when sideport
 * memory is present.
 */
-   if (rdev->mc.igp_sideport_enabled == false && radeon_fastfb == 
1) {
+   if (!rdev->mc.igp_sideport_enabled &&
+   radeon_fastfb == 1) {
DRM_INFO("Direct mapping: aper base at 0x%llx, replaced 
by direct mapping base 0x%llx.\n",
(unsigned long long)rdev->mc.aper_base, 
k8_addr);
rdev->mc.aper_base = (resource_size_t)k8_addr;
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 1/3] drm/amdgpu: remove set but not used variable 'priority'

2020-04-30 Thread Zheng Bin
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:1211:26: warning: variable ‘priority’ 
set but not used

It is not used since commit 33abcb1f5a17 ("drm/amdgpu:
set compute queue priority at mqd_init")

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 7653f62b1b2d..19070226a945 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -1208,7 +1208,6 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,
 {
struct amdgpu_fpriv *fpriv = p->filp->driver_priv;
struct drm_sched_entity *entity = p->entity;
-   enum drm_sched_priority priority;
struct amdgpu_bo_list_entry *e;
struct amdgpu_job *job;
uint64_t seq;
@@ -1258,7 +1257,6 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,

trace_amdgpu_cs_ioctl(job);
amdgpu_vm_bo_trace_cs(>vm, >ticket);
-   priority = job->base.s_priority;
drm_sched_entity_push_job(>base, entity);

amdgpu_vm_move_to_lru_tail(p->adev, >vm);
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 2/4] drm/amd/display: remove set but not used variable 'pixel_width'

2020-04-30 Thread Zheng Bin
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c:137:11: warning: variable 
‘pixel_width’ set but not used [-Wunused-but-set-variable]

It is introduced by commit 70ccab604049 ("drm/amdgpu/display:
Add core dc support for DCN"), but never used, so remove it.

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c 
b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c
index 0e682b5aa3eb..7f8456b9988b 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c
@@ -134,13 +134,6 @@ bool dpp1_get_optimal_number_of_taps(
struct scaler_data *scl_data,
const struct scaling_taps *in_taps)
 {
-   uint32_t pixel_width;
-
-   if (scl_data->viewport.width > scl_data->recout.width)
-   pixel_width = scl_data->recout.width;
-   else
-   pixel_width = scl_data->viewport.width;
-
/* Some ASICs does not support  FP16 scaling, so we reject modes 
require this*/
if (scl_data->format == PIXEL_FORMAT_FP16 &&
dpp->caps->dscl_data_proc_format == 
DSCL_DATA_PRCESSING_FIXED_FORMAT &&
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 0/4] drm/amd/display: remove set but not used variables

2020-04-30 Thread Zheng Bin
Zheng Bin (4):
  drm/amd/display: remove set but not used variable 'dc'
  drm/amd/display: remove set but not used variable 'pixel_width'
  drm/amd/display: remove set but not used variable 'speakers' in
dce_stream_encoder.c
  drm/amd/display: remove set but not used variable 'speakers' in
dcn10_stream_encoder.c

 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  | 2 --
 drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c| 2 --
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c   | 7 ---
 .../gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c| 2 --
 4 files changed, 13 deletions(-)

--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 1/4] drm/amd/display: remove set but not used variable 'dc'

2020-04-30 Thread Zheng Bin
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:8665:13: warning: variable 
‘dc’ set but not used [-Wunused-but-set-variable]

It is not used since commit d1ebfdd8d0fc ("drm/amd/display:
Unify psr feature flags")

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 98f39db81c7b..8e46524e67a9 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -8662,14 +8662,12 @@ static bool amdgpu_dm_link_setup_psr(struct 
dc_stream_state *stream)
struct dc_link *link = NULL;
struct psr_config psr_config = {0};
struct psr_context psr_context = {0};
-   struct dc *dc = NULL;
bool ret = false;

if (stream == NULL)
return false;

link = stream->link;
-   dc = link->ctx->dc;

psr_config.psr_version = link->dpcd_caps.psr_caps.psr_version;

--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 0/3] drm/amdgpu: remove set but not used variables

2020-04-30 Thread Zheng Bin
Zheng Bin (3):
  drm/amdgpu: remove set but not used variable 'priority'
  drm/amdgpu: remove set but not used variable 'direct_poll' in
vcn_v2_0.c
  drm/amdgpu: remove set but not used variable 'direct_poll' in
vcn_v2_5.c

 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 --
 drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c  | 3 ---
 drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c  | 2 --
 3 files changed, 7 deletions(-)

--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 3/3] drm/amdgpu: remove set but not used variable 'direct_poll' in vcn_v2_5.c

2020-04-30 Thread Zheng Bin
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c:1170:39: warning: variable ‘direct_poll’ 
set but not used [-Wunused-but-set-variable]

It is introduced by commit 7daaebfea5e5 ("drm/amdgpu:
add VCN2.5 sriov start for Arctrus"), but never used,
so remove it.

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c 
b/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
index 38ca4a712f12..5c1b9ed76534 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
@@ -1167,14 +1167,12 @@ static int vcn_v2_5_sriov_start(struct amdgpu_device 
*adev)
uint32_t table_size = 0;
struct mmsch_v1_0_cmd_direct_write direct_wt = { { 0 } };
struct mmsch_v1_0_cmd_direct_read_modify_write direct_rd_mod_wt = { { 0 
} };
-   struct mmsch_v1_0_cmd_direct_polling direct_poll = { { 0 } };
struct mmsch_v1_0_cmd_end end = { { 0 } };
uint32_t *init_table = adev->virt.mm_table.cpu_addr;
struct mmsch_v1_1_init_header *header = (struct mmsch_v1_1_init_header 
*)init_table;

direct_wt.cmd_header.command_type = MMSCH_COMMAND__DIRECT_REG_WRITE;
direct_rd_mod_wt.cmd_header.command_type = 
MMSCH_COMMAND__DIRECT_REG_READ_MODIFY_WRITE;
-   direct_poll.cmd_header.command_type = MMSCH_COMMAND__DIRECT_REG_POLLING;
end.cmd_header.command_type = MMSCH_COMMAND__END;

header->version = MMSCH_VERSION;
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 4/4] drm/amd/display: remove set but not used variable 'speakers' in dcn10_stream_encoder.c

2020-04-30 Thread Zheng Bin
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c:1277:11: warning: 
variable ‘speakers’ set but not used [-Wunused-but-set-variable]

It is introduced by commit 0c41891c81c0 ("drm/amd/display:
Refactor stream encoder for HW review"), but never used, so remove it.

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c 
b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c
index 7eba9333c328..07b2f9399671 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c
@@ -1274,7 +1274,6 @@ static void enc1_se_audio_setup(
 {
struct dcn10_stream_encoder *enc1 = DCN10STRENC_FROM_STRENC(enc);

-   uint32_t speakers = 0;
uint32_t channels = 0;

ASSERT(audio_info);
@@ -1282,7 +1281,6 @@ static void enc1_se_audio_setup(
/* This should not happen.it does so we don't get BSOD*/
return;

-   speakers = audio_info->flags.info.ALLSPEAKERS;
channels = speakers_to_channels(audio_info->flags.speaker_flags).all;

/* setup the audio stream source select (audio -> dig mapping) */
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 3/4] drm/amd/display: remove set but not used variable 'speakers' in dce_stream_encoder.c

2020-04-30 Thread Zheng Bin
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c:1339:11: warning: 
variable ‘speakers’ set but not used [-Wunused-but-set-variable]

It is introduced by commit 4562236b3bc0 ("drm/amd/dc:
Add dc display driver (v2)"), but never used, so remove it.

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c 
b/drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c
index 451574971b96..4cdaaf4d881c 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c
@@ -1336,7 +1336,6 @@ static void dce110_se_audio_setup(
 {
struct dce110_stream_encoder *enc110 = DCE110STRENC_FROM_STRENC(enc);

-   uint32_t speakers = 0;
uint32_t channels = 0;

ASSERT(audio_info);
@@ -1344,7 +1343,6 @@ static void dce110_se_audio_setup(
/* This should not happen.it does so we don't get BSOD*/
return;

-   speakers = audio_info->flags.info.ALLSPEAKERS;
channels = speakers_to_channels(audio_info->flags.speaker_flags).all;

/* setup the audio stream source select (audio -> dig mapping) */
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 2/3] drm/amdgpu: remove set but not used variable 'direct_poll' in vcn_v2_0.c

2020-04-30 Thread Zheng Bin
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c:1848:39: warning: variable ‘direct_poll’ 
set but not used [-Wunused-but-set-variable]

It is introduced by commit dd26858a9cd8 ("drm/amdgpu:
implement initialization part on VCN2.0 for SRIOV"), but never used,
so remove it.

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c 
b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
index 349da7bf7c68..90ed773695ea 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
@@ -1845,7 +1845,6 @@ static int vcn_v2_0_start_sriov(struct amdgpu_device 
*adev)
uint32_t table_size = 0;
struct mmsch_v2_0_cmd_direct_write direct_wt = { {0} };
struct mmsch_v2_0_cmd_direct_read_modify_write direct_rd_mod_wt = { {0} 
};
-   struct mmsch_v2_0_cmd_direct_polling direct_poll = { {0} };
struct mmsch_v2_0_cmd_end end = { {0} };
struct mmsch_v2_0_init_header *header;
uint32_t *init_table = adev->virt.mm_table.cpu_addr;
@@ -1855,8 +1854,6 @@ static int vcn_v2_0_start_sriov(struct amdgpu_device 
*adev)
direct_wt.cmd_header.command_type = MMSCH_COMMAND__DIRECT_REG_WRITE;
direct_rd_mod_wt.cmd_header.command_type =
MMSCH_COMMAND__DIRECT_REG_READ_MODIFY_WRITE;
-   direct_poll.cmd_header.command_type =
-   MMSCH_COMMAND__DIRECT_REG_POLLING;
end.cmd_header.command_type = MMSCH_COMMAND__END;

if (header->vcn_table_offset == 0 && header->vcn_table_size == 0) {
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/amdgpu: Remove unneeded semicolon

2020-04-24 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c:2534:2-3: Unneeded semicolon

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 09aa5f509bd2..43d84214995c 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -2531,7 +2531,7 @@ static void gfx_v9_0_init_sq_config(struct amdgpu_device 
*adev)
break;
default:
break;
-   };
+   }
 }

 static void gfx_v9_0_constants_init(struct amdgpu_device *adev)
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/rockchip: Remove unneeded semicolon

2020-04-24 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/rockchip/cdn-dp-reg.c:604:2-3: Unneeded semicolon
drivers/gpu/drm/rockchip/cdn-dp-reg.c:622:2-3: Unneeded semicolon
drivers/gpu/drm/rockchip/cdn-dp-reg.c:703:2-3: Unneeded semicolon

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/rockchip/cdn-dp-reg.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/cdn-dp-reg.c 
b/drivers/gpu/drm/rockchip/cdn-dp-reg.c
index 7361c07cb4a7..9d2163ef4d6e 100644
--- a/drivers/gpu/drm/rockchip/cdn-dp-reg.c
+++ b/drivers/gpu/drm/rockchip/cdn-dp-reg.c
@@ -601,7 +601,7 @@ static int cdn_dp_get_msa_misc(struct video_info *video,
case YCBCR_4_2_0:
val[0] = 5;
break;
-   };
+   }

switch (video->color_depth) {
case 6:
@@ -619,7 +619,7 @@ static int cdn_dp_get_msa_misc(struct video_info *video,
case 16:
val[1] = 4;
break;
-   };
+   }

msa_misc = 2 * val[0] + 32 * val[1] +
   ((video->color_fmt == Y_ONLY) ? (1 << 14) : 0);
@@ -700,7 +700,7 @@ int cdn_dp_config_video(struct cdn_dp_device *dp)
case 16:
val = BCS_16;
break;
-   };
+   }

val += video->color_fmt << 8;
ret = cdn_dp_reg_write(dp, DP_FRAMER_PXL_REPR, val);
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/nouveau/mmu: Remove unneeded semicolon

2020-04-24 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h:307:2-3: Unneeded semicolon
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c:583:2-3: Unneeded semicolon

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c | 2 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c
index 41640e0584ac..199f94e15c5f 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c
@@ -580,7 +580,7 @@ nvkm_vmm_iter(struct nvkm_vmm *vmm, const struct 
nvkm_vmm_page *page,
it.pte[it.lvl]++;
}
}
-   };
+   }

nvkm_vmm_flush();
return ~0ULL;
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h 
b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h
index 5e55ecbd8005..d3f8f916d0db 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h
@@ -304,7 +304,7 @@ int tu102_vmm_new(struct nvkm_mmu *, bool, u64, u64, void 
*, u32,
FILL(VMM, PT, PTEI, _ptes, MAP, _addr);\
PTEI += _ptes; \
PTEN -= _ptes; \
-   }; \
+   }  \
nvkm_done((PT)->memory);   \
 } while(0)

--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/panel: Remove unneeded semicolon

2020-04-24 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/panel/panel-ilitek-ili9322.c:382:2-3: Unneeded semicolon
drivers/gpu/drm/panel/panel-ilitek-ili9322.c:391:2-3: Unneeded semicolon

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/panel/panel-ilitek-ili9322.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c 
b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
index 09935520e606..873b1c7059bd 100644
--- a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
+++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
@@ -379,7 +379,7 @@ static int ili9322_init(struct drm_panel *panel, struct 
ili9322 *ili)
"can't set up VCOM amplitude (%d)\n", ret);
return ret;
}
-   };
+   }

if (ili->vcom_high != U8_MAX) {
ret = regmap_write(ili->regmap, ILI9322_VCOM_HIGH,
@@ -388,7 +388,7 @@ static int ili9322_init(struct drm_panel *panel, struct 
ili9322 *ili)
dev_err(ili->dev, "can't set up VCOM high (%d)\n", ret);
return ret;
}
-   };
+   }

/* Set up gamma correction */
for (i = 0; i < ARRAY_SIZE(ili->gamma); i++) {
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/meson: Remove unneeded semicolon

2020-04-24 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/meson/meson_plane.c:226:3-4: Unneeded semicolon

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/meson/meson_plane.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/meson/meson_plane.c 
b/drivers/gpu/drm/meson/meson_plane.c
index d5cbc47835bf..35338ed18209 100644
--- a/drivers/gpu/drm/meson/meson_plane.c
+++ b/drivers/gpu/drm/meson/meson_plane.c
@@ -223,7 +223,7 @@ static void meson_plane_atomic_update(struct drm_plane 
*plane,
priv->viu.osd1_blk0_cfg[0] |= OSD_BLK_MODE_16 |
OSD_COLOR_MATRIX_16_RGB565;
break;
-   };
+   }
}

switch (fb->format->format) {
--
2.26.0.106.g9fadedd

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 0/4] drm/msm/dpu: fix comparing pointer to 0

2020-01-23 Thread Zheng Bin
Zheng Bin (4):
  drm/msm/dpu: fix comparing pointer to 0 in dpu_encoder_phys_cmd.c
  drm/msm/dpu: fix comparing pointer to 0 in dpu_encoder_phys_vid.c
  drm/msm/dpu: fix comparing pointer to 0 in dpu_vbif.c
  drm/msm/dpu: fix comparing pointer to 0 in dpu_encoder.c

 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c  | 10 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c |  4 ++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c |  4 ++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c |  6 +++---
 4 files changed, 12 insertions(+), 12 deletions(-)

--
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 3/4] drm/msm/dpu: fix comparing pointer to 0 in dpu_vbif.c

2020-01-23 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c:27:51-52: WARNING comparing pointer to 0
drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c:109:51-52: WARNING comparing pointer 
to 0
drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c:167:12-13: WARNING comparing pointer 
to 0
drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c:167:22-23: WARNING comparing pointer 
to 0

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c
index 93ab36b..5e8c3f3 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c
@@ -24,7 +24,7 @@ static int _dpu_vbif_wait_for_xin_halt(struct dpu_hw_vbif 
*vbif, u32 xin_id)
int rc;

if (!vbif || !vbif->cap || !vbif->ops.get_halt_ctrl) {
-   DPU_ERROR("invalid arguments vbif %d\n", vbif != 0);
+   DPU_ERROR("invalid arguments vbif %d\n", vbif != NULL);
return -EINVAL;
}

@@ -106,7 +106,7 @@ static u32 _dpu_vbif_get_ot_limit(struct dpu_hw_vbif *vbif,
u32 val;

if (!vbif || !vbif->cap) {
-   DPU_ERROR("invalid arguments vbif %d\n", vbif != 0);
+   DPU_ERROR("invalid arguments vbif %d\n", vbif != NULL);
return -EINVAL;
}

@@ -164,7 +164,7 @@ void dpu_vbif_set_ot_limit(struct dpu_kms *dpu_kms,

if (!vbif || !mdp) {
DPU_DEBUG("invalid arguments vbif %d mdp %d\n",
-   vbif != 0, mdp != 0);
+   vbif != NULL, mdp != NULL);
return;
}

--
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/omap: use true,false for bool variable

2020-01-23 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c:681:1-15: WARNING: Assignment 
of 0/1 to bool variable
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c:732:1-15: WARNING: Assignment 
of 0/1 to bool variable

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c 
b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
index 564e3e1..3ec6a55 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
@@ -678,7 +678,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata)
if (r)
goto err;

-   ddata->enabled = 1;
+   ddata->enabled = true;

if (!ddata->intro_printed) {
dev_info(>pdev->dev, "panel revision %02x.%02x.%02x\n",
@@ -729,7 +729,7 @@ static void dsicm_power_off(struct panel_drv_data *ddata)
if (ddata->vpnl)
regulator_disable(ddata->vpnl);

-   ddata->enabled = 0;
+   ddata->enabled = false;
 }

 static int dsicm_panel_reset(struct panel_drv_data *ddata)
--
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 2/4] drm/msm/dpu: fix comparing pointer to 0 in dpu_encoder_phys_vid.c

2020-01-23 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c:242:48-49: WARNING 
comparing pointer to 0
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c:562:25-26: WARNING 
comparing pointer to 0
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c:562:48-49: WARNING 
comparing pointer to 0

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
index c71c18d..b5a4905 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
@@ -239,7 +239,7 @@ static void dpu_encoder_phys_vid_setup_timing_engine(
struct dpu_hw_intf_cfg intf_cfg = { 0 };

if (!phys_enc->hw_ctl->ops.setup_intf_cfg) {
-   DPU_ERROR("invalid encoder %d\n", phys_enc != 0);
+   DPU_ERROR("invalid encoder %d\n", phys_enc != NULL);
return;
}

@@ -559,7 +559,7 @@ static void dpu_encoder_phys_vid_disable(struct 
dpu_encoder_phys *phys_enc)

if (!phys_enc->hw_intf) {
DPU_ERROR("invalid hw_intf %d hw_ctl %d\n",
-   phys_enc->hw_intf != 0, phys_enc->hw_ctl != 0);
+   phys_enc->hw_intf != NULL, phys_enc->hw_ctl != 
NULL);
return;
}

--
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 1/4] drm/msm/dpu: fix comparing pointer to 0 in dpu_encoder_phys_cmd.c

2020-01-23 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c:414:52-53: WARNING 
comparing pointer to 0
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c:443:56-57: WARNING 
comparing pointer to 0

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
index 39e1e28..8493d68 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
@@ -411,7 +411,7 @@ static void _dpu_encoder_phys_cmd_pingpong_config(
to_dpu_encoder_phys_cmd(phys_enc);

if (!phys_enc->hw_pp || !phys_enc->hw_ctl->ops.setup_intf_cfg) {
-   DPU_ERROR("invalid arg(s), enc %d\n", phys_enc != 0);
+   DPU_ERROR("invalid arg(s), enc %d\n", phys_enc != NULL);
return;
}

@@ -440,7 +440,7 @@ static void dpu_encoder_phys_cmd_enable_helper(
u32 flush_mask = 0;

if (!phys_enc->hw_pp) {
-   DPU_ERROR("invalid arg(s), encoder %d\n", phys_enc != 0);
+   DPU_ERROR("invalid arg(s), encoder %d\n", phys_enc != NULL);
return;
}

--
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 4/4] drm/msm/dpu: fix comparing pointer to 0 in dpu_encoder.c

2020-01-23 Thread Zheng Bin
Fixes coccicheck warning:

drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:464:56-57: WARNING comparing 
pointer to 0
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:571:15-16: WARNING comparing 
pointer to 0
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:571:32-33: WARNING comparing 
pointer to 0
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:571:49-50: WARNING comparing 
pointer to 0
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:1968:17-18: WARNING comparing 
pointer to 0
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:1981:17-18: WARNING comparing 
pointer to 0
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:2012:51-52: WARNING comparing 
pointer to 0

Reported-by: Hulk Robot 
Signed-off-by: Zheng Bin 
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c 
b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index f8ac3bf..26d3b8f 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -461,7 +461,7 @@ void dpu_encoder_helper_split_config(
struct msm_display_info *disp_info;

if (!phys_enc->hw_mdptop || !phys_enc->parent) {
-   DPU_ERROR("invalid arg(s), encoder %d\n", phys_enc != 0);
+   DPU_ERROR("invalid arg(s), encoder %d\n", phys_enc != NULL);
return;
}

@@ -568,7 +568,7 @@ static int dpu_encoder_virt_atomic_check(

if (!drm_enc || !crtc_state || !conn_state) {
DPU_ERROR("invalid arg(s), drm_enc %d, crtc/conn state %d/%d\n",
-   drm_enc != 0, crtc_state != 0, conn_state != 0);
+   drm_enc != NULL, crtc_state != NULL, conn_state 
!= NULL);
return -EINVAL;
}

@@ -1965,7 +1965,7 @@ static int dpu_encoder_virt_add_phys_encs(
if (IS_ERR_OR_NULL(enc)) {
DPU_ERROR_ENC(dpu_enc, "failed to init vid enc: %ld\n",
PTR_ERR(enc));
-   return enc == 0 ? -EINVAL : PTR_ERR(enc);
+   return enc == NULL ? -EINVAL : PTR_ERR(enc);
}

dpu_enc->phys_encs[dpu_enc->num_phys_encs] = enc;
@@ -1978,7 +1978,7 @@ static int dpu_encoder_virt_add_phys_encs(
if (IS_ERR_OR_NULL(enc)) {
DPU_ERROR_ENC(dpu_enc, "failed to init cmd enc: %ld\n",
PTR_ERR(enc));
-   return enc == 0 ? -EINVAL : PTR_ERR(enc);
+   return enc == NULL ? -EINVAL : PTR_ERR(enc);
}

dpu_enc->phys_encs[dpu_enc->num_phys_encs] = enc;
@@ -2009,7 +2009,7 @@ static int dpu_encoder_setup_display(struct 
dpu_encoder_virt *dpu_enc,
struct dpu_enc_phys_init_params phys_params;

if (!dpu_enc) {
-   DPU_ERROR("invalid arg(s), enc %d\n", dpu_enc != 0);
+   DPU_ERROR("invalid arg(s), enc %d\n", dpu_enc != NULL);
return -EINVAL;
}

--
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/amd/powerplay: use true, false for bool variable in smu7_hwmgr.c

2020-01-22 Thread Zheng Bin
From: zhengbin 

Fixes coccicheck warning:

drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c:723:2-50: WARNING: Assignment 
of 0/1 to bool variable
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c:733:3-52: WARNING: Assignment 
of 0/1 to bool variable
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c:747:3-51: WARNING: Assignment 
of 0/1 to bool variable

Reported-by: Hulk Robot 
Signed-off-by: zhengbin 
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c 
b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
index d70abad..bf04cfe 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
@@ -720,7 +720,7 @@ static int smu7_setup_dpm_tables_v0(struct pp_hwmgr *hwmgr)
data->dpm_table.vddc_table.dpm_levels[i].value = 
allowed_vdd_mclk_table->entries[i].v;
data->dpm_table.vddc_table.dpm_levels[i].param1 = 
std_voltage_table->entries[i].Leakage;
/* param1 is for corresponding std voltage */
-   data->dpm_table.vddc_table.dpm_levels[i].enabled = 1;
+   data->dpm_table.vddc_table.dpm_levels[i].enabled = true;
}

data->dpm_table.vddc_table.count = allowed_vdd_sclk_table->count;
@@ -730,7 +730,7 @@ static int smu7_setup_dpm_tables_v0(struct pp_hwmgr *hwmgr)
/* Initialize Vddci DPM table based on allow Mclk values */
for (i = 0; i < allowed_vdd_mclk_table->count; i++) {
data->dpm_table.vddci_table.dpm_levels[i].value = 
allowed_vdd_mclk_table->entries[i].v;
-   data->dpm_table.vddci_table.dpm_levels[i].enabled = 1;
+   data->dpm_table.vddci_table.dpm_levels[i].enabled = 
true;
}
data->dpm_table.vddci_table.count = 
allowed_vdd_mclk_table->count;
}
@@ -744,7 +744,7 @@ static int smu7_setup_dpm_tables_v0(struct pp_hwmgr *hwmgr)
 */
for (i = 0; i < allowed_vdd_mclk_table->count; i++) {
data->dpm_table.mvdd_table.dpm_levels[i].value = 
allowed_vdd_mclk_table->entries[i].v;
-   data->dpm_table.mvdd_table.dpm_levels[i].enabled = 1;
+   data->dpm_table.mvdd_table.dpm_levels[i].enabled = true;
}
data->dpm_table.mvdd_table.count = 
allowed_vdd_mclk_table->count;
}
--
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel