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

Re: [PATCH] xen: add deviations for MISRA C 2012 Rule R5.4



On Wed, 13 Nov 2024, Jan Beulich wrote:
> On 13.11.2024 10:38, Alessandro Zucchelli wrote:
> > This addresses violations of MISRA C:2012 Rule 5.4 which states as
> > following: Macro identifiers shall be distinct.
> > 
> > This deviation aims to address violations of Rule 5.4 regarding
> > identifiers XLAT_hvm_altp2m_set_mem_access_multi_HNDL_pfn_list and
> > XLAT_hvm_altp2m_set_mem_access_multi_HNDL_access_list, and identifiers
> > declared in header file include/asm/guest/hyperv-tlfs.h.
> 
> Please can you provide enough context? The two identifiers are quite
> obviously distinct. Just not in the first 40 characters. A limit I had
> to actually go look up, because it's entirely arbitrary.
> 
> Plus - what are we going to do if further such identifiers appear?
> Exclude them one by one? That wouldn't really scale. Can we perhaps
> make a wider exception, e.g. at least for all XLAT_*_HDNL_* ones? Then
> again part of the problem here is that hvm_altp2m_set_mem_access_multi
> is already excessively long, alone taking up 31 characters.

If the reason for the deviation is solely the length of the identifiers,
I believe we should increase the limit from 40 to 64 characters. If we
make this change, would it resolve the issue?  After that, can we mark
Rule 5.4 as clean?

Regardless, the recent MISRA regressions have demonstrated the need to
act quickly in marking as many rules as clean as possible to prevent
further regressions (new MISRA violations) from entering the codebase.
There are a few pending patches on the list to address only one or two
violations left so that we can mark a rule as clean. I believe we should
accept these patches even if they are not perfect, as the cost of
delaying action would be far greater for everyone involved. Andrew had
to spent a full day this week just to catch up on recent violations that
we would have easily caught if we had marked rules as clean.

Based on that, I think we should take this patch changing the deviation
to cover all XLAT_*_HDNL_*. The change can be made on commit.

Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>



 


Rackspace

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