]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: mediatek: mt8195: optimize property formatting error handling by using scnprintf()
authorHariKrishna Sagala <hariconscious@gmail.com>
Fri, 12 Dec 2025 04:44:09 +0000 (10:14 +0530)
committerMark Brown <broonie@kernel.org>
Sun, 14 Dec 2025 10:37:32 +0000 (19:37 +0900)
commit180cdb96e821e30528b02708b927c93daa0ed40b
treef8096003c22947b9cde3c4c9108b7056fe891cb9
parent7a9fa7fda93b7b3ae515f40f67bbf8e1d16337e8
ASoC: mediatek: mt8195: optimize property formatting error handling by using scnprintf()

Replace snprintf() with scnprintf() when constructing the property
and remove negative return error handling as scnprintf() returns the
actual number of bytes written to buffer.

snprintf() as defined by the C99 standard,returns the number of
characters that *would have been* written if enough space were
available.Use scnprintf() that returns the actual number of
characters written.

Link: https://github.com/KSPP/linux/issues/105
Signed-off-by: HariKrishna Sagala <hariconscious@gmail.com>
Link: https://patch.msgid.link/20251212044408.1286-2-hariconscious@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/mediatek/mt8195/mt8195-dai-etdm.c