From ed5b0563f12e6ab166228eef34664413865d2012 Mon Sep 17 00:00:00 2001 From: WangYuli Date: Wed, 20 Nov 2024 13:55:36 +0800 Subject: [PATCH 1/6] drm/arise: Fix unknown warning option error with clang-19 Fix follow error: error: unknown warning option '-Wno-missing-attributes' [-Werror,-Wunknown-warning-option] Signed-off-by: WangYuli --- drivers/gpu/drm/arise/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arise/Makefile b/drivers/gpu/drm/arise/Makefile index 17364abbe928e..2e588070d7eb9 100644 --- a/drivers/gpu/drm/arise/Makefile +++ b/drivers/gpu/drm/arise/Makefile @@ -13,7 +13,8 @@ CHECK_GCC_VERSION?=1 endif ccflags-y := -D__LINUX__ -DKERNEL_BUILD -ccflags-y += -Wno-undef -Wno-unused -Wno-missing-braces -Wno-missing-attributes -Wno-overflow -Wno-missing-prototypes -Wno-missing-declarations +ccflags-y += -Wno-undef -Wno-unused -Wno-missing-braces -Wno-overflow -Wno-missing-prototypes -Wno-missing-declarations +ccflags-y += $(call cc-option, -Wno-missing-attributes) ifeq ($(CHECK_GCC_VERSION), 1) From 72bc4d8d5a9b27f32d35f4633d361f95440d8635 Mon Sep 17 00:00:00 2001 From: WangYuli Date: Wed, 20 Nov 2024 13:57:48 +0800 Subject: [PATCH 2/6] drm/arise: Fix typo '__gf_peff_h__' There is a spelling mistake of 'peff' which should be 'perf'. Fix follow compile error with clang-19: drivers/gpu/drm/arise/shared/gf_perf.h:15:9: error: '__gf_perf_h__' is used as a header guard here, followed by #define of a different macro [-Werror,-Wheader-guard] 15 | #ifndef __gf_perf_h__ | ^~~~~~~~~~~~~ drivers/gpu/drm/arise/shared/gf_perf.h:16:9: note: '__gf_peff_h__' is defined here; did you mean '__gf_perf_h__'? 16 | #define __gf_peff_h__ | ^~~~~~~~~~~~~ | __gf_perf_h__ 1 error generated. Signed-off-by: WangYuli --- drivers/gpu/drm/arise/shared/gf_perf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arise/shared/gf_perf.h b/drivers/gpu/drm/arise/shared/gf_perf.h index 958f87e3f0f45..b99846cf97ca9 100644 --- a/drivers/gpu/drm/arise/shared/gf_perf.h +++ b/drivers/gpu/drm/arise/shared/gf_perf.h @@ -13,7 +13,7 @@ //***************************************************************************** #ifndef __gf_perf_h__ -#define __gf_peff_h__ +#define __gf_perf_h__ typedef struct gf_begin_perf_event_tag { From a63bc41b058a78a89c5b5e61934d4121013f29e4 Mon Sep 17 00:00:00 2001 From: WangYuli Date: Wed, 20 Nov 2024 15:46:42 +0800 Subject: [PATCH 3/6] drm/arise: cbios: donot implicit truncation from 'int' to bit-field Fix follow compile error with clang-19: drivers/gpu/drm/arise/cbios/Device/Monitor/EDPPanel/CBiosITN156.c:136:22: error: implicit truncation from 'int' to bit-field changes value from 2 to 0 [-Werror,-Wbitfield-constant-conversion] 136 | /*.Flags = */0x2,//backlight control = 0, use hard code link para | ^~~ 1 error generated. According to the comments, 'Flags' should be 0. Signed-off-by: WangYuli --- .../gpu/drm/arise/cbios/Device/Monitor/EDPPanel/CBiosITN156.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arise/cbios/Device/Monitor/EDPPanel/CBiosITN156.c b/drivers/gpu/drm/arise/cbios/Device/Monitor/EDPPanel/CBiosITN156.c index 03a29aadf8775..511b20f563bd3 100644 --- a/drivers/gpu/drm/arise/cbios/Device/Monitor/EDPPanel/CBiosITN156.c +++ b/drivers/gpu/drm/arise/cbios/Device/Monitor/EDPPanel/CBiosITN156.c @@ -133,7 +133,7 @@ CBIOS_EDP_PANEL_DESC ITN156_Panel_Desc = /*.LaneNum = */4, /*.BacklightMax = */255, /*.BacklightMin = */0, - /*.Flags = */0x2,//backlight control = 0, use hard code link para + /*.Flags = */0,//backlight control = 0, use hard code link para }, /*.pFnEDPPanelInit = */INT156_Init, /*.pFnEDPPanelDeInit = */INT156_DeInit, From 765afae7b4c3b3301b49c0b5cb8b19ac6b68ea21 Mon Sep 17 00:00:00 2001 From: WangYuli Date: Wed, 20 Nov 2024 15:59:14 +0800 Subject: [PATCH 4/6] drm/arise: cbios: Prune unreachable code As ulTemp is declared as CBIOS_U32, it cannot <126 and >125 at the same time. Fix follow error with clang-19: drivers/gpu/drm/arise/cbios/Util/CBiosUtil.c:55:25: error: overlapping comparisons always evaluate to false [-Werror,-Wtautological-overlap-compare] 55 | else if((ulTemp<126)&&(ulTemp>125)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~ 1 error generated. Signed-off-by: WangYuli --- drivers/gpu/drm/arise/cbios/Util/CBiosUtil.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/arise/cbios/Util/CBiosUtil.c b/drivers/gpu/drm/arise/cbios/Util/CBiosUtil.c index e836126ad98f9..aee39dcc761dd 100644 --- a/drivers/gpu/drm/arise/cbios/Util/CBiosUtil.c +++ b/drivers/gpu/drm/arise/cbios/Util/CBiosUtil.c @@ -52,10 +52,6 @@ static CBIOS_U32 cbGetVsyncWidth(PCBIOS_EXTENSION_COMMON pcbe, CBIOS_U32 XRes, C { ulRet = 6; } - else if((ulTemp<126)&&(ulTemp>125)) - { - ulRet = 7; - } else if((ulTemp<167)&&(ulTemp>165)) { ulRet = 7; From 62aa873ff8d18dc0f0a879bdca0dd727e6c39f40 Mon Sep 17 00:00:00 2001 From: WangYuli Date: Thu, 21 Nov 2024 13:16:50 +0800 Subject: [PATCH 5/6] drm/arise: remove extraneous parentheses around the comparison Fix follow error with clang-19: drivers/gpu/drm/arise/cbios/Device/Monitor/CBiosHDMIMonitor.c:200:44: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality] 200 | if((pAVIInfoFrameData->ColorFormat == 0))//RGB | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ drivers/gpu/drm/arise/cbios/Device/Monitor/CBiosHDMIMonitor.c:200:44: note: remove extraneous parentheses around the comparison to silence this warning 200 | if((pAVIInfoFrameData->ColorFormat == 0))//RGB | ~ ^ ~ drivers/gpu/drm/arise/cbios/Device/Monitor/CBiosHDMIMonitor.c:200:44: note: use '=' to turn this equality comparison into an assignment 200 | if((pAVIInfoFrameData->ColorFormat == 0))//RGB | ^~ | = 1 error generated. Signed-off-by: WangYuli --- drivers/gpu/drm/arise/cbios/Device/Monitor/CBiosHDMIMonitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arise/cbios/Device/Monitor/CBiosHDMIMonitor.c b/drivers/gpu/drm/arise/cbios/Device/Monitor/CBiosHDMIMonitor.c index 340c54fc2e099..e6390bfdc3bef 100644 --- a/drivers/gpu/drm/arise/cbios/Device/Monitor/CBiosHDMIMonitor.c +++ b/drivers/gpu/drm/arise/cbios/Device/Monitor/CBiosHDMIMonitor.c @@ -197,7 +197,7 @@ static CBIOS_VOID cbHDMIMonitor_GenerateAVIInfoFrameData(PCBIOS_EXTENSION_COMMON if(bIsCEAMode && VICCode > 1) { - if((pAVIInfoFrameData->ColorFormat == 0))//RGB + if(pAVIInfoFrameData->ColorFormat == 0)//RGB { if((pModeParams->IsAdobe) && pModeParams->ColorimetryCaps.IsSupportAdobeRGB) { From 2e1e4bb507560a448c2c5f2bc547bfd70f3ab5f6 Mon Sep 17 00:00:00 2001 From: WangYuli Date: Thu, 21 Nov 2024 13:26:29 +0800 Subject: [PATCH 6/6] drm/arise: donot assigning value of variable of type to itself Fix follow compile errors with clang-19: drivers/gpu/drm/arise/linux/os_interface.c:1995:10: error: explicitly assigning value of variable of type 'unsigned long' to itself [-Werror,-Wself-assign] 1995 | base = base; | ~~~~ ^ ~~~~ drivers/gpu/drm/arise/linux/os_interface.c:1996:10: error: explicitly assigning value of variable of type 'unsigned long' to itself [-Werror,-Wself-assign] 1996 | size = size; | ~~~~ ^ ~~~~ 2 errors generated. Signed-off-by: WangYuli --- drivers/gpu/drm/arise/linux/os_interface.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/arise/linux/os_interface.c b/drivers/gpu/drm/arise/linux/os_interface.c index 40d49bed3ec7d..d4deef744b3a6 100644 --- a/drivers/gpu/drm/arise/linux/os_interface.c +++ b/drivers/gpu/drm/arise/linux/os_interface.c @@ -1992,8 +1992,6 @@ int gf_mtrr_del(int reg, unsigned long base, unsigned long size) err = mtrr_del(reg, base, size); #else /* avoid build warning */ - base = base; - size = size; arch_phys_wc_del(reg); err = 0; #endif