summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorOlivier Moysan <olivier.moysan@st.com>2018-10-22 17:10:46 +0200
committerMark Brown <broonie@kernel.org>2018-10-23 10:51:45 +0100
commit6be0f96d799f487f05eb412d362d5a1747d665c2 (patch)
tree39d6cd20ea029d8cf844b84999c3fb167782e67b /sound
parente6d7942ce602e99d506a7c08f1935a274645dfda (diff)
ASoC: stm32: sai: fix master clock naming
Fixes: 8307b2afd386 ("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>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/stm/stm32_sai_sub.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c
index 31d22abd3204..ea05cc91aa05 100644
--- a/sound/soc/stm/stm32_sai_sub.c
+++ b/sound/soc/stm/stm32_sai_sub.c
@@ -404,12 +404,11 @@ static int stm32_sai_add_mclk_provider(struct stm32_sai_sub_data *sai)
* String after "_" char is stripped in parent name.
*/
p = mclk_name;
- while (*s && *s != '_' && (i < (SAI_MCLK_NAME_LEN - 6))) {
+ while (*s && *s != '_' && (i < (SAI_MCLK_NAME_LEN - 7))) {
*p++ = *s++;
i++;
}
- STM_SAI_IS_SUB_A(sai) ?
- strncat(p, "a_mclk", 6) : strncat(p, "b_mclk", 6);
+ STM_SAI_IS_SUB_A(sai) ? strcat(p, "a_mclk") : strcat(p, "b_mclk");
mclk->hw.init = CLK_HW_INIT(mclk_name, pname, &mclk_ops, 0);
mclk->sai_data = sai;