]> xenbits.xensource.com Git - xen.git/commitdiff
ns16550: fix the use of simple_strtoul() for parsing u64
authorAyan Kumar Halder <ayan.kumar.halder@amd.com>
Tue, 24 Jan 2023 15:53:13 +0000 (16:53 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 24 Jan 2023 15:53:13 +0000 (16:53 +0100)
One should be using simple_strtoull() ( instead of simple_strtoul() )
to assign value to 'u64' variable. The reason being u64 can be
represented by 'unsigned long long' on all the platforms (ie Arm32,
Arm64 and x86).

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/char/ns16550.c

index 01a05c9aa859a76354ef14c7f196347609bd1913..7e22e687fbf580aefd6e06a2de3f98185b705b36 100644 (file)
@@ -1532,7 +1532,7 @@ static bool __init parse_positional(struct ns16550 *uart, char **str)
         else
 #endif
         {
-            uart->io_base = simple_strtoul(conf, &conf, 0);
+            uart->io_base = simple_strtoull(conf, &conf, 0);
         }
     }
 
@@ -1603,7 +1603,7 @@ static bool __init parse_namevalue_pairs(char *str, struct ns16550 *uart)
                        "Can't use io_base with dev=pci or dev=amt options\n");
                 break;
             }
-            uart->io_base = simple_strtoul(param_value, NULL, 0);
+            uart->io_base = simple_strtoull(param_value, NULL, 0);
             break;
 
         case irq: