AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux-next] drm/amdgpu: use string choice helpers
@ 2025-04-27  9:45 R Sundar
  2025-04-28 17:24 ` Alex Deucher
  0 siblings, 1 reply; 6+ messages in thread
From: R Sundar @ 2025-04-27  9:45 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David Airlie, Simona Vetter,
	Sunil Khatri, Tim Huang, Jesse . zhang @ amd . com, Boyuan Zhang,
	Pierre-Eric Pelloux-Prayer, Yang Wang, Peyton Lee
  Cc: amd-gfx, dri-devel, linux-kernel, R Sundar, kernel test robot,
	Julia Lawall

Use string choice helpers for better readability.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@inria.fr>
Closes: https://lore.kernel.org/r/202503222049.sUXL3q6w-lkp@intel.com/
Signed-off-by: R Sundar <prosunofficial@gmail.com>
---

Reported in linux repository.

cocci warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c:311:49-70: opportunity for str_true_false(vpe -> collaborate_mode)

vim +311 drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c

for linux-next:

 drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
index 121ee17b522b..442d137e0fed 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
@@ -317,7 +317,7 @@ static int vpe_early_init(struct amdgpu_ip_block *ip_block)
 	vpe_set_ring_funcs(adev);
 	vpe_set_regs(vpe);
 
-	dev_info(adev->dev, "VPE: collaborate mode %s", vpe->collaborate_mode ? "true" : "false");
+	dev_info(adev->dev, "VPE: collaborate mode %s", str_true_false(vpe->collaborate_mode));
 
 	return 0;
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [PATCH linux-next] drm/amdgpu: use string choice helpers
@ 2024-10-27 14:05 R Sundar
  2024-10-29 13:41 ` Alex Deucher
  0 siblings, 1 reply; 6+ messages in thread
From: R Sundar @ 2024-10-27 14:05 UTC (permalink / raw)
  To: alexander.deucher, christian.koenig, Xinhui.Pan, airlied, simona,
	tao.zhou1, kevinyang.wang, Hawking.Zhang
  Cc: amd-gfx, dri-devel, linux-kernel, luben.tuikov, R Sundar,
	kernel test robot, Julia Lawall

Use string choice helpers for better readability.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@inria.fr>
Closes: https://lore.kernel.org/r/202410161814.I6p2Nnux-lkp@intel.com/
Signed-off-by: R Sundar <prosunofficial@gmail.com>
---

reported in linux repository.

tree:  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

cocci warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/amd/amdgpu/amdgpu_eeprom.c:145:8-12: opportunity for str_read_write(read)

vim +145 drivers/gpu/drm/amd/amdgpu/amdgpu_eeprom.c

 drivers/gpu/drm/amd/amdgpu/amdgpu_eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_eeprom.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_eeprom.c
index 35fee3e8cde2..8cd69836dd99 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_eeprom.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_eeprom.c
@@ -200,7 +200,7 @@ static int amdgpu_eeprom_xfer(struct i2c_adapter *i2c_adap, u32 eeprom_addr,
 		dev_err_ratelimited(&i2c_adap->dev,
 				    "maddr:0x%04X size:0x%02X:quirk max_%s_len must be > %d",
 				    eeprom_addr, buf_size,
-				    read ? "read" : "write", EEPROM_OFFSET_SIZE);
+				    str_read_write(read), EEPROM_OFFSET_SIZE);
 		return -EINVAL;
 	}
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-04-28 17:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-27  9:45 [PATCH linux-next] drm/amdgpu: use string choice helpers R Sundar
2025-04-28 17:24 ` Alex Deucher
  -- strict thread matches above, loose matches on Subject: below --
2024-10-27 14:05 R Sundar
2024-10-29 13:41 ` Alex Deucher
2024-10-29 17:05   ` R Sundar
2024-10-29 17:13     ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox