]> git.alsa-project.org Git - alsa-lib.git/commitdiff
test: use position offset macro of TLV data
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Tue, 15 May 2018 12:36:39 +0000 (21:36 +0900)
committerTakashi Iwai <tiwai@suse.de>
Tue, 15 May 2018 16:03:13 +0000 (18:03 +0200)
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>
test/user-ctl-element-set.c

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