]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ALSA: au1x00: Use resource_size instead of computation
authorBenoit Taine <benoit.taine@lip6.fr>
Wed, 28 May 2014 15:14:06 +0000 (17:14 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 28 May 2014 15:50:57 +0000 (17:50 +0200)
This issue was reported by coccicheck using the semantic patch
at scripts/coccinelle/api/resource_size.cocci

Signed-off-by: Benoit Taine <benoit.taine@lip6.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/mips/au1x00.c

index d10ef7675268c53e7b8276004d2b87bd857d9233..fbcaa5434fd83d325dfe15ffb84451778b29bd6f 100644 (file)
@@ -648,14 +648,14 @@ static int au1000_ac97_probe(struct platform_device *pdev)
                goto out;
 
        err = -EBUSY;
-       au1000->ac97_res_port = request_mem_region(r->start,
-                                       r->end - r->start + 1, pdev->name);
+       au1000->ac97_res_port = request_mem_region(r->start, resource_size(r),
+                                                  pdev->name);
        if (!au1000->ac97_res_port) {
                snd_printk(KERN_ERR "ALSA AC97: can't grab AC97 port\n");
                goto out;
        }
 
-       io = ioremap(r->start, r->end - r->start + 1);
+       io = ioremap(r->start, resource_size(r));
        if (!io)
                goto out;