From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: michal.orzel@amd.com, xenia.ragiadakou@amd.com,
ayan.kumar.halder@amd.com, consulting@bugseng.com,
Bertrand Marquis <bertrand.marquis@arm.com>,
Rahul Singh <rahul.singh@arm.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [XEN PATCH v2 2/3] xen/drivers/passthrough/arm/smmu-v3.c: fix violations of MISRA C:2012 Rule 3.1
Date: Tue, 20 Jun 2023 10:06:48 +0200 [thread overview]
Message-ID: <d93d9232-213b-e6b3-c390-9e93d63bd3a3@bugseng.com> (raw)
In-Reply-To: <637d2a61-2c30-76a4-60b0-cf4d979c59be@xen.org>
On 19/06/23 12:10, Julien Grall wrote:
> Hi,
>
> On 19/06/2023 10:56, Nicola Vetrini wrote:
>> In the file `xen/drivers/passthrough/arm/smmu-v3.c' there are a few
>> occurrences
>> of nested '//' character sequences inside C-style comment blocks,
>> which violate
>> Rule 3.1. The patch aims to resolve those by removing the nested
>> comments.
>
> I think it is important to understand/explain what was the intention of
> the // before removing them because, IMHO, the new approach doesn't
> convey the same information. Before...
>
>>
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com
>> Changes:
>> - Resending the patch with the right maintainers in CC.
>> Changes in V2:
>> - Split the patch into a series and reworked the fix.
>> - Apply the fix to the arm32 `flushtlb.h' file, for consistency
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>> ---
>> xen/drivers/passthrough/arm/smmu-v3.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/xen/drivers/passthrough/arm/smmu-v3.c
>> b/xen/drivers/passthrough/arm/smmu-v3.c
>> index 720aa69ff2..f410863e10 100644
>> --- a/xen/drivers/passthrough/arm/smmu-v3.c
>> +++ b/xen/drivers/passthrough/arm/smmu-v3.c
>> @@ -1047,10 +1047,10 @@ static int arm_smmu_atc_inv_domain(struct
>> arm_smmu_domain *smmu_domain,
>> * before we read 'nr_ats_masters' in case of a concurrent call to
>> * arm_smmu_enable_ats():
>> *
>> - * // unmap() // arm_smmu_enable_ats()
>> + * unmap() arm_smmu_enable_ats()
>
> ... with the // it would be clearer that the code below belongs to each
> function. But now, it leads to think there are a call to 'unmap' which
> it then followed by TLBI+SYNC.
>
> In this case, I would propose to use --- <function> ---
It seems a good suggestion to me.
>
>> * TLBI+SYNC atomic_inc(&nr_ats_masters);
>> * smp_mb(); [...]
>> - * atomic_read(&nr_ats_masters); pci_enable_ats() // writel()
>> + * atomic_read(&nr_ats_masters); pci_enable_ats() (i.e.
>> writel())
>
> NIT: I think 'see' would be better than 'i.e.' because I read it as
> pci_enable_ats() is a simple writel().
Ok.
>
>> *
>> * Ensures that we always see the incremented 'nr_ats_masters'
>> count if
>> * ATS was enabled at the PCI device before completion of the TLBI.
>
> Cheers,
>
Regards,
--
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)
next prev parent reply other threads:[~2023-06-20 8:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-19 9:56 [XEN PATCH v2 0/3] fix violations of MISRA C:2012 Rule 3.1 Nicola Vetrini
2023-06-19 9:56 ` [XEN PATCH v2 1/3] xen/arch/arm: " Nicola Vetrini
2023-06-19 10:01 ` Julien Grall
2023-06-19 10:25 ` Jan Beulich
2023-06-19 10:29 ` Julien Grall
2023-06-20 13:56 ` Nicola Vetrini
2023-06-19 9:56 ` [XEN PATCH v2 2/3] xen/drivers/passthrough/arm/smmu-v3.c: " Nicola Vetrini
2023-06-19 10:10 ` Julien Grall
2023-06-20 8:06 ` Nicola Vetrini [this message]
2023-06-19 9:56 ` [XEN PATCH v2 3/3] xen: " Nicola Vetrini
2023-06-19 10:29 ` Jan Beulich
2023-06-20 8:00 ` Nicola Vetrini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d93d9232-213b-e6b3-c390-9e93d63bd3a3@bugseng.com \
--to=nicola.vetrini@bugseng.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=ayan.kumar.halder@amd.com \
--cc=bertrand.marquis@arm.com \
--cc=consulting@bugseng.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=rahul.singh@arm.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
--cc=xenia.ragiadakou@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.