diff options
author | Yaowei Bai <baiyaowei@cmss.chinamobile.com> | 2018-02-06 18:41:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-06 21:32:47 -0500 |
commit | 9825b451f95a74b33c65069106fc5a6bb8e33aa9 (patch) | |
tree | 61b0d797494a2c12303a91baed81dfa6b0ad85ce | |
parent | 77ef80c65ab72e57cfc273b2dd1d48a282b75146 (diff) |
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>
-rw-r--r-- | include/linux/ioport.h | 2 | ||||
-rw-r--r-- | kernel/resource.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 93b4183cf53d..da0ebaec25f0 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -265,7 +265,7 @@ extern struct resource * __devm_request_region(struct device *dev, | |||
265 | extern void __devm_release_region(struct device *dev, struct resource *parent, | 265 | extern void __devm_release_region(struct device *dev, struct resource *parent, |
266 | resource_size_t start, resource_size_t n); | 266 | resource_size_t start, resource_size_t n); |
267 | extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size); | 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 | extern int | 270 | extern int |
271 | walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages, | 271 | walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages, |
diff --git a/kernel/resource.c b/kernel/resource.c index 54ba6de3757c..a269b9a1e834 100644 --- a/kernel/resource.c +++ b/kernel/resource.c | |||
@@ -1563,17 +1563,17 @@ static int strict_iomem_checks; | |||
1563 | 1563 | ||
1564 | /* | 1564 | /* |
1565 | * check if an address is reserved in the iomem resource tree | 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 | struct resource *p = &iomem_resource; | 1570 | struct resource *p = &iomem_resource; |
1571 | int err = 0; | 1571 | bool err = false; |
1572 | loff_t l; | 1572 | loff_t l; |
1573 | int size = PAGE_SIZE; | 1573 | int size = PAGE_SIZE; |
1574 | 1574 | ||
1575 | if (!strict_iomem_checks) | 1575 | if (!strict_iomem_checks) |
1576 | return 0; | 1576 | return false; |
1577 | 1577 | ||
1578 | addr = addr & PAGE_MASK; | 1578 | addr = addr & PAGE_MASK; |
1579 | 1579 | ||
@@ -1596,7 +1596,7 @@ int iomem_is_exclusive(u64 addr) | |||
1596 | continue; | 1596 | continue; |
1597 | if (IS_ENABLED(CONFIG_IO_STRICT_DEVMEM) | 1597 | if (IS_ENABLED(CONFIG_IO_STRICT_DEVMEM) |
1598 | || p->flags & IORESOURCE_EXCLUSIVE) { | 1598 | || p->flags & IORESOURCE_EXCLUSIVE) { |
1599 | err = 1; | 1599 | err = true; |
1600 | break; | 1600 | break; |
1601 | } | 1601 | } |
1602 | } | 1602 | } |