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

[PATCH] hypfs: remove unreachable statement in the 'hypfs_get_entry_rel()'


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>
  • Date: Thu, 9 Apr 2026 15:55:48 +0000
  • Accept-language: en-US, uk-UA, ru-RU
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=gYFqiYL2RWaSj5UTs0yxhxZbv/2e+rgrJDmULLs0AUs=; b=FhaXJnZGsWeVyN/9fHL/BrJ1HwIcI8HHUfICRxW69ri/onLGPsHxszSFsHMh/yZyZmYJ8u/E113/u7Hk8zVQjh39UOcfQDcLaSchy8X95xyjMOrFaPBU05OYSr8Hnqmh1xGpjnE9AazC4mKXLhiLCiBPcrWCozUoszl75V33+wxzLZr9NBpMhMRmRsdd3tFTtpgksR+Ei2E1lxeetSY8St+hUz5+v7i2BJzo0qpNsf3DSzDZ8LHKwNNL9bOa9Nc14NR4TNHmMovCDrhhxAoKBt/T0I4DPMsG4dN64OKdlmaZXKDiy9tS4KlmguU9oNqOPK/Xd5S+LnM89I2/9CSBnA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xT8PivgopX8B6HK+EUR5dsMctaG8muPrUQl6BbSLRQxFbon6iOJtFSpd7uLfhoyVp6XTRriepBJxV1vxnslkrqKkjW7QlG4SshfT0+meM6c1gKXL3sthRo3C+lpwrBN9dpEi1P7tzpiPO+LLvXK9ZIvHJxL9/Jk5Wfc6c1tLfe3D4tUMJQ1TuDxXpM0d/0/wdaf24lXMGonTjyvfM3yVqz0Ov55l6rgcDuoTOURWEmKrpBnYd6SaAlGf3LhKU11Oj2S77nakf4LUekOwPuulVpx4wAc2DBTLIVYlJ6niYzR7M0ER6yS8OI5x7icG3tnRFiYY9WYTr08RDaRuVNrlNA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Thu, 09 Apr 2026 15:55:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHcyDlVyOevPxMGvE2K9zY95LxHDw==
  • Thread-topic: [PATCH] hypfs: remove unreachable statement in the 'hypfs_get_entry_rel()'

The statement 'return ERR_PTR(-ENOENT);' on the final line of the function
'hypfs_get_entry_rel()' is unreachable because the logic within the infinite
loop 'for (;;)' provides all possible exit paths for the function. So there
is no execution path to exit the loop and reach the final that statement.

Remove that statement. This also fixes MISRA C Rule 2.1 which states:
"A project shall not contain unreachable code".

Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@xxxxxxxx>
---
Test CI pipeline:
https://gitlab.com/xen-project/people/dimaprkp4k/xen/-/pipelines/2440991088
---
 xen/common/hypfs.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/xen/common/hypfs.c b/xen/common/hypfs.c
index cdf4ee0171..fea74d66e1 100644
--- a/xen/common/hypfs.c
+++ b/xen/common/hypfs.c
@@ -347,8 +347,6 @@ static struct hypfs_entry *hypfs_get_entry_rel(struct 
hypfs_entry_dir *dir,
         path = end + 1;
         dir = container_of(entry, struct hypfs_entry_dir, e);
     }
-
-    return ERR_PTR(-ENOENT);
 }
 
 static struct hypfs_entry *hypfs_get_entry(const char *path)
-- 
2.43.0



 


Rackspace

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