Skip to contentSkip to conversation

drm/amdgpu: enable -Wformat-truncation

PATCH In review Hamza Mahfooz 2 participants 2 messages Sep 3, 2024 – Sep 4, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: enable -Wformat-truncation

It is enabled by W=1 and amdgpu has a clean build with it enabled. So, to make sure we block future instances of it from showing up on our driver, enable it by default for the module.

---
 drivers/gpu/drm/amd/amdgpu/Makefile | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/Makefile +1 -0
index 34943b866687..64adadb56fd6 100644
@@ -41,6 +41,7 @@ ccflags-y := -I$(FULL_AMD_PATH)/include/asic_reg \
 
 # Locally disable W=1 warnings enabled in drm subsystem Makefile
 subdir-ccflags-y += -Wno-override-init
+subdir-ccflags-y += $(call cc-option, -Wformat-truncation)
 subdir-ccflags-$(CONFIG_DRM_AMDGPU_WERROR) += -Werror
 
 amdgpu-y := amdgpu_drv.o
Signature · 1 line
2.46.0
#1 lore raw
Quoted 3 lines · Hamza Mahfooz

It is enabled by W=1 and amdgpu has a clean build with it enabled. So, to make sure we block future instances of it from showing up on our driver, enable it by default for the module.

Would prefer enabling it by default across the subsystem [1].

BR,
Jani.

[1] https://lore.kernel.org/r/[email protected]

Quoted 18 lines
---
 drivers/gpu/drm/amd/amdgpu/Makefile | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/Makefile +1 -0
index 34943b866687..64adadb56fd6 100644
@@ -41,6 +41,7 @@ ccflags-y := -I$(FULL_AMD_PATH)/include/asic_reg \
 
 # Locally disable W=1 warnings enabled in drm subsystem Makefile
 subdir-ccflags-y += -Wno-override-init
+subdir-ccflags-y += $(call cc-option, -Wformat-truncation)
 subdir-ccflags-$(CONFIG_DRM_AMDGPU_WERROR) += -Werror
 
 amdgpu-y := amdgpu_drv.o
Signature · 1 line
Jani Nikula, Intel