From: Mikko Rapeli <mikko.rapeli-X3B1VOXEql0@public.gmane.org>
To: Takashi Iwai <tiwai-l3A5Bk7waGM@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jaroslav Kysela <perex-/Fr2/VpizcU@public.gmane.org>,
alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 18/98] include/uapi/sound/emu10k1.h: added EMU10K1 version of DECLARE_BITMAP etc macros
Date: Tue, 2 Jun 2015 22:08:27 +0300 [thread overview]
Message-ID: <20150602190827.GP12550@lakka.kapsi.fi> (raw)
In-Reply-To: <s5h1thx88tk.wl-tiwai-l3A5Bk7waGM@public.gmane.org>
On Sun, May 31, 2015 at 10:12:07AM +0200, Takashi Iwai wrote:
> At Sun, 31 May 2015 09:18:57 +0200,
> Takashi Iwai wrote:
> >
> > At Sat, 30 May 2015 17:38:10 +0200,
> > Mikko Rapeli wrote:
> > >
> > > 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 <arnd-r2nGTMty4D4@public.gmane.org> in message
> > > <2168807.4Yxh5gl11Q@wuerfel> on lkml.
> > >
> > > Signed-off-by: Mikko Rapeli <mikko.rapeli-X3B1VOXEql0@public.gmane.org>
> > > ---
> > > 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)]
> >
> > This is way too complicated just for a few expansion of the aligned
> > size arrays, IMO. Rather simplify it like below with a comment:
> >
> > /* the array must be aligned to unsigned long (i.e. 4 or 8 bytes) */
> > #define __EMU10K1_DECLARE_BITMAP(name) \
> > unsigned long name[(bits) / sizeof(unsigned long)]
>
> Crap, of course, it must be multiplied with 8.
>
> /* the array must be aligned to unsigned long (i.e. 32 or 64) */
> #define __EMU10K1_DECLARE_BITMAP(name) \
> unsigned long name[(bits) / (sizeof(unsigned long) * 8)]
Thanks, I'll use this definition instead.
-Mikko
next prev parent reply other threads:[~2015-06-02 19:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1433000370-19509-1-git-send-email-mikko.rapeli@iki.fi>
2015-05-30 15:38 ` [PATCH 18/98] include/uapi/sound/emu10k1.h: added EMU10K1 version of DECLARE_BITMAP etc macros Mikko Rapeli
[not found] ` <1433000370-19509-19-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-05-31 7:18 ` Takashi Iwai
[not found] ` <s5h8uc58ba6.wl-tiwai-l3A5Bk7waGM@public.gmane.org>
2015-05-31 8:12 ` Takashi Iwai
[not found] ` <s5h1thx88tk.wl-tiwai-l3A5Bk7waGM@public.gmane.org>
2015-06-02 19:08 ` Mikko Rapeli [this message]
[not found] ` <1433000370-19509-1-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-05-30 15:38 ` [PATCH 30/98] hdspm.h: use __u8, __u32 and __u64 from linux/types.h Mikko Rapeli
[not found] ` <1433000370-19509-31-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2015-05-31 7:11 ` Takashi Iwai
2015-06-02 19:18 ` Mikko Rapeli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150602190827.GP12550@lakka.kapsi.fi \
--to=mikko.rapeli-x3b1voxeql0@public.gmane.org \
--cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=perex-/Fr2/VpizcU@public.gmane.org \
--cc=tiwai-l3A5Bk7waGM@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).