[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[XEN v4 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: Tue, 24 Jan 2023 12:23:35 +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=TwJ1LfxOnpXeWIA1K07X5XJHKcSKQkZLrmyDBfROR78=; b=EBvOLbbmAZQ1bbqTGm01RAJ6zZlvgdtM1gFEAL8NZAhnP2ol6fDxVz0vt9togQFRMXuVn2n48rr65rXVc28RhZjhfy22s6CGz5sF05mWZlnFj9LGmuEr2b5ZY8kc5zySplbggBwF/7XNqDRuZ/cFBsc7zhctkj7pEbDg0kWLORL8wUWKA43HwOU2XvqbbMLxKBMn9XH/XyI4/uWBvJTBCOG2bYCY+bWBJKIFovbv20Bp/oJg571VTKg869ftq8muEWE0KgSZu3m+IYk9poU9ZeYsfwNrLownVez9j9a10JKAP/txZaibsuACww2M6/nI48pRFQMEul22qt2KoYeFFQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OU6X2r2k6ruapGOXDaflot9dt5fmXaJfkmPnOAyAzIOPB/TVhb6nlBoHp3/fYc0fXkrTKyWIqmqKNKR0/ggGKmoEaUbVjUEJ8E8Iub6Ak6TjzgAE39PRuKp0Xtnj3F/Kv0j4JNkdkWaoJbfc0jxGtT1DBMlO6iVZFEQkgCpysp4ArjcLYqJq9t0zkq010EGRcrbEKV39wP9vEZI/WcR6JJ9CkJDy8++9tGmghMX0ZWHhy/nrNovm33MgaNwi4nnLbK/g6u1d7Ol6o79dvrVpo2gzrD0C/bla78JIWzDz+FKdphqw6uY5+kMe/aHNffeHJ8qB1r/gV71q6CN/7obTmA==
- 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: Tue, 24 Jan 2023 12:24:59 +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).
Suggested-by: Jan Beulich <jbeulich@xxxxxxxx>
Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
Changes from -
v1, v2 - NA (New patch introduced in v3).
v3 - Added Suggested-by and Reviewed-by tags.
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
|