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

kernel/resource: iomem_is_exclusive can be boolean

Make iomem_is_exclusive return bool due to this particular function only
using either one or zero as its return value.

No functional change.

Link: http://lkml.kernel.org/r/1513266622-15860-5-git-send-email-baiyaowei@cmss.chinamobile.com
Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Yaowei Bai and committed by
Linus Torvalds
9825b451 77ef80c6

+6 -6
+1 -1
include/linux/ioport.h
··· 265 265 extern void __devm_release_region(struct device *dev, struct resource *parent, 266 266 resource_size_t start, resource_size_t n); 267 267 extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size); 268 - extern int iomem_is_exclusive(u64 addr); 268 + extern bool iomem_is_exclusive(u64 addr); 269 269 270 270 extern int 271 271 walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages,
+5 -5
kernel/resource.c
··· 1563 1563 1564 1564 /* 1565 1565 * check if an address is reserved in the iomem resource tree 1566 - * returns 1 if reserved, 0 if not reserved. 1566 + * returns true if reserved, false if not reserved. 1567 1567 */ 1568 - int iomem_is_exclusive(u64 addr) 1568 + bool iomem_is_exclusive(u64 addr) 1569 1569 { 1570 1570 struct resource *p = &iomem_resource; 1571 - int err = 0; 1571 + bool err = false; 1572 1572 loff_t l; 1573 1573 int size = PAGE_SIZE; 1574 1574 1575 1575 if (!strict_iomem_checks) 1576 - return 0; 1576 + return false; 1577 1577 1578 1578 addr = addr & PAGE_MASK; 1579 1579 ··· 1596 1596 continue; 1597 1597 if (IS_ENABLED(CONFIG_IO_STRICT_DEVMEM) 1598 1598 || p->flags & IORESOURCE_EXCLUSIVE) { 1599 - err = 1; 1599 + err = true; 1600 1600 break; 1601 1601 } 1602 1602 }