Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: au1x00: Use resource_size instead of computation

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>

authored by

Benoit Taine and committed by
Takashi Iwai
82285f25 a58bdba7

+3 -3
+3 -3
sound/mips/au1x00.c
··· 648 648 goto out; 649 649 650 650 err = -EBUSY; 651 - au1000->ac97_res_port = request_mem_region(r->start, 652 - r->end - r->start + 1, pdev->name); 651 + au1000->ac97_res_port = request_mem_region(r->start, resource_size(r), 652 + pdev->name); 653 653 if (!au1000->ac97_res_port) { 654 654 snd_printk(KERN_ERR "ALSA AC97: can't grab AC97 port\n"); 655 655 goto out; 656 656 } 657 657 658 - io = ioremap(r->start, r->end - r->start + 1); 658 + io = ioremap(r->start, resource_size(r)); 659 659 if (!io) 660 660 goto out; 661 661