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

[XEN v1] xen/Arm: Remove the extra assignment


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
  • Date: Thu, 1 Dec 2022 17:31:21 +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=g3iyd5LwACZyzI3z2WmmW03akA0ULGJVFo8bGEQwiv4=; b=jsnzphEVkxrNfu+Qd5owUt6l0CnPB8ouQpTcSx2CL21IHiZMT7j6z9q1ufTjDcV7hpk8Oc7LbbJwpoT7LBtCEEnX11Df3T8OMAR/Wpom0ucBUenHskOeGeWS+RMj5F75SdBANWoU5Ir71iEs82jTEmLZbUsRPmE4zRFhdqVriv/GqI2kBu7phoQNIKaEifTMN1iVQWVUxYZFxqoA8NGpyZhuXyG0tjMrpytFY6iJDuxyyAItzmA8mcRP8wybt/d4tdw8oSGLAbboEf1GRY9hLAssaHIoSYsLJEC1Tjade1j8o4b4bDtWuhCE5MBDFqhbnfs10wMs9iBRy5Gp1HBwuQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KH3kZRyJ2G/aPnPYwVqv3EIygaJCQEwAwcFCxhJW+SUEQS3tXKZW8kqa5zXuab3B8nkBmr2QQGJaHYZ+0pJMWmMbAra7DrBigSDYczIN+oL5xSsT8w89PLEYSZ53JuOsHxmfJW23CAPDIuMUI3A6HnzeaZLgeFB+D6c3sMlplyEMxzKjnuviqAa78uyR4hUEXSA86NnPAG47oWnsAtSCGIPnebUH8vRn/4IwmYMk/EsOvKwEWKXL24F/LdOJiVTheY/DnwiwWvyqzLGGrBFgACfjm48iVpj0E6Zc3t7+GfH2NVcREzLkJsYk6THXAXIiwff7yxIbSP/0XysxVXwphA==
  • Cc: <sstabellini@xxxxxxxxxx>, <stefanos@xxxxxxxxxx>, <julien@xxxxxxx>, <andrew.cooper3@xxxxxxxxxx>, <george.dunlap@xxxxxxxxxx>, <jbeulich@xxxxxxxx>, <wl@xxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
  • Delivery-date: Thu, 01 Dec 2022 17:31:53 +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 (7c1de0038895cbc75ebd0caffc5b0f3f03c5ad51),
"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 (c9f8e0aee507bec25104ca5535fde38efae6c6bc),
"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®.