diff mbox series

drm/amdgpu: enable -Wformat-truncation

Message ID 20240903200953.292717-1-hamza.mahfooz@amd.com (mailing list archive)
State New, archived
Headers show
Series drm/amdgpu: enable -Wformat-truncation | expand

Commit Message

Hamza Mahfooz Sept. 3, 2024, 8:09 p.m. UTC
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.

Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/Makefile | 1 +
 1 file changed, 1 insertion(+)

Comments

Jani Nikula Sept. 4, 2024, 8:21 a.m. UTC | #1
On Tue, 03 Sep 2024, Hamza Mahfooz <hamza.mahfooz@amd.com> wrote:
> 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/cover.1716479340.git.jani.nikula@intel.com

>
> Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/Makefile b/drivers/gpu/drm/amd/amdgpu/Makefile
> index 34943b866687..64adadb56fd6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/Makefile
> +++ b/drivers/gpu/drm/amd/amdgpu/Makefile
> @@ -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
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/amdgpu/Makefile b/drivers/gpu/drm/amd/amdgpu/Makefile
index 34943b866687..64adadb56fd6 100644
--- a/drivers/gpu/drm/amd/amdgpu/Makefile
+++ b/drivers/gpu/drm/amd/amdgpu/Makefile
@@ -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