Fix clang 19 issues

Change-Id: I5d5d81bcefaf02a9542674ec00a58e9dd958561d
This commit is contained in:
David Wronek 2024-12-25 17:54:26 +01:00
parent 322217c1fe
commit 45c35ddaed
5 changed files with 13 additions and 29 deletions

View File

@ -20,7 +20,7 @@ CONFIG_SEC_CRASHKEY_LONG=m
CONFIG_SEC_DEBUG_REGION=m CONFIG_SEC_DEBUG_REGION=m
CONFIG_SEC_RDX_BOOTDEV=m CONFIG_SEC_RDX_BOOTDEV=m
CONFIG_SEC_ARM64_AP_CONTEXT=m CONFIG_SEC_ARM64_AP_CONTEXT=m
CONFIG_SEC_ARM64_FSIMD_DEBUG=m CONFIG_SEC_ARM64_FSIMD_DEBUG=n
CONFIG_SEC_ARM64_DEBUG=m CONFIG_SEC_ARM64_DEBUG=m
CONFIG_SEC_QC_DEBUG=m CONFIG_SEC_QC_DEBUG=m
CONFIG_SEC_QC_RBCMD=m CONFIG_SEC_QC_RBCMD=m

View File

@ -758,22 +758,22 @@ void stm_ts_print_frame(struct stm_ts_data *ts, short *min, short *max)
if (pStr == NULL) if (pStr == NULL)
return; return;
snprintf(pTmp, 4, " "); snprintf(pTmp, 5, " ");
strlcat(pStr, pTmp, lsize); strlcat(pStr, pTmp, lsize);
for (i = 0; i < ts->rx_count; i++) { for (i = 0; i < ts->rx_count; i++) {
snprintf(pTmp, 6, "Rx%02d ", i); snprintf(pTmp, 7, "Rx%02d ", i);
strlcat(pStr, pTmp, lsize); strlcat(pStr, pTmp, lsize);
} }
input_raw_info_d(GET_DEV_COUNT(ts->multi_dev), ts->dev, "%s\n", pStr); input_raw_info_d(GET_DEV_COUNT(ts->multi_dev), ts->dev, "%s\n", pStr);
memset(pStr, 0x0, 6 * (ts->rx_count + 1)); memset(pStr, 0x0, 6 * (ts->rx_count + 1));
snprintf(pTmp, 2, " +"); snprintf(pTmp, 3, " +");
strlcat(pStr, pTmp, lsize); strlcat(pStr, pTmp, lsize);
for (i = 0; i < ts->rx_count; i++) { for (i = 0; i < ts->rx_count; i++) {
snprintf(pTmp, 6, "------"); snprintf(pTmp, 7, "------");
strlcat(pStr, pTmp, lsize); strlcat(pStr, pTmp, lsize);
} }
@ -781,11 +781,11 @@ void stm_ts_print_frame(struct stm_ts_data *ts, short *min, short *max)
for (i = 0; i < ts->tx_count; i++) { for (i = 0; i < ts->tx_count; i++) {
memset(pStr, 0x0, 6 * (ts->rx_count + 1)); memset(pStr, 0x0, 6 * (ts->rx_count + 1));
snprintf(pTmp, 7, "Tx%02d | ", i); snprintf(pTmp, 8, "Tx%02d | ", i);
strlcat(pStr, pTmp, lsize); strlcat(pStr, pTmp, lsize);
for (j = 0; j < ts->rx_count; j++) { for (j = 0; j < ts->rx_count; j++) {
snprintf(pTmp, 6, "%5d ", ts->pFrame[(i * ts->rx_count) + j]); snprintf(pTmp, 7, "%5d ", ts->pFrame[(i * ts->rx_count) + j]);
strlcat(pStr, pTmp, lsize); strlcat(pStr, pTmp, lsize);
if (ts->pFrame[(i * ts->rx_count) + j] < *min) if (ts->pFrame[(i * ts->rx_count) + j] < *min)

View File

@ -536,11 +536,11 @@ static int max77705_port_type_set(struct typec_port *port, enum typec_port_type
usbpd_data->typec_power_role, usbpd_data->typec_data_role, port_type); usbpd_data->typec_power_role, usbpd_data->typec_data_role, port_type);
reinit_completion(&usbpd_data->typec_reverse_completion); reinit_completion(&usbpd_data->typec_reverse_completion);
if (port_type == TYPEC_PORT_DFP) { if (port_type == TYPEC_PORT_SRC) {
msg_maxim("try reversing, from UFP(Sink) to DFP(Source)"); msg_maxim("try reversing, from UFP(Sink) to DFP(Source)");
usbpd_data->typec_try_state_change = TRY_ROLE_SWAP_TYPE; usbpd_data->typec_try_state_change = TRY_ROLE_SWAP_TYPE;
max77705_rprd_mode_change(usbpd_data, TYPE_C_ATTACH_DFP); max77705_rprd_mode_change(usbpd_data, TYPE_C_ATTACH_DFP);
} else if (port_type == TYPEC_PORT_UFP) { } else if (port_type == TYPEC_PORT_SNK) {
msg_maxim("try reversing, from DFP(Source) to UFP(Sink)"); msg_maxim("try reversing, from DFP(Source) to UFP(Sink)");
#if IS_ENABLED(CONFIG_PDIC_NOTIFIER) #if IS_ENABLED(CONFIG_PDIC_NOTIFIER)
max77705_ccic_event_work(usbpd_data, max77705_ccic_event_work(usbpd_data,

View File

@ -355,11 +355,11 @@ static int max77775_port_type_set(struct typec_port *port, enum typec_port_type
usbpd_data->typec_power_role, usbpd_data->typec_data_role, port_type); usbpd_data->typec_power_role, usbpd_data->typec_data_role, port_type);
reinit_completion(&usbpd_data->typec_reverse_completion); reinit_completion(&usbpd_data->typec_reverse_completion);
if (port_type == TYPEC_PORT_DFP) { if (port_type == TYPEC_PORT_SRC) {
msg_maxim("try reversing, from UFP(Sink) to DFP(Source)"); msg_maxim("try reversing, from UFP(Sink) to DFP(Source)");
usbpd_data->typec_try_state_change = TRY_ROLE_SWAP_TYPE; usbpd_data->typec_try_state_change = TRY_ROLE_SWAP_TYPE;
max77775_rprd_mode_change(usbpd_data, TYPE_C_ATTACH_DFP); max77775_rprd_mode_change(usbpd_data, TYPE_C_ATTACH_DFP);
} else if (port_type == TYPEC_PORT_UFP) { } else if (port_type == TYPEC_PORT_SNK) {
msg_maxim("try reversing, from DFP(Source) to UFP(Sink)"); msg_maxim("try reversing, from DFP(Source) to UFP(Sink)");
#if IS_ENABLED(CONFIG_PDIC_NOTIFIER) #if IS_ENABLED(CONFIG_PDIC_NOTIFIER)
max77775_ccic_event_work(usbpd_data, max77775_ccic_event_work(usbpd_data,

View File

@ -47,24 +47,17 @@ else
ifdef CONFIG_CC_IS_CLANG ifdef CONFIG_CC_IS_CLANG
KBUILD_CFLAGS += -Wno-initializer-overrides KBUILD_CFLAGS += -Wno-initializer-overrides
# Clang before clang-16 would warn on default argument promotions.
ifneq ($(call clang-min-version, 180000),y)
# Disable -Wformat
KBUILD_CFLAGS += -Wno-format KBUILD_CFLAGS += -Wno-format
# Then re-enable flags that were part of the -Wformat group that aren't
# problematic.
KBUILD_CFLAGS += -Wformat-extra-args -Wformat-invalid-specifier KBUILD_CFLAGS += -Wformat-extra-args -Wformat-invalid-specifier
KBUILD_CFLAGS += -Wformat-zero-length -Wnonnull KBUILD_CFLAGS += -Wformat-zero-length -Wnonnull
# Requires clang-12+.
ifeq ($(call clang-min-version, 120000),y)
KBUILD_CFLAGS += -Wformat-insufficient-args KBUILD_CFLAGS += -Wformat-insufficient-args
endif
endif
KBUILD_CFLAGS += -Wno-sign-compare KBUILD_CFLAGS += -Wno-sign-compare
KBUILD_CFLAGS += $(call cc-disable-warning, pointer-to-enum-cast) KBUILD_CFLAGS += $(call cc-disable-warning, pointer-to-enum-cast)
KBUILD_CFLAGS += -Wno-tautological-constant-out-of-range-compare KBUILD_CFLAGS += -Wno-tautological-constant-out-of-range-compare
KBUILD_CFLAGS += $(call cc-disable-warning, unaligned-access) KBUILD_CFLAGS += $(call cc-disable-warning, unaligned-access)
KBUILD_CFLAGS += $(call cc-disable-warning, cast-function-type-strict) KBUILD_CFLAGS += $(call cc-disable-warning, cast-function-type-strict)
KBUILD_CFLAGS += -Wno-enum-compare-conditional
KBUILD_CFLAGS += -Wno-enum-enum-conversion
endif endif
endif endif
@ -106,12 +99,3 @@ KBUILD_CFLAGS += $(call cc-option, -Wpacked-bitfield-compat)
KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN3 KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN3
endif endif
#
# W=e - error out on warnings
#
ifneq ($(findstring e, $(KBUILD_EXTRA_WARN)),)
KBUILD_CFLAGS += -Werror
endif