From patchwork Sat May 30 15:38:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 6513311 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5DFA0C0020 for ; Sat, 30 May 2015 15:40:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 74612207EA for ; Sat, 30 May 2015 15:40:49 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 1A2D6207E6 for ; Sat, 30 May 2015 15:40:48 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 79B6B260815; Sat, 30 May 2015 17:40:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id AE0E22606C2; Sat, 30 May 2015 17:40:38 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id E090D2606CF; Sat, 30 May 2015 17:40:36 +0200 (CEST) Received: from mail.kapsi.fi (mail.kapsi.fi [217.30.184.167]) by alsa0.perex.cz (Postfix) with ESMTP id 064C4260668 for ; Sat, 30 May 2015 17:40:30 +0200 (CEST) Received: from [2a02:8070:d18d:d800:7c0d:5e59:fd9c:b615] (helo=localhost.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1Yyis6-0001lm-G3; Sat, 30 May 2015 18:40:26 +0300 From: Mikko Rapeli To: linux-kernel@vger.kernel.org Date: Sat, 30 May 2015 17:38:10 +0200 Message-Id: <1433000370-19509-19-git-send-email-mikko.rapeli@iki.fi> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1433000370-19509-1-git-send-email-mikko.rapeli@iki.fi> References: <1433000370-19509-1-git-send-email-mikko.rapeli@iki.fi> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a02:8070:d18d:d800:7c0d:5e59:fd9c:b615 X-SA-Exim-Mail-From: mikko.rapeli@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Cc: Takashi Iwai , Mikko Rapeli , alsa-devel@alsa-project.org, linux-api@vger.kernel.org Subject: [alsa-devel] [PATCH 18/98] include/uapi/sound/emu10k1.h: added EMU10K1 version of DECLARE_BITMAP etc macros X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Fixes userspace compilation error: error: expected specifier-qualifier-list before ‘DECLARE_BITMAP’ DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */ DECLARE_BITMAP etc macros are not meant for userspace headers and thus added here as private copies for emu10k.h. Fix was suggested by Arnd Bergmann in message <2168807.4Yxh5gl11Q@wuerfel> on lkml. Signed-off-by: Mikko Rapeli --- include/uapi/sound/emu10k1.h | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/include/uapi/sound/emu10k1.h b/include/uapi/sound/emu10k1.h index ec1535b..7575f0f 100644 --- a/include/uapi/sound/emu10k1.h +++ b/include/uapi/sound/emu10k1.h @@ -34,6 +34,23 @@ #define EMU10K1_FX8010_PCM_COUNT 8 +/* + * Following definitions are copies from kernel headers to support compiling + * this header file in userspace. The definitions are not generally available + * in uapi headers so the needed things are copied here wtih __EMU10k1 prefix. + */ + +/* From include/linux/bitops.h */ +#define __EMU10K1_BITS_PER_BYTE 8 +/* From include/linux/kernel.h */ +#define __EMU10K1_DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) +/* From include/linux/bitops.h */ +#define __EMU10K1_BITS_TO_LONGS(nr) \ + __EMU10K1_DIV_ROUND_UP(nr, __EMU10K1_BITS_PER_BYTE * sizeof(long)) +/* From include/linux/types.h */ +#define __EMU10K1_DECLARE_BITMAP(name,bits) \ + unsigned long name[__EMU10K1_BITS_TO_LONGS(bits)] + /* instruction set */ #define iMAC0 0x00 /* R = A + (X * Y >> 31) ; saturation */ #define iMAC1 0x01 /* R = A + (-X * Y >> 31) ; saturation */ @@ -300,7 +317,7 @@ struct snd_emu10k1_fx8010_control_old_gpr { struct snd_emu10k1_fx8010_code { char name[128]; - DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */ + __EMU10K1_DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */ __u32 __user *gpr_map; /* initializers */ unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */ @@ -313,11 +330,11 @@ struct snd_emu10k1_fx8010_code { unsigned int gpr_list_control_total; /* total count of GPR controls */ struct snd_emu10k1_fx8010_control_gpr __user *gpr_list_controls; /* listed GPR controls */ - DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */ + __EMU10K1_DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */ __u32 __user *tram_data_map; /* data initializers */ __u32 __user *tram_addr_map; /* map initializers */ - DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */ + __EMU10K1_DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */ __u32 __user *code; /* one instruction - 64 bits */ };