From: Takashi Sakamoto Date: Tue, 15 May 2018 12:36:39 +0000 (+0900) Subject: test: use position offset macro of TLV data X-Git-Tag: v1.1.7~34 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=275a438d425c3477be21e1929061f0c1605876f2;p=alsa-lib.git 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 Signed-off-by: Takashi Iwai --- diff --git a/test/user-ctl-element-set.c b/test/user-ctl-element-set.c index e94152b9..fee130e2 100644 --- a/test/user-ctl-element-set.c +++ b/test/user-ctl-element-set.c @@ -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);