[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[XEN v3 2/3] xen/drivers: ns16550: Fix the use of simple_strtoul() for extracting u64
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
- Date: Mon, 23 Jan 2023 13:44:50 +0000
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3fI/wStOnID0RkF6ajH6XFxYRunB4UiMDznXWTD+pWQ=; b=UXi5BJxp9CmqubORI+ztYHG6K33gKZHYy8GycNgfw1+lsDFw7jqBrpZyBQ7HgwLy8nL32CGC9GwSvZ2HfMUVsm275N3JAYdFl7lnhWlKaWQw1ZeojHxb6Ev2IQuS59YY0ilSimgB7HA5AD/vN8xpC2D8lTUhCvXXxkHHlYok1ZxaPOPgKUZ0KfMYKMMIXKiJkJBlp0ZWaosHuh2uumaH43UlXw5zDfcVCnzoemqminfPEGvwbgW+JoCKX5qeQoNgVJRP6MZSgjt8olWTeUlJLcq2HqC2fs5w5hGX+PrEgTCTGLZf/HmeNGECGC23p9Oh3C7WmH60I18gdT7PnFHTDQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hRDlrAhffOntDHJMDIhIPuT6F6ruXQGdXeHnPi8xsjJlg1wOtrmS2VFS4gGefzhRITCcbHDiWdTEmiL1InLF93+7cRSImHXfRifgmfoQd1xlTy4JwdAdAVdUVuo1t0IEEJmYGBUvRz0ba7eF3ZC7L2wvmrttL0EmXN1SLlXQXuXfsaxq0xRtokjAOrniv70nneyAGY7PG8dXSHxysYWv8gB3VU9MPBe84LZ9oiln4y9b1QkvUqowTgc3nhIhc2Ert+ozGI2Xi2DH0R6oWOu4rjiaiqdkf3diU08hzb89WFWaGU36YmxbF0FK1n9nj/gNPsqMO8RSTYwbVM5rV2CLIQ==
- Cc: <sstabellini@xxxxxxxxxx>, <stefano.stabellini@xxxxxxx>, <julien@xxxxxxx>, <Volodymyr_Babchuk@xxxxxxxx>, <bertrand.marquis@xxxxxxx>, <andrew.cooper3@xxxxxxxxxx>, <george.dunlap@xxxxxxxxxx>, <jbeulich@xxxxxxxx>, <wl@xxxxxxx>, <xuwei5@xxxxxxxxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
- Delivery-date: Mon, 23 Jan 2023 13:45:38 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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).
Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
---
Changes from -
v1,v2 - NA (This patch is introduced in v3).
xen/drivers/char/ns16550.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 58d0ccd889..43e1f971ab 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -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:
--
2.17.1
|