From 113195f1eb060faa2a57e41e36dfc08395bed428 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 17 Dec 2025 07:31:01 +0100 Subject: [PATCH] 6.17-stable patches added patches: asoc-codecs-nau8325-silence-uninitialized-variables-warnings.patch --- ...nce-uninitialized-variables-warnings.patch | 46 +++++++++++++++++++ queue-6.17/series | 1 + 2 files changed, 47 insertions(+) create mode 100644 queue-6.17/asoc-codecs-nau8325-silence-uninitialized-variables-warnings.patch diff --git a/queue-6.17/asoc-codecs-nau8325-silence-uninitialized-variables-warnings.patch b/queue-6.17/asoc-codecs-nau8325-silence-uninitialized-variables-warnings.patch new file mode 100644 index 0000000000..0056a2e57e --- /dev/null +++ b/queue-6.17/asoc-codecs-nau8325-silence-uninitialized-variables-warnings.patch @@ -0,0 +1,46 @@ +From 2c7e5e17c05f1d5e10e63e1baff2b362cd08dcd6 Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Wed, 3 Dec 2025 15:06:12 +0100 +Subject: ASoC: codecs: nau8325: Silence uninitialized variables warnings + +From: Krzysztof Kozlowski + +commit 2c7e5e17c05f1d5e10e63e1baff2b362cd08dcd6 upstream. + +clang W=1 builds warn: + + nau8325.c:430:13: error: variable 'n2_max' is uninitialized when used here [-Werror,-Wuninitialized] + +which are false positive, because the variables will be always +initialized when used (guarded by mclk_max!=0 check). However +initializing them upfront makes the code more obvious and easier, plus +it silences the warning. + +Signed-off-by: Krzysztof Kozlowski +Link: https://patch.msgid.link/20251203140611.87191-2-krzysztof.kozlowski@oss.qualcomm.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/codecs/nau8325.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/sound/soc/codecs/nau8325.c ++++ b/sound/soc/codecs/nau8325.c +@@ -386,7 +386,8 @@ static int nau8325_clksrc_choose(struct + const struct nau8325_srate_attr **srate_table, + int *n1_sel, int *mult_sel, int *n2_sel) + { +- int i, j, mclk, mclk_max, ratio, ratio_sel, n2_max; ++ int i, j, mclk, ratio; ++ int mclk_max = 0, ratio_sel = 0, n2_max = 0; + + if (!nau8325->mclk || !nau8325->fs) + goto proc_err; +@@ -408,7 +409,6 @@ static int nau8325_clksrc_choose(struct + } + + /* Get MCLK_SRC through 1/N, Multiplier, and then 1/N2. */ +- mclk_max = 0; + for (i = 0; i < ARRAY_SIZE(mclk_n1_div); i++) { + for (j = 0; j < ARRAY_SIZE(mclk_n3_mult); j++) { + mclk = nau8325->mclk << mclk_n3_mult[j].param; diff --git a/queue-6.17/series b/queue-6.17/series index c801fc9f25..d2a0eaec8a 100644 --- a/queue-6.17/series +++ b/queue-6.17/series @@ -504,3 +504,4 @@ alsa-hda-realtek-add-match-for-asus-xbox-ally-projects.patch alsa-hda-tas2781-fix-speaker-id-retrieval-for-multiple-probes.patch alsa-hda-cs35l41-fix-null-pointer-dereference-in-cs35l41_hda_read_acpi.patch alsa-wavefront-fix-integer-overflow-in-sample-size-validation.patch +asoc-codecs-nau8325-silence-uninitialized-variables-warnings.patch -- 2.47.3