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

[PATCH] xen/cache-col: address MISRA C Rule 5.3


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>
  • Date: Thu, 19 Mar 2026 20:31:39 +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=SaxsfFLqPWY8Z0990llkc2YeoFB0uS8/8dnWO7VyWpM=; b=DUM6ZuSB0I5upJFIiIPzB75LJgJK0o5duL7Z9fOdJwJSu/J1tGIO6vkbpIqZ5fXU/5jaryEJz9/pO28J0yHSrl+PMaOz1Wb5GipsSkcY6GWCfxoa/CvQV2Pi0hk8u2OoSxgNduWf2KU30Ku2jsiGwo7gTv6kL3J5W8ZVkHCP1sIfWidrJzQiGnQHNTqD5BWaVzMGP4bBiiXvBYWkRNcgDcAr2dh8H/FuMwkflypvB++YhPOcoAY/hMgVTsh7IAXZC0t1Fp5bGOG2TLy7fMcOYTLzUzYRhgx+F6mp0b9xz9T913RHkNGWKyYjrEhQ2klomlbCHjzTM4p10mXKvV4f8w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mNeK/Vqj1s+QPZpmICNW3uEitBet+GxBNgPLZgyrtz6Ozz48Rbrrim4Telv0CMYDzmn1WIn632Ho+/W5w25R2XDH6QU6nC/fZFnMQiBcfo+USGg0TuoC5LcaHpXNr+W1/xLw8aUSftrGe/GbXVac+fLj7wx+ga0U/CINiTslys7Ycvyb+OpnUUEj2nHQUo2iRQV9oSki9j/3/f+6jT2RguyOasufmCkDp3QQSKju7a+eQs0L7jRF/8WuYpsYseThOOQmnI4csmrzWCWWFZjMGwlmk5cuif/LTITKt6s3FZebzzydD2E55O1/+MQg8ln9716Gz1T7IM59zGxuWWzBXg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Thu, 19 Mar 2026 20:32:05 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHct99kwxPxzBz4DUGcLo60qBaCjA==
  • Thread-topic: [PATCH] xen/cache-col: address MISRA C Rule 5.3

MISRA C:2012 Rule 5.3 states as following: An identifier declared in an
inner scope shall not hide an identifier declared in an outer scope.

Inside the 'if' block, the inner 'i' shadows the outer 'i'.
Reuse the outer variable and remove the inner declaration to fix that.

No functional change.

Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@xxxxxxxx>
---
 xen/common/llc-coloring.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/xen/common/llc-coloring.c b/xen/common/llc-coloring.c
index 77a54beed1..822a6b2ed5 100644
--- a/xen/common/llc-coloring.c
+++ b/xen/common/llc-coloring.c
@@ -193,8 +193,6 @@ void __init llc_coloring_init(void)
 
     if ( !xen_num_colors )
     {
-        unsigned int i;
-
         xen_num_colors = MIN(XEN_DEFAULT_NUM_COLORS, max_nr_colors);
 
         printk(XENLOG_WARNING
-- 
2.43.0



 


Rackspace

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