diff mbox series

drm/amd/display: Fix warning comparing pointer to 0

Message ID 20231201093026.122655-1-jiapeng.chong@linux.alibaba.com (mailing list archive)
State New, archived
Headers show
Series drm/amd/display: Fix warning comparing pointer to 0 | expand

Commit Message

Jiapeng Chong Dec. 1, 2023, 9:30 a.m. UTC
Avoid pointer type value compared with 0 to make code clear.

./drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c:532:62-63: WARNING comparing pointer to 0.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7672
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
index 38360adc53d9..7d13d2e1bda8 100644
--- a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
@@ -529,7 +529,7 @@  enum dmub_status dmub_srv_calc_mem_info(struct dmub_srv *dmub,
 		out->fb[i].cpu_addr = cpu_base + reg->base;
 		out->fb[i].gpu_addr = gpu_base + reg->base;
 
-		if (i == DMUB_WINDOW_4_MAILBOX && params->cpu_inbox_addr != 0) {
+		if (i == DMUB_WINDOW_4_MAILBOX && params->cpu_inbox_addr) {
 			out->fb[i].cpu_addr = (uint8_t *)params->cpu_inbox_addr + reg->base;
 			out->fb[i].gpu_addr = params->gpu_inbox_addr + reg->base;
 		}