From 45c35ddaedac5256a3759f16e88b8a1164b93cb2 Mon Sep 17 00:00:00 2001 From: David Wronek Date: Wed, 25 Dec 2024 17:54:26 +0100 Subject: [PATCH] Fix clang 19 issues Change-Id: I5d5d81bcefaf02a9542674ec00a58e9dd958561d --- arch/arm64/configs/oem/e3q-lego.config | 2 +- drivers/input/sec_input/stm_spi/stm_cmd.c | 12 ++++++------ drivers/usb/typec/maxim/max77705_usbc.c | 4 ++-- drivers/usb/typec/maxim/max77775_usbc.c | 4 ++-- scripts/Makefile.extrawarn | 20 ++------------------ 5 files changed, 13 insertions(+), 29 deletions(-) diff --git a/arch/arm64/configs/oem/e3q-lego.config b/arch/arm64/configs/oem/e3q-lego.config index 86566d0b473d..3f321579461c 100644 --- a/arch/arm64/configs/oem/e3q-lego.config +++ b/arch/arm64/configs/oem/e3q-lego.config @@ -20,7 +20,7 @@ CONFIG_SEC_CRASHKEY_LONG=m CONFIG_SEC_DEBUG_REGION=m CONFIG_SEC_RDX_BOOTDEV=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_QC_DEBUG=m CONFIG_SEC_QC_RBCMD=m diff --git a/drivers/input/sec_input/stm_spi/stm_cmd.c b/drivers/input/sec_input/stm_spi/stm_cmd.c index c4d4c3544b38..997b6072caa8 100644 --- a/drivers/input/sec_input/stm_spi/stm_cmd.c +++ b/drivers/input/sec_input/stm_spi/stm_cmd.c @@ -758,22 +758,22 @@ void stm_ts_print_frame(struct stm_ts_data *ts, short *min, short *max) if (pStr == NULL) return; - snprintf(pTmp, 4, " "); + snprintf(pTmp, 5, " "); strlcat(pStr, pTmp, lsize); for (i = 0; i < ts->rx_count; i++) { - snprintf(pTmp, 6, "Rx%02d ", i); + snprintf(pTmp, 7, "Rx%02d ", i); strlcat(pStr, pTmp, lsize); } input_raw_info_d(GET_DEV_COUNT(ts->multi_dev), ts->dev, "%s\n", pStr); memset(pStr, 0x0, 6 * (ts->rx_count + 1)); - snprintf(pTmp, 2, " +"); + snprintf(pTmp, 3, " +"); strlcat(pStr, pTmp, lsize); for (i = 0; i < ts->rx_count; i++) { - snprintf(pTmp, 6, "------"); + snprintf(pTmp, 7, "------"); 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++) { memset(pStr, 0x0, 6 * (ts->rx_count + 1)); - snprintf(pTmp, 7, "Tx%02d | ", i); + snprintf(pTmp, 8, "Tx%02d | ", i); strlcat(pStr, pTmp, lsize); 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); if (ts->pFrame[(i * ts->rx_count) + j] < *min) diff --git a/drivers/usb/typec/maxim/max77705_usbc.c b/drivers/usb/typec/maxim/max77705_usbc.c index bfffbed50e57..3f24c601a353 100644 --- a/drivers/usb/typec/maxim/max77705_usbc.c +++ b/drivers/usb/typec/maxim/max77705_usbc.c @@ -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); 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)"); usbpd_data->typec_try_state_change = TRY_ROLE_SWAP_TYPE; 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)"); #if IS_ENABLED(CONFIG_PDIC_NOTIFIER) max77705_ccic_event_work(usbpd_data, diff --git a/drivers/usb/typec/maxim/max77775_usbc.c b/drivers/usb/typec/maxim/max77775_usbc.c index 3506ed2e1fc1..83a63097a719 100755 --- a/drivers/usb/typec/maxim/max77775_usbc.c +++ b/drivers/usb/typec/maxim/max77775_usbc.c @@ -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); 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)"); usbpd_data->typec_try_state_change = TRY_ROLE_SWAP_TYPE; 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)"); #if IS_ENABLED(CONFIG_PDIC_NOTIFIER) max77775_ccic_event_work(usbpd_data, diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn index d0eb3d043d55..aa390e8e321b 100644 --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn @@ -47,24 +47,17 @@ else ifdef CONFIG_CC_IS_CLANG 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 -# 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-zero-length -Wnonnull -# Requires clang-12+. -ifeq ($(call clang-min-version, 120000),y) KBUILD_CFLAGS += -Wformat-insufficient-args -endif -endif KBUILD_CFLAGS += -Wno-sign-compare KBUILD_CFLAGS += $(call cc-disable-warning, pointer-to-enum-cast) KBUILD_CFLAGS += -Wno-tautological-constant-out-of-range-compare KBUILD_CFLAGS += $(call cc-disable-warning, unaligned-access) KBUILD_CFLAGS += $(call cc-disable-warning, cast-function-type-strict) +KBUILD_CFLAGS += -Wno-enum-compare-conditional +KBUILD_CFLAGS += -Wno-enum-enum-conversion endif endif @@ -106,12 +99,3 @@ KBUILD_CFLAGS += $(call cc-option, -Wpacked-bitfield-compat) KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN3 endif - -# -# W=e - error out on warnings -# -ifneq ($(findstring e, $(KBUILD_EXTRA_WARN)),) - -KBUILD_CFLAGS += -Werror - -endif