Skip to content

Commit 6be0f96

Browse files
Olivier Moysanbroonie
authored andcommitted
ASoC: stm32: sai: fix master clock naming
Fixes: 8307b2a ("ASoC: stm32: sai: set sai as mclk clock provider") Fix warning issued by strncat when bound equals to source length. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent e6d7942 commit 6be0f96

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

sound/soc/stm/stm32_sai_sub.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,11 @@ static int stm32_sai_add_mclk_provider(struct stm32_sai_sub_data *sai)
404404
* String after "_" char is stripped in parent name.
405405
*/
406406
p = mclk_name;
407-
while (*s && *s != '_' && (i < (SAI_MCLK_NAME_LEN - 6))) {
407+
while (*s && *s != '_' && (i < (SAI_MCLK_NAME_LEN - 7))) {
408408
*p++ = *s++;
409409
i++;
410410
}
411-
STM_SAI_IS_SUB_A(sai) ?
412-
strncat(p, "a_mclk", 6) : strncat(p, "b_mclk", 6);
411+
STM_SAI_IS_SUB_A(sai) ? strcat(p, "a_mclk") : strcat(p, "b_mclk");
413412

414413
mclk->hw.init = CLK_HW_INIT(mclk_name, pname, &mclk_ops, 0);
415414
mclk->sai_data = sai;

0 commit comments

Comments
 (0)