Hi

 

In general I’m against the idea of removing struct (or other tag) names. They enable header files that depend on these to forward declare the struct instead of including the struct definition, which helps to avoid deep header nesting. Although this particular struct name is not referenced upstream, TF-A is not a self-contained codebase, so downstream projects may be relying on this (or may want to in future).

 

I’d advocate an exception for this MISRA rule.

 

Regards


Dan.

 

From: Olivier Deprez via TF-A <tf-a@lists.trustedfirmware.org>
Sent: Wednesday, January 17, 2024 9:15 AM
To: tf-a@lists.trustedfirmware.org; Nithin G <nithing1999@gmail.com>
Subject: [TF-A] Re: A project should not contain unused tag declarations.

 

Hi Nithin,

 

Thanks for reporting.

 

For such kind of small change, may I advise for you to submit a code review change to https://review.trustedfirmware.org/ ?

 

Thank you,

Olivier.

 


From: Nithin G via TF-A <tf-a@lists.trustedfirmware.org>
Sent: 17 January 2024 08:01
To: tf-a@lists.trustedfirmware.org <tf-a@lists.trustedfirmware.org>
Subject: [TF-A] A project should not contain unused tag declarations.

 

Hello,

In the file /bl31/interrupt_mgmt.c and /include/drivers/arm/gicv2.h and other files getting misra_c_2012_rule_2_4_violation:    Type has tag "intr_type_desc" but that tag is never used. during the Coverity MISRA-C analysis.

typedef struct intr_type_desc {
        interrupt_type_handler_t handler;
        u_register_t scr_el3[2];
        uint32_t flags;
} intr_type_desc_t;

Resolution: Removed the intr_type_desc variable as it declared it's typedef intr_type_desc_t.

typedef struct {
        interrupt_type_handler_t handler;
        u_register_t scr_el3[2];
        uint32_t flags;
} intr_type_desc_t;

Is It possible to remove the intr_type_desc variable since it is typedef. Please suggest?

Regards,
Nithin
--
TF-A mailing list -- tf-a@lists.trustedfirmware.org
To unsubscribe send an email to tf-a-leave@lists.trustedfirmware.org