pcmcia: Use resource_size function on resource object

[ Upstream commit 24a025497e7e883bd2adef5d0ece1e9b9268009f ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Jules Irenge 2024-05-12 23:31:21 +01:00 коммит произвёл Greg Kroah-Hartman
Родитель 0e5a3d5fdf
Коммит 8decfd84e6
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -636,11 +636,11 @@ static int yenta_search_one_res(struct resource *root, struct resource *res,
start = PCIBIOS_MIN_CARDBUS_IO;
end = ~0U;
} else {
unsigned long avail = root->end - root->start;
unsigned long avail = resource_size(root);
int i;
size = BRIDGE_MEM_MAX;
if (size > avail/8) {
size = (avail+1)/8;
if (size > (avail - 1) / 8) {
size = avail / 8;
/* round size down to next power of 2 */
i = 0;
while ((size /= 2) != 0)