Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966529AbcCPINd (ORCPT ); Wed, 16 Mar 2016 04:13:33 -0400 Received: from mail.kernel.org ([198.145.29.136]:60849 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966520AbcCPINY (ORCPT ); Wed, 16 Mar 2016 04:13:24 -0400 From: lizf@kernel.org To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Clemens Ladisch , Takashi Iwai , Zefan Li Subject: [PATCH 3.4 103/107] ALSA: tlv: add DECLARE_TLV_DB_RANGE() Date: Wed, 16 Mar 2016 16:06:37 +0800 Message-Id: <1458115601-5762-103-git-send-email-lizf@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1458115541-5712-1-git-send-email-lizf@kernel.org> References: <1458115541-5712-1-git-send-email-lizf@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1154 Lines: 37 From: Clemens Ladisch 3.4.111-rc1 review patch. If anyone has any objections, please let me know. ------------------ commit bf1d1c9b6179faa3bc32cee882462bc8eebde25d upstream. Add a DECLARE_TLV_DB_RANGE() macro so that dB range information can be specified without having to count the items manually for TLV_DB_RANGE_HEAD(). Signed-off-by: Clemens Ladisch Signed-off-by: Takashi Iwai Signed-off-by: Zefan Li --- include/sound/tlv.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/sound/tlv.h b/include/sound/tlv.h index 137d165..49e7bd6 100644 --- a/include/sound/tlv.h +++ b/include/sound/tlv.h @@ -71,6 +71,10 @@ /* dB range container */ /* Each item is: */ +#define TLV_DB_RANGE_ITEM(...) \ + TLV_ITEM(SNDRV_CTL_TLVT_DB_RANGE, __VA_ARGS__) +#define DECLARE_TLV_DB_RANGE(name, ...) \ + unsigned int name[] = { TLV_DB_RANGE_ITEM(__VA_ARGS__) } /* The below assumes that each item TLV is 4 words like DB_SCALE or LINEAR */ #define TLV_DB_RANGE_HEAD(num) \ SNDRV_CTL_TLVT_DB_RANGE, 6 * (num) * sizeof(unsigned int) -- 1.9.1