Remove support for SNDRV_CTL_ELEM_ACCESS_USER & minor fix
cover Remove support for SNDRV_CTL_ELEM_ACCESS_USER & minor fix
From: Mengdong Lin <[email protected]>
There is no ABI change in this series.
Remove support for control flag SNDRV_CTL_ELEM_ACCESS_USER as Takashi Sakamoto suggested. Also fix 2 compiler warnings and add check before string cpy.
Mengdong Lin (3):
topology: Remove support for control flag SNDRV_CTL_ELEM_ACCESS_USER
topology: Fix compiler warnings
topology: Check address and length before string copy
src/topology/ctl.c | 1 - src/topology/pcm.c | 8 ++++---- src/topology/tplg_local.h | 3 +++ 3 files changed, 7 insertions(+), 5 deletions(-)
Signature · 1 line
2.5.0
PATCH 1/3 topology: Remove support for control flag SNDRV_CTL_ELEM_ACCESS_USER
From: Mengdong Lin <[email protected]>
This access flag is used to add controls from user space by ioctl. But topology only configures controls in user space and these controls will still be created by ASoC in kernel, so topology should not support this flag.
src/topology/ctl.c +0 -1
@@ -41,7 +41,6 @@ static const struct ctl_access_elem ctl_access[] = { {"lock", SNDRV_CTL_ELEM_ACCESS_LOCK}, {"owner", SNDRV_CTL_ELEM_ACCESS_OWNER}, {"tlv_callback", SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK}, - {"user", SNDRV_CTL_ELEM_ACCESS_USER}, };/* find CTL access strings and conver to values */
Signature · 1 line
2.5.0
PATCH 2/3 topology: Fix compiler warnings
In reply to [email protected]From: Mengdong Lin <[email protected]>
Append ATTRIBUTE_UNUSED to the unused parameter, which need to be kept to share the same functions proto type with others.
src/topology/pcm.c +4 -4
@@ -259,8 +259,8 @@ int tplg_parse_stream_caps(snd_tplg_t *tplg, }/* Parse the caps and config of a pcm stream */ -static int tplg_parse_streams (snd_tplg_t *tplg,snd_config_t *cfg, -void *private) +static int tplg_parse_streams(snd_tplg_t *tplg ATTRIBUTE_UNUSED, +snd_config_t *cfg,void *private) {snd_config_iterator_t i, next;snd_config_t *n;
@@ -321,8 +321,8 @@ static int tplg_parse_streams(snd_tplg_t *tplg, snd_config_t *cfg, }/* Parse name and id of a front-end DAI (ie. cpu dai of a FE DAI link) */ -static int tplg_parse_fe_dai (snd_tplg_t *tplg,snd_config_t *cfg, -void *private) +static int tplg_parse_fe_dai(snd_tplg_t *tplg ATTRIBUTE_UNUSED, +snd_config_t *cfg,void *private) {struct tplg_elem *elem = private;struct snd_soc_tplg_pcm *pcm = elem->pcm;
Signature · 1 line
2.5.0
PATCH 3/3 topology: Check address and length before string copy
In reply to [email protected]From: Mengdong Lin <[email protected]>
src/topology/tplg_local.h +3 -0
@@ -253,6 +253,9 @@ struct tplg_elem* tplg_elem_new_common(snd_tplg_t *tplg,static inline void elem_copy_text (char *dest,const char *src,int len) { +if (!dest || !src || !len) +return ; +strncpy (dest, src, len); dest[len -1 ] =0 ; }
Signature · 1 line
2.5.0
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 3/3] topology: Check address and length before string copy
Quoted 16 lines
-----Original Message-----
From: Takashi Sakamoto [mailto:[email protected]]
Sent: Tuesday, July 19, 2016 5:45 PM
To: [email protected]; [email protected]; [email protected]
Cc: [email protected]; Girdwood, Liam R; Lin, Mengdong
Subject: Re: [PATCH 3/3] topology: Check address and length before string copyHi,
Quoted 3 lines · On Jul 19 2016 17:52, [email protected] wrote:
From: Mengdong Lin <[email protected]>
Signed-off-by Mengdong Lin <[email protected]>
Quoted 7 lines
The cover letter addresses this patch fixes a compiler warning. In this case, it's better to write the message in commit message, I think. Like:
http://mailman.alsa-project.org/pipermail/alsa-devel/2016-July/110097.ht
mlThis is not just from my taste. Maintainers prefer. At least, blank commit messages are not preferrable in general.
Yes, that would be better. I'll fix this in v2 tomorrow.
Thanks
Mengdong
Quoted 22 lines
src/topology/tplg_local.h struct tplg_elem*
Quoted 6 lines
src/topology/tplg_local.h +0
-0@@ -253,6 +253,9 @@ struct tplg_elem*tplg_elem_new_common(snd_tplg_t
Quoted 10 lines
src/topology/tplg_local.h +3
-0*tplg, static inline void elem_copy_text(char *dest, const char *src, int len) { +if (!dest || !src || !len) +return ; +strncpy (dest, src, len); dest[len -1 ] =0 ;}Regards
Takashi Sakamoto