FAILED: patch "[PATCH] platform/x86: int3472: Fix uninitialised variable warning" failed to apply to 6.6-stable tree
Sasha Levin
maintainerThe patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x 70e6384fe0f4cf9768944f81924f6c1478b0ce43
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 6.6.y' 'HEAD^..'
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From 70e6384fe0f4cf9768944f81924f6c1478b0ce43 Mon Sep 17 00:00:00 2001
From: Sakari Ailus <[email protected]>
Date: Thu, 20 Aug 2026 23:19:01 +0300
Subject: [PATCH] platform/x86: int3472: Fix uninitialised variable warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fix a compiler warning about an uninitialised err_msg variable by printing the error where it is handled:
drivers/platform/x86/intel/int3472/discrete.c:440:24: warning: ‘err_msg’ may be used uninitialized [-Wmaybe-uninitialized]
440 | return dev_err_probe(int3472->dev, ret, err_msg);
--- drivers/platform/x86/intel/int3472/discrete.c | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-)
drivers/platform/x86/intel/int3472/discrete.c +14 -11
@@ -329,7 +329,6 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,unsigned long gpio_flags;union acpi_object *obj;struct gpio_desc *gpio; -const char *err_msg;const char *con_id;int ret;
@@ -375,7 +374,8 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,case INT3472_GPIO_TYPE_HOTPLUG_DETECT : ret =skl_int3472_map_gpio_to_sensor (int3472, agpio, con_id, gpio_flags);if (ret) - err_msg ="Failed to map GPIO pin to sensor\n" ; +dev_err_probe (int3472->dev, ret, +"Failed to map GPIO pin to sensor\n" );break ;case INT3472_GPIO_TYPE_CLK_ENABLE :
@@ -387,7 +387,7 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares, gpio =skl_int3472_gpiod_get_from_temp_lookup (int3472, agpio, con_id, gpio_flags);if (IS_ERR (gpio)) { ret =PTR_ERR (gpio); - err_msg ="Failed to get GPIO\n" ; +dev_err_probe (int3472->dev, ret,"Failed to get GPIO\n" );break ; }
@@ -395,14 +395,16 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,case INT3472_GPIO_TYPE_CLK_ENABLE : ret =skl_int3472_register_gpio_clock (int3472, gpio);if (ret) - err_msg ="Failed to register clock\n" ; +dev_err_probe (int3472->dev, ret, +"Failed to register clock\n" );break ;case INT3472_GPIO_TYPE_PRIVACY_LED :case INT3472_GPIO_TYPE_STROBE : ret =skl_int3472_register_led (int3472, gpio, con_id);if (ret) - err_msg ="Failed to register LED\n" ; +dev_err_probe (int3472->dev, ret, +"Failed to register LED\n" );break ;case INT3472_GPIO_TYPE_POWER_ENABLE :
@@ -413,7 +415,8 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares, ret =skl_int3472_register_regulator (int3472, gpio, enable_time_us, con_id, second_sensor);if (ret) - err_msg ="Failed to register regulator\n" ; +dev_err_probe (int3472->dev, ret, +"Failed to register regulator\n" );break ;default :/* Never reached */
@@ -436,11 +439,11 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares, int3472->ngpios++;ACPI_FREE (obj); -if (ret <0 ) -return dev_err_probe (int3472->dev, ret, err_msg); - -/* Tell acpi_dev_get_resources() to not make a copy of the resource */ -return 1 ; +/* +* Either return an error or tell acpi_dev_get_resources() to not make a +* copy of the resource. +*/ +return ret <0 ? ret :1 ; }int int3472_discrete_parse_crs (struct int3472_discrete_device *int3472)
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 platform/x86: int3472: Fix uninitialised variable warning
From: Sakari Ailus <[email protected]>
[ Upstream commit 70e6384fe0f4cf9768944f81924f6c1478b0ce43 ]
Fix a compiler warning about an uninitialised err_msg variable by printing the error where it is handled:
drivers/platform/x86/intel/int3472/discrete.c:440:24: warning: ‘err_msg’ may be used uninitialized [-Wmaybe-uninitialized]
440 | return dev_err_probe(int3472->dev, ret, err_msg);
--- drivers/platform/x86/intel/int3472/discrete.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/platform/x86/intel/int3472/discrete.c +8 -8
@@ -156,7 +156,6 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,struct acpi_resource_gpio *agpio;u8 active_value, pin, type;union acpi_object *obj; -const char *err_msg;const char *func;u32 polarity;int ret;
@@ -202,25 +201,29 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,case INT3472_GPIO_TYPE_POWERDOWN : ret =skl_int3472_map_gpio_to_sensor (int3472, agpio, func, polarity);if (ret) - err_msg ="Failed to map GPIO pin to sensor\n" ; +dev_err_probe (int3472->dev, ret, +"Failed to map GPIO pin to sensor\n" );break ;case INT3472_GPIO_TYPE_CLK_ENABLE : ret =skl_int3472_register_gpio_clock (int3472, agpio, polarity);if (ret) - err_msg ="Failed to register clock\n" ; +dev_err_probe (int3472->dev, ret, +"Failed to register clock\n" );break ;case INT3472_GPIO_TYPE_PRIVACY_LED : ret =skl_int3472_register_pled (int3472, agpio, polarity);if (ret) - err_msg ="Failed to register LED\n" ; +dev_err_probe (int3472->dev, ret, +"Failed to register LED\n" );break ;case INT3472_GPIO_TYPE_POWER_ENABLE : ret =skl_int3472_register_regulator (int3472, agpio);if (ret) - err_msg ="Failed to map regulator to sensor\n" ; +dev_err_probe (int3472->dev, ret, +"Failed to map regulator to sensor\n" );break ;default :
@@ -234,9 +237,6 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares, int3472->ngpios++;ACPI_FREE (obj); -if (ret <0 ) -return dev_err_probe (int3472->dev, ret, err_msg); -return ret; }
Signature · 1 line
2.53.0