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

[XEN v3 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: Mon, 23 Jan 2023 13:44:51 +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=5mGRDEaxCT5Vc+hDapbIEiqvewhZapa+H6B636bxP5M=; b=MQnajVYMRuobPs107ohVlA1ehJRqh9Zyskmfs241nUvp5tpvhVB6WitBaw24fYCKCn38qZ/f8cSGAuCTtkerWBwuFkKhILUuqicWklTnTu4qYw6lbLeFOTd3PIQyXBCClAaJ2ZeoPxtojZEQiber9IaJnd3Vm3OWYOfdKtpAlqqUvr3O6EHaewal1s6/gWFx9pds3k4dsH7i/csOlNhpUBkOTL3Ow4tBZtntUHF3Wu9rBcIlxsuUziv2mRwohZpx9A463NbT9FXe6FEsRvJmk5B3IY1juqQh6IkPGjN2Vn3eO4VlXTib2D3xJVytrqsV5CAywMdcghw2GRVTjDbrnw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xlsf/ickAFk41BuHISbEuDiI2PDrdGvCfr7EJZyOLXESECohAQPhZTWAE+agYQu90QP9ZRV5XjzN+tRCtK61MwLToI2sy4mz8nPx2FlesQ6+BjR5z9PV1KiYQbPkFpb/DlzHYuzXFu6F41wY4/fxRr1lSiefTignbhWZL4mZUGDpEXReNUY8i2DMC0z1AUMjpG/LI0ZrFbtdKm2MfS1AzlzaNd4zsX5CZrRRt8o90sye0chIVbNkSWYs2Ei9QkK/Lhzjffs15/sVDiDLO3m3FGjxCGQXlbe/RL0HEOyR7AnamigT70joLZMYwrH6MbAdj+PyEOGsVOdEuBC9rIjniQ==
  • 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:48 +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: 17b516196c55 ("ns16550: add ACPI support for ARM only")
Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
---

Changes from -

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

 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®.