From: Olivier Moysan <olivier.moysan@st.com>
To: <lgirdwood@gmail.com>, <broonie@kernel.org>, <perex@perex.cz>,
<tiwai@suse.com>, <mcoquelin.stm32@gmail.com>,
<alexandre.torgue@st.com>, <alsa-devel@alsa-project.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-stm32@st-md-mailman.stormreply.com>,
<linux-kernel@vger.kernel.org>, <olivier.moysan@st.com>,
<arnaud.pouliquen@st.com>, <benjamin.gaignard@st.com>
Subject: [PATCH 2/2] ASoC: stm32: sai: fix master clock naming
Date: Mon, 22 Oct 2018 17:10:46 +0200 [thread overview]
Message-ID: <1540221046-11812-3-git-send-email-olivier.moysan@st.com> (raw)
In-Reply-To: <1540221046-11812-1-git-send-email-olivier.moysan@st.com>
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>
---
sound/soc/stm/stm32_sai_sub.c | 5 ++---
1 file 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;
--
2.7.4
next prev parent reply other threads:[~2018-10-22 15:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-22 15:10 [PATCH 0/2] ASoC: stm32: sai: fix kbuild errors Olivier Moysan
2018-10-22 15:10 ` [PATCH 1/2] ASoC: stm32: add clock dependency for sai Olivier Moysan
2018-10-23 9:54 ` Applied "ASoC: stm32: add clock dependency for sai" to the asoc tree Mark Brown
2018-10-22 15:10 ` Olivier Moysan [this message]
2018-10-23 9:53 ` Applied "ASoC: stm32: sai: fix master clock naming" " Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1540221046-11812-3-git-send-email-olivier.moysan@st.com \
--to=olivier.moysan@st.com \
--cc=alexandre.torgue@st.com \
--cc=alsa-devel@alsa-project.org \
--cc=arnaud.pouliquen@st.com \
--cc=benjamin.gaignard@st.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).