summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/topology.c
diff options
context:
space:
mode:
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>2022-03-08 08:43:41 -0800
committerMark Brown <broonie@kernel.org>2022-03-09 13:30:07 +0000
commite0974a382e7c4e0962edebbd8e0d3185c928ea85 (patch)
tree024e09839a2b70ca658be01ca74af97aa1a25641 /sound/soc/sof/topology.c
parent38a9a06794fe052dab57177f0320f44124e6cef9 (diff)
downloadlinux-stable-e0974a382e7c4e0962edebbd8e0d3185c928ea85.tar.gz
linux-stable-e0974a382e7c4e0962edebbd8e0d3185c928ea85.tar.bz2
linux-stable-e0974a382e7c4e0962edebbd8e0d3185c928ea85.zip
ASoC: SOF: topology: Rename arguments in sof_parse_token_sets()
Rename the priv_size arg to array_size and clarify the arguments in the comments. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20220308164344.577647-16-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/topology.c')
-rw-r--r--sound/soc/sof/topology.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index 8b2c01f45b72..0683b7d812eb 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -949,27 +949,26 @@ static int sof_parse_word_tokens(struct snd_soc_component *scomp,
* @object: target ipc struct for parsed values
* @tokens: token definition array describing what tokens to parse
* @count: number of tokens in definition array
- * @array: source pointer to consecutive vendor arrays to be parsed
- * @priv_size: total size of the consecutive source arrays
- * @sets: number of similar token sets to be parsed, 1 set has count elements
+ * @array: source pointer to consecutive vendor arrays in topology
+ * @array_size: total size of @array
+ * @token_instance_num: number of times the same tokens needs to be parsed i.e. the function
+ * looks for @token_instance_num of each token in the @tokens
* @object_size: offset to next target ipc struct with multiple sets
*
* This function parses multiple sets of tokens in vendor arrays into
* consecutive ipc structs.
*/
static int sof_parse_token_sets(struct snd_soc_component *scomp,
- void *object,
- const struct sof_topology_token *tokens,
- int count,
- struct snd_soc_tplg_vendor_array *array,
- int priv_size, int sets, size_t object_size)
+ void *object, const struct sof_topology_token *tokens,
+ int count, struct snd_soc_tplg_vendor_array *array,
+ int array_size, int token_instance_num, size_t object_size)
{
size_t offset = 0;
int found = 0;
int total = 0;
int asize;
- while (priv_size > 0 && total < count * sets) {
+ while (array_size > 0 && total < count * token_instance_num) {
asize = le32_to_cpu(array->size);
/* validate asize */
@@ -980,8 +979,8 @@ static int sof_parse_token_sets(struct snd_soc_component *scomp,
}
/* make sure there is enough data before parsing */
- priv_size -= asize;
- if (priv_size < 0) {
+ array_size -= asize;
+ if (array_size < 0) {
dev_err(scomp->dev, "error: invalid array size 0x%x\n",
asize);
return -EINVAL;