[v3,2/2] resource: Make it possible to reserve memory on 64bit platform
diff mbox series

Message ID 1611330937-22654-3-git-send-email-zhaowei1102@thundersoft.com
State New, archived
Headers show
Series
  • Make it possible to reserve memory on 64bit platform
Related show

Commit Message

Wesley Zhao Jan. 22, 2021, 3:55 p.m. UTC
For now "reserve=" is limitied to 32bit,not available on 64bit
platform,so we change the get_option() to get_option_ull(added in
patch: commit 4b6bfe96265e ("lib/cmdline: add new function
get_option_ull()"))

Signed-off-by: Wesley Zhao <zhaowei1102@thundersoft.com>
---
 kernel/resource.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Andy Shevchenko Jan. 22, 2021, 4:31 p.m. UTC | #1
On Fri, Jan 22, 2021 at 07:55:37AM -0800, Wesley Zhao wrote:
> For now "reserve=" is limitied to 32bit,not available on 64bit
> platform,so we change the get_option() to get_option_ull(added in
> patch: commit 4b6bfe96265e ("lib/cmdline: add new function
> get_option_ull()"))

Do better grammar and punctuation.

"For now "reserve=" is limited to 32bit, and not available on 64bit platform,
so we change the get_option() to get_option_ull() which is added in the
previous patch."

But!

You don't need to alter cmdline.c at all, see memparse() for the details!
And you have been told already, look at other options. You failed to mentioned
in the cover letter what's wrong with recommended memmap= approach.

Patch
diff mbox series

diff --git a/kernel/resource.c b/kernel/resource.c
index 833394f9c608..ee2a0e5d196f 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -1567,13 +1567,13 @@  static int __init reserve_setup(char *str)
 	static struct resource reserve[MAXRESERVE];
 
 	for (;;) {
-		unsigned int io_start, io_num;
+		unsigned long long io_start, io_num;
 		int x = reserved;
 		struct resource *parent;
 
-		if (get_option(&str, &io_start) != 2)
+		if (get_option_ull(&str, &io_start) != 2)
 			break;
-		if (get_option(&str, &io_num) == 0)
+		if (get_option_ull(&str, &io_num) == 0)
 			break;
 		if (x < MAXRESERVE) {
 			struct resource *res = reserve + x;