mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-23 12:14:10 +08:00
pcmcia: Use resource_size function on resource object
Cocinnele reports a warning WARNING: Suspicious code. resource_size is maybe missing with root The root cause is the function resource_size is not used when needed Use resource_size() on variable "root" of type resource Signed-off-by: Jules Irenge <jbi.octave@gmail.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This commit is contained in:
parent
02d5150332
commit
24a025497e
@ -638,11 +638,11 @@ static int yenta_search_one_res(struct resource *root, struct resource *res,
|
|||||||
start = PCIBIOS_MIN_CARDBUS_IO;
|
start = PCIBIOS_MIN_CARDBUS_IO;
|
||||||
end = ~0U;
|
end = ~0U;
|
||||||
} else {
|
} else {
|
||||||
unsigned long avail = root->end - root->start;
|
unsigned long avail = resource_size(root);
|
||||||
int i;
|
int i;
|
||||||
size = BRIDGE_MEM_MAX;
|
size = BRIDGE_MEM_MAX;
|
||||||
if (size > avail/8) {
|
if (size > (avail - 1) / 8) {
|
||||||
size = (avail+1)/8;
|
size = avail / 8;
|
||||||
/* round size down to next power of 2 */
|
/* round size down to next power of 2 */
|
||||||
i = 0;
|
i = 0;
|
||||||
while ((size /= 2) != 0)
|
while ((size /= 2) != 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user