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

mfd: asic3: use resource_size macro instead of local variable

This should make the code a little bit easier to read.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

authored by

Philipp Zabel and committed by
Samuel Ortiz
be584bd5 01906d6d

+2 -4
+2 -4
drivers/mfd/asic3.c
··· 623 623 struct asic3 *asic; 624 624 struct resource *mem; 625 625 unsigned long clksel; 626 - int map_size; 627 626 int ret = 0; 628 627 629 628 asic = kzalloc(sizeof(struct asic3), GFP_KERNEL); ··· 642 643 goto out_free; 643 644 } 644 645 645 - map_size = mem->end - mem->start + 1; 646 - asic->mapping = ioremap(mem->start, map_size); 646 + asic->mapping = ioremap(mem->start, resource_size(mem)); 647 647 if (!asic->mapping) { 648 648 ret = -ENOMEM; 649 649 dev_err(asic->dev, "Couldn't ioremap\n"); ··· 652 654 asic->irq_base = pdata->irq_base; 653 655 654 656 /* calculate bus shift from mem resource */ 655 - asic->bus_shift = 2 - (map_size >> 12); 657 + asic->bus_shift = 2 - (resource_size(mem) >> 12); 656 658 657 659 clksel = 0; 658 660 asic3_write_register(asic, ASIC3_OFFSET(CLOCK, SEL), clksel);