Commit 6991cd74 authored by Vincent Whitchurch's avatar Vincent Whitchurch Committed by Rob Herring
Browse files

of: reserved-memory: Print allocation/reservation failures as error



If the allocation/reservation of reserved-memory fails, it is normally
an error, so print it as an error so that it doesn't get hidden from the
console due to the loglevel.  Also make the allocation failure include
the size just like the reservation failure.

Signed-off-by: default avatarVincent Whitchurch <vincent.whitchurch@axis.com>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220628113540.2790835-1-vincent.whitchurch@axis.com
parent 3a5230a8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -532,7 +532,7 @@ static int __init __reserved_mem_reserve_reg(unsigned long node,
				kmemleak_alloc_phys(base, size, 0, 0);
		}
		else
			pr_info("Reserved memory: failed to reserve memory for node '%s': base %pa, size %lu MiB\n",
			pr_err("Reserved memory: failed to reserve memory for node '%s': base %pa, size %lu MiB\n",
			       uname, &base, (unsigned long)(size / SZ_1M));

		len -= t_len;
+2 −1
Original line number Diff line number Diff line
@@ -156,7 +156,8 @@ static int __init __reserved_mem_alloc_size(unsigned long node,
	}

	if (base == 0) {
		pr_info("failed to allocate memory for node '%s'\n", uname);
		pr_err("failed to allocate memory for node '%s': size %lu MiB\n",
		       uname, (unsigned long)(size / SZ_1M));
		return -ENOMEM;
	}