[alsa-lib][PATCH 3/6] hcontrol: use position offset macro of TLV data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
---
 src/control/hcontrol.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/control/hcontrol.c b/src/control/hcontrol.c
index 7e775248..0cac8956 100644
--- a/src/control/hcontrol.c
+++ b/src/control/hcontrol.c
@@ -870,7 +870,7 @@ int snd_hctl_elem_tlv_write(snd_hctl_elem_t *elem, const unsigned int *tlv)
 {
 	assert(elem);
 	assert(tlv);
-	assert(tlv[1] >= 4);
+	assert(tlv[SNDRV_CTL_TLVO_LEN] >= 4);
 	return snd_ctl_elem_tlv_write(elem->hctl->ctl, &elem->id, tlv);
 }
 
@@ -886,7 +886,7 @@ int snd_hctl_elem_tlv_command(snd_hctl_elem_t *elem, const unsigned int *tlv)
 {
 	assert(elem);
 	assert(tlv);
-	assert(tlv[1] >= 4);
+	assert(tlv[SNDRV_CTL_TLVO_LEN] >= 4);
 	return snd_ctl_elem_tlv_command(elem->hctl->ctl, &elem->id, tlv);
 }
 
-- 
2.14.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux