summaryrefslogtreecommitdiff
path: root/sound/core/device.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2011-02-14 11:00:47 +0100
committerTakashi Iwai <tiwai@suse.de>2011-02-14 17:10:11 +0100
commitfea952e5cc23ea94b4677ca20774cdc3cea014e2 (patch)
tree0a5fac1e830e7f5eba9d52431088b1481c86eeb8 /sound/core/device.c
parent88b27fdac814c4926175ff0e740f98343ad77491 (diff)
ALSA: core: sparse cleanups
Change the core code where sparse complains. In most cases, this means just adding annotations to confirm that we indeed want to do the dirty things we're doing. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/device.c')
-rw-r--r--sound/core/device.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/core/device.c b/sound/core/device.c
index a67dfac08c03..2d1ad4b0cd65 100644
--- a/sound/core/device.c
+++ b/sound/core/device.c
@@ -225,15 +225,16 @@ int snd_device_free_all(struct snd_card *card, snd_device_cmd_t cmd)
{
struct snd_device *dev;
int err;
- unsigned int range_low, range_high;
+ unsigned int range_low, range_high, type;
if (snd_BUG_ON(!card))
return -ENXIO;
- range_low = cmd * SNDRV_DEV_TYPE_RANGE_SIZE;
+ range_low = (__force unsigned int)cmd * SNDRV_DEV_TYPE_RANGE_SIZE;
range_high = range_low + SNDRV_DEV_TYPE_RANGE_SIZE - 1;
__again:
list_for_each_entry(dev, &card->devices, list) {
- if (dev->type >= range_low && dev->type <= range_high) {
+ type = (__force unsigned int)dev->type;
+ if (type >= range_low && type <= range_high) {
if ((err = snd_device_free(card, dev->device_data)) < 0)
return err;
goto __again;