diff options
author | Jaroslav Kysela <perex@perex.cz> | 2008-06-26 02:51:31 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-06-26 02:53:05 -0400 |
commit | eabe3228a80728a21f871ccc86c72c170ca1a2dc (patch) | |
tree | 60bdd85120b507f163471604b14de693a6eb7d2a /include/sound/asound.h | |
parent | a1855d802fb62718192eb7e180161b08adff4e73 (diff) |
[ALSA] Revert "alsa: add annotations to bitwise type snd_pcm_hw_param_t"
This reverts commit 36b34d2437104f323e09d7c6af6451d3c0b9c0cd.
From: Al Viro <viro@ZenIV.linux.org.uk>
WIW, *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.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'include/sound/asound.h')
-rw-r--r-- | include/sound/asound.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/include/sound/asound.h b/include/sound/asound.h index 0309da2f11d3..3eaf155b850d 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h | |||
@@ -302,8 +302,6 @@ typedef int __bitwise snd_pcm_hw_param_t; | |||
302 | #define SNDRV_PCM_HW_PARAM_SUBFORMAT ((__force snd_pcm_hw_param_t) 2) /* Subformat */ | 302 | #define SNDRV_PCM_HW_PARAM_SUBFORMAT ((__force snd_pcm_hw_param_t) 2) /* Subformat */ |
303 | #define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS | 303 | #define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS |
304 | #define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT | 304 | #define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT |
305 | #define SNDRV_PCM_HW_PARAM_MASK_INDEX(var) \ | ||
306 | ((__force int)(var) - (__force int)SNDRV_PCM_HW_PARAM_FIRST_MASK) | ||
307 | 305 | ||
308 | #define SNDRV_PCM_HW_PARAM_SAMPLE_BITS ((__force snd_pcm_hw_param_t) 8) /* Bits per sample */ | 306 | #define SNDRV_PCM_HW_PARAM_SAMPLE_BITS ((__force snd_pcm_hw_param_t) 8) /* Bits per sample */ |
309 | #define SNDRV_PCM_HW_PARAM_FRAME_BITS ((__force snd_pcm_hw_param_t) 9) /* Bits per frame */ | 307 | #define SNDRV_PCM_HW_PARAM_FRAME_BITS ((__force snd_pcm_hw_param_t) 9) /* Bits per frame */ |
@@ -319,8 +317,6 @@ typedef int __bitwise snd_pcm_hw_param_t; | |||
319 | #define SNDRV_PCM_HW_PARAM_TICK_TIME ((__force snd_pcm_hw_param_t) 19) /* Approx tick duration in us */ | 317 | #define SNDRV_PCM_HW_PARAM_TICK_TIME ((__force snd_pcm_hw_param_t) 19) /* Approx tick duration in us */ |
320 | #define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS | 318 | #define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS |
321 | #define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME | 319 | #define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME |
322 | #define SNDRV_PCM_HW_PARAM_INTERVAL_INDEX(var) \ | ||
323 | ((__force int)(var) - (__force int)SNDRV_PCM_HW_PARAM_FIRST_INTERVAL) | ||
324 | 320 | ||
325 | #define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */ | 321 | #define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */ |
326 | 322 | ||
@@ -340,11 +336,11 @@ struct snd_mask { | |||
340 | 336 | ||
341 | struct snd_pcm_hw_params { | 337 | struct snd_pcm_hw_params { |
342 | unsigned int flags; | 338 | unsigned int flags; |
343 | struct snd_mask masks[ | 339 | struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - |
344 | SNDRV_PCM_HW_PARAM_MASK_INDEX(SNDRV_PCM_HW_PARAM_LAST_MASK) + 1]; | 340 | SNDRV_PCM_HW_PARAM_FIRST_MASK + 1]; |
345 | struct snd_mask mres[5]; /* reserved masks */ | 341 | struct snd_mask mres[5]; /* reserved masks */ |
346 | struct snd_interval intervals[ | 342 | struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - |
347 | SNDRV_PCM_HW_PARAM_INTERVAL_INDEX(SNDRV_PCM_HW_PARAM_LAST_INTERVAL) + 1]; | 343 | SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1]; |
348 | struct snd_interval ires[9]; /* reserved intervals */ | 344 | struct snd_interval ires[9]; /* reserved intervals */ |
349 | unsigned int rmask; /* W: requested masks */ | 345 | unsigned int rmask; /* W: requested masks */ |
350 | unsigned int cmask; /* R: changed masks */ | 346 | unsigned int cmask; /* R: changed masks */ |