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

Re: [PATCH] arm/tee: rename variable to address MISRA C Rule 5.3


  • To: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Fri, 20 Mar 2026 07:44:43 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=epam.com smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; 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=84Q0rWdzY+4rSHbm7cliyjzI/VC72AVwvDvmYKV+/XQ=; b=y8jnLpBOalCWsspJN+297HzPdvMe1qrdwmxejTZXANksJhO6O6PxquDI0PnEQ81icYB9QA7x2vGcx6E/xi3hF5fmPbLL8RoyyVAOkSQ1D39QxzLOz8MnNxTemsbSjk3S1a/hOlB9k54h/aj310IOmvPmkznJsk8JMCyS9DMy//Thq83oaJF1Qd50mtpgFUZEzH99rXefE4Hcc41b68Zo4ovP76DXxRxj0Ru942SQB6iYi+t1EH3OcM3oGUNYxlL+kmvl39Jy4uH386w60GvmCWNJ3RcgHIhEelfREpv4SIzcfRdvkQSPby3i4dkE2e+o7Y1XusZMKCTqvFrSEk4ueg==
  • 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=84Q0rWdzY+4rSHbm7cliyjzI/VC72AVwvDvmYKV+/XQ=; b=FTp1I1pJNzOl2vaN3M0AP7WqeA4uvKXrAts/6YzXAlAxRJ2f+hY6fIM73rf00BsAmq4L3vEDaouJ/ozldlzHFrGlZEn1XEOdK54l3WQoDpO1VcG45HuG0FZCknEYnhJZbQaTprZRDOU3paPE5xGRChqznobNmBAvMl8TuB4Li3krjrPJbNfyy/LaAqueAAnikbF/poXoxv8RB+2irmLpiK09KN0drYVaY4J0kqtMruR2QlahycGwdQk0e/e/YavWp/PAgzXyg3wHbM1F599dn0Jn0UkaOEZ/s5ju6mw8yLV4WrpsLY6lxjGQlbZnQknOmd4l3BDBPG+r6TtTxfYcgQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=ulkqic8tjTFJM3dNm7tEerLg5QPK9TEGW5UhiRau/ovihjprZwRl0zndvoQk/xkR35Ve4xjHfoJ1hv/mpdeE/Ga1nIbVE6t6MzoH9VAxtJJ9wS2YDEWlGUAGMwjnGk/7URvX1oAdWmqtpPIBGXm93MR+CVAEEdH8uPoOzVy58q+NfB39JZZhUn9yqeuIomKKWkQ1rfy2FceXsjMqBinnlpyMSp+rsX53xNF9uEumwEdmr+n8YL/1vDkPbj/erwF3YASVoejY+/b/ZlEdc8DcyfCdqR6IaSmArH3rJW485c03R0Y/h5mGE00EwdkprX47YSew1cfin6mSxTa9SfJtLA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YA4SNq+BYnhsO2Pckv1Df5MNWcMNH/vQLoM9/nAhCS7VztzYm9gMizNEe1oYeapoNx3pES7fseZiY54Ty4yyKiTHFAVPNwAbJVQkj1BPBSnCuhOtdrNKrlZ6eyAHICCGhWA2DNWsjTtD9SvfBkTJDBF9dh1YMHFwiWR8YE9r84D5LMNcTwNKYBG9zv22wTMRaIfh2Y2slN4ElC8r4LNpdLBlkl0uqs2QcsOxJC8a8EVvwkgkdoihPVDLvHLdEvRyFocwtw1INfHCEBd+WUiCGK2MwD3zFMyiDa5odLsU6EmIU27y7eMcx1JJGTp0H03CS9/LRDtMW9Rs95FrmDJz/w==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Jens Wiklander <jens.wiklander@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Fri, 20 Mar 2026 07:46:16 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Thread-index: AQHct91SP+heAl5ESUaIOkxQ7VfzerW3Cw6A
  • Thread-topic: [PATCH] arm/tee: rename variable to address MISRA C Rule 5.3

Hi Dmytro,


> On 19 Mar 2026, at 21:16, Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx> 
> wrote:
> 
> The local variable 'ffa_vm_count' shadows the global variable, declared
> in 'xen/arch/arm/tee/ffa_private.h', therefore it is renamed
> 'ffa_vm2vm_count'.

I have a patch in my queue to solve this (I am just removing the ffa_ prefix 
from the local
variables but does the same as yours) and a patch to solve the other misra 
issue in optee
but happy to to use yours if you want instead.

I was waiting for the pending ffa serie to push them (should be merge soon)

This patch will not rebase cleanly on top of that serie which is changing 
ffa_partinfo code.

Do you want to wait and rebase or abandon and use the one in my serie instead ?

I am ok with either solution :-)

Cheers
Bertrand

> 
> No functional change.
> 
> Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@xxxxxxxx>
> ---
> xen/arch/arm/tee/ffa_partinfo.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/arch/arm/tee/ffa_partinfo.c b/xen/arch/arm/tee/ffa_partinfo.c
> index fdb03dae9a..473507ca3a 100644
> --- a/xen/arch/arm/tee/ffa_partinfo.c
> +++ b/xen/arch/arm/tee/ffa_partinfo.c
> @@ -265,7 +265,7 @@ void ffa_handle_partition_info_get(struct cpu_user_regs 
> *regs)
>     uint32_t dst_size = 0;
>     size_t buf_size;
>     void *dst_buf, *end_buf;
> -    uint32_t ffa_vm_count = 0, ffa_sp_count = 0;
> +    uint32_t ffa_vm2vm_count = 0, ffa_sp_count = 0;
> 
>     ffa_uuid_set(&uuid,
>              get_user_reg(regs, 1),
> @@ -310,7 +310,7 @@ void ffa_handle_partition_info_get(struct cpu_user_regs 
> *regs)
>          */
>         if ( ffa_uuid_is_nil(uuid) )
>         {
> -            ffa_vm_count = get_ffa_vm_count();
> +            ffa_vm2vm_count = get_ffa_vm_count();
> 
>             /*
>              * Workaround for Linux FF-A Driver not accepting to have its own
> @@ -320,7 +320,7 @@ void ffa_handle_partition_info_get(struct cpu_user_regs 
> *regs)
>              * the requester endpoint information should be included or not
>              */
>             if ( ACCESS_ONCE(ctx->guest_vers) < FFA_VERSION_1_2 )
> -                ffa_vm_count -= 1;
> +                ffa_vm2vm_count -= 1;
>         }
> 
>         goto out;
> @@ -355,7 +355,7 @@ void ffa_handle_partition_info_get(struct cpu_user_regs 
> *regs)
>             goto out_rx_release;
>     }
> 
> -    ret = ffa_get_vm_partinfo(uuid, &ffa_vm_count, &dst_buf, end_buf,
> +    ret = ffa_get_vm_partinfo(uuid, &ffa_vm2vm_count, &dst_buf, end_buf,
>                               dst_size);
> 
> out_rx_release:
> @@ -370,7 +370,7 @@ out:
>         if ( flags || ACCESS_ONCE(ctx->guest_vers) == FFA_VERSION_1_0 )
>             dst_size = 0;
> 
> -        ffa_set_regs_success(regs, ffa_sp_count + ffa_vm_count, dst_size);
> +        ffa_set_regs_success(regs, ffa_sp_count + ffa_vm2vm_count, dst_size);
>     }
> }
> 
> -- 
> 2.43.0




 


Rackspace

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