From: Al Viro <viro@ZenIV.linux.org.uk>
To: Harvey Harrison <harvey.harrison@gmail.com>
Cc: alsa-devel@alsa-project.org, Alexander Viro <viro@ftp.linux.org.uk>
Subject: Re: [PATCH] alsa: add annotations to bitwise type snd_pcm_hw_param_t
Date: Sun, 22 Jun 2008 08:50:40 +0100 [thread overview]
Message-ID: <20080622075040.GR28946@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1213821913.2125.21.camel@brick>
On Wed, Jun 18, 2008 at 01:45:13PM -0700, Harvey Harrison wrote:
> Fully half of all alsa sparse warnings are from snd_pcm_hw_param_t degrading
> to integer type, this goes a long way towards eliminating them.
FWIW, *all* this stuff is not bitwise at all. For crying out loud, half
of these types are routinely used as array indices and loop variables...
If anything, we want a different set of allowed operations - subtraction
between elements of type (yielding integer), addition/subtraction of
integer types not bigger than ours (yielding our type), comparisons,
assignments (=, +=, -=, passing to function as argument, return from
function, initializers) and second/third arguments in ?:. With 0 *not*
being allowed as a constant of such type.
It's not bitwise; we may use the same infrastructure in sparse, but it
should be a separate class of types (__attribute__((affine))).
dma_addr_t is another candidate for the same treatment, but there we'll
need helpers for conversions to hw-acceptable form (dma_to_le32(), etc.)
and gradual conversion of drivers.
ALSA ones and pm mess are absolutely straightforward cases, though.
prev parent reply other threads:[~2008-06-22 7:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-18 20:45 [PATCH] alsa: add annotations to bitwise type snd_pcm_hw_param_t Harvey Harrison
2008-06-19 8:34 ` Jaroslav Kysela
2008-06-19 9:21 ` Takashi Iwai
2008-06-22 7:50 ` Al Viro [this message]
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=20080622075040.GR28946@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=alsa-devel@alsa-project.org \
--cc=harvey.harrison@gmail.com \
--cc=viro@ftp.linux.org.uk \
/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