arch/x86/kernel/e820.c:88:9-10: WARNING: return of 0/1 in function '_e820__mapped_any' with return type bool
From: kbuild test robot
Date: Wed Jun 26 2019 - 22:53:46 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 249155c20f9b0754bc1b932a33344cfb4e0c2101
commit: 0c55671f84fffe591e8435c93a8c83286fd6b8eb kvm, x86: Properly check whether a pfn is an MMIO or not
date: 8 weeks ago
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>
coccinelle warnings: (new ones prefixed by >>)
>> arch/x86/kernel/e820.c:88:9-10: WARNING: return of 0/1 in function '_e820__mapped_any' with return type bool
vim +/_e820__mapped_any +88 arch/x86/kernel/e820.c
b79cd8f1 Yinghai Lu 2008-05-11 71
b79cd8f1 Yinghai Lu 2008-05-11 72 /*
b79cd8f1 Yinghai Lu 2008-05-11 73 * This function checks if any part of the range <start,end> is mapped
b79cd8f1 Yinghai Lu 2008-05-11 74 * with type.
b79cd8f1 Yinghai Lu 2008-05-11 75 */
0c55671f KarimAllah Ahmed 2019-01-31 76 static bool _e820__mapped_any(struct e820_table *table,
0c55671f KarimAllah Ahmed 2019-01-31 77 u64 start, u64 end, enum e820_type type)
b79cd8f1 Yinghai Lu 2008-05-11 78 {
b79cd8f1 Yinghai Lu 2008-05-11 79 int i;
b79cd8f1 Yinghai Lu 2008-05-11 80
0c55671f KarimAllah Ahmed 2019-01-31 81 for (i = 0; i < table->nr_entries; i++) {
0c55671f KarimAllah Ahmed 2019-01-31 82 struct e820_entry *entry = &table->entries[i];
b79cd8f1 Yinghai Lu 2008-05-11 83
e5540f87 Ingo Molnar 2017-01-28 84 if (type && entry->type != type)
b79cd8f1 Yinghai Lu 2008-05-11 85 continue;
e5540f87 Ingo Molnar 2017-01-28 86 if (entry->addr >= end || entry->addr + entry->size <= start)
b79cd8f1 Yinghai Lu 2008-05-11 87 continue;
b79cd8f1 Yinghai Lu 2008-05-11 @88 return 1;
b79cd8f1 Yinghai Lu 2008-05-11 89 }
b79cd8f1 Yinghai Lu 2008-05-11 90 return 0;
b79cd8f1 Yinghai Lu 2008-05-11 91 }
0c55671f KarimAllah Ahmed 2019-01-31 92
:::::: The code at line 88 was first introduced by commit
:::::: b79cd8f1268bab57ff85b19d131f7f23deab2dee x86: make e820.c to have common functions
:::::: TO: Yinghai Lu <yhlu.kernel@xxxxxxxxx>
:::::: CC: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation