[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XEN v4 3/3] xen/drivers: ns16550: Fix an incorrect assignment to uart->io_size


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
  • Date: Tue, 24 Jan 2023 12:23:36 +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=xYkmJ/OdKUndVT1CuPr9J8refiPRMUq7ilyeAaA5ma8=; b=YmAgGG+17SjCNW82QeyVPWml+YBWZy3s5jVsy5AtbXIXJZoo3e9X9EhKO3fGOP/fFG3huUInGvor3MgwQ8Mvxzj6UUUDQiq8dpuqleUD+og2T4Rb0BbyeijTuHkgLbyT63c3nIme14UZCkGbnLe9ck4TdfSCgVG8eTKLPNylFUCC4pVbFPaXcdYR7Oy80bp4Udg1/xtdyQrMZ2nuv9wyU5UbGnqQXcWkCOxaKwcoTGReE7iMjvU1lA+1QHLbHyuKZmcxBl6KqnWTRokqDIJ7d4XRqWvzuxoN9DkunAJ2cYwKCecMxHpdY//rsuu67dDisFAkv1XFXa8BzhqWbM0AjQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CqCmN4op8+KBFwNOy5VK+5EJxoGcsCTuQCyakfyh/MehtmCpxTGYE03XuFiq3nzsU7f3z8AmYBc4hfOadY2N0b6AygyuuwGVIkJn6IRVMLmNBKv6ntOYWJH5Aqqz+ZaIY87epZpRuiHYJZO+6GZPYgw3E0Szg0sYMMRiTr+c2ssXVLN1R8b4rq66qmKXztxxtCEWP4azXaw5bfrIOFrabfHnH0yzyPKu/+66kMXmLWmsTI5PrH8DZBmp9L58iISCcs5MCKPBJSPCNFvhvMxEnWA+EqGZdtgt1ASwtabunY3sFX0dxdL3b4l7OcjkUGSOauT6JKtNjkwVxGTB7B8KAQ==
  • 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:25:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

uart->io_size represents the size in bytes. Thus, when serial_port.bit_width
is assigned to it, it should be converted to size in bytes.

Fixes: 17b516196c ("ns16550: add ACPI support for ARM only")
Reported-by: Jan Beulich <jbeulich@xxxxxxxx>
Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---

Changes from -

v1, v2 - NA (New patch introduced in v3).

v3 - Added Reviewed-by and Reported-by tags.

 xen/drivers/char/ns16550.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 43e1f971ab..092f6b9c4b 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1870,7 +1870,7 @@ static int __init ns16550_acpi_uart_init(const void *data)
     uart->parity = spcr->parity;
     uart->stop_bits = spcr->stop_bits;
     uart->io_base = spcr->serial_port.address;
-    uart->io_size = spcr->serial_port.bit_width;
+    uart->io_size = DIV_ROUND_UP(spcr->serial_port.bit_width, BITS_PER_BYTE);
     uart->reg_shift = spcr->serial_port.bit_offset;
     uart->reg_width = spcr->serial_port.access_width;
 
-- 
2.17.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.