[alsa-devel] [PATCH 0/3] Remove support for SNDRV_CTL_ELEM_ACCESS_USER & minor fix

From: Mengdong Lin mengdong.lin@linux.intel.com
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(-)

From: Mengdong Lin mengdong.lin@linux.intel.com
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.
Signed-off-by: Mengdong Lin mengdong.lin@linux.intel.com
diff --git a/src/topology/ctl.c b/src/topology/ctl.c index 592dded..54f8e44 100644 --- a/src/topology/ctl.c +++ b/src/topology/ctl.c @@ -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 */

From: Mengdong Lin mengdong.lin@linux.intel.com
Append ATTRIBUTE_UNUSED to the unused parameter, which need to be kept to share the same functions proto type with others.
Signed-off-by: Mengdong Lin mengdong.lin@linux.intel.com
diff --git a/src/topology/pcm.c b/src/topology/pcm.c index 281e6ef..0a90cb9 100644 --- a/src/topology/pcm.c +++ b/src/topology/pcm.c @@ -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;

From: Mengdong Lin mengdong.lin@linux.intel.com
Signed-off-by: Mengdong Lin mengdong.lin@linux.intel.com
diff --git a/src/topology/tplg_local.h b/src/topology/tplg_local.h index 4d79aa7..cfde4cc 100644 --- a/src/topology/tplg_local.h +++ b/src/topology/tplg_local.h @@ -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; }
participants (1)
-
mengdong.lin@linux.intel.com