From 275a438d425c3477be21e1929061f0c1605876f2 Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Tue, 15 May 2018 21:36:39 +0900 Subject: [PATCH] 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 --- test/user-ctl-element-set.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.47.1