test: use position offset macro of TLV data

A series of SNDRV_CTL_TLVO_XXX macro was introduced for position offset
of TLV data. This commit applies a code optimization.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Sakamoto 2018-05-15 21:36:39 +09:00 committed by Takashi Iwai
parent 6dc2ed4090
commit 275a438d42

View file

@ -660,7 +660,7 @@ static int check_tlv(struct elem_set_trial *trial)
if (err < 0) if (err < 0)
return err; return err;
len = tlv[1] + sizeof(unsigned int) * 2; len = tlv[SNDRV_CTL_TLVO_LEN] + sizeof(unsigned int) * 2;
curr = malloc(len); curr = malloc(len);
if (curr == NULL) { if (curr == NULL) {
free(tlv); free(tlv);