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

[XEN v1 1/9] xen/arm: Remove the extra assignment


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
  • Date: Thu, 15 Dec 2022 19:32:37 +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=4lvaSkI20lY6fb8u8ypyUkJA8QI8c03TjbZy9rbq1Zw=; b=QONe4YKqJ7+hrRpLZMzQPWfo+MRnRZznHuDpf5WkD0fU8FyKPfVyxJyPMzpKSDg14lR0+ENY9c6JdJkYRoy4vnX15NdQbu5oLEQ3sP9z1cqSR7/LUgF355BQ9NRhAYWekCzz7pFZoRo9cd/nuffBq6xUfkoOGN8Bye+WW/7B6ENy1TpkbHqusvD1+SPo6Nrv7FwaQ6fVRfXDfttpL/B6bSR96OPaThVjFtatUwgRqVBJLwQynTxMPA1NTxxrFrTgOqsAnCVjaPDML0YVN9pzMhxD4enSYyuV81TnKXYHJ9+LYHhNTtNhO4gYPoLm3FkP7MiFRs31hBS3N7zMLKeRDg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MB72qYGX0z8zAK5BKc6lYzbOauNVyB4HLwaWHkrWI4sP5zQqYcAqrr2G6QpXdbCw8QQcK11+JLIYIVLht5S4qFvZXwcBT/LSKyHA7QYAIgJ/kH+4XTH4jLyC3KTgf59lkY6N9Xyt5d34XuKvzZw+olesWJN9pu1Agdt0w/HkFodzSDdQPLNeSjzi1Z5upIAlqVRu8nD3u7GG0cbHy7DsUehYyADngQWnI4qvd0am/T2rFY+wK8UVo4SqBzL+ASWCE0oF5AUR6VR/Fepqez0euPFSKm6hQUOWJJKHozIOgn88CubBlqXuwPfhO6kLgxnSve9hDLG+HEEZb+6MCVgIdw==
  • Cc: <sstabellini@xxxxxxxxxx>, <stefano.stabellini@xxxxxxx>, <julien@xxxxxxx>, <Volodymyr_Babchuk@xxxxxxxx>, <bertrand.marquis@xxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
  • Delivery-date: Thu, 15 Dec 2022 19:33:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

As "io_size" and "uart->io_size" are both u64, so there will be no truncation.
Thus, one can remove the ASSERT() and extra assignment.

In an earlier commit (7c1de0038895),
"ns16550.io_size" was u32 and "io_size" was u64. Thus, the ASSERT() was needed
to check if the values are the same.
However, in a later commit (c9f8e0aee507),
"ns16550.io_size" was changed to u64. Thus, the ASSERT() became redundant.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
---

 xen/drivers/char/ns16550.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 01a05c9aa8..58d0ccd889 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -1747,7 +1747,6 @@ static int __init ns16550_uart_dt_init(struct 
dt_device_node *dev,
     struct ns16550 *uart;
     int res;
     u32 reg_shift, reg_width;
-    u64 io_size;
 
     uart = &ns16550_com[0];
 
@@ -1758,14 +1757,10 @@ static int __init ns16550_uart_dt_init(struct 
dt_device_node *dev,
     uart->parity    = UART_PARITY_NONE;
     uart->stop_bits = 1;
 
-    res = dt_device_get_address(dev, 0, &uart->io_base, &io_size);
+    res = dt_device_get_address(dev, 0, &uart->io_base, &uart->io_size);
     if ( res )
         return res;
 
-    uart->io_size = io_size;
-
-    ASSERT(uart->io_size == io_size); /* Detect truncation */
-
     res = dt_property_read_u32(dev, "reg-shift", &reg_shift);
     if ( !res )
         uart->reg_shift = 0;
-- 
2.17.1




 


Rackspace

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