Hi Nithin,

I see no valid reason why bl31_lib_init() should be exported outside of bl31/bl31_main.c translation unit. That might be a left-over from legacy code perhaps. It makes sense to me to mark it as static and remove its declaration from bl31.h.

Feel free to post a patch to this effect and CC me on the review.

Best regards,
Sandrine


From: Nithin G via TF-A <tf-a@lists.trustedfirmware.org>
Sent: 06 December 2023 12:26
To: tf-a@lists.trustedfirmware.org <tf-a@lists.trustedfirmware.org>
Subject: [TF-A] Function bl31_lib_init() has external linkage but is only used in one translation unit.
 
Hello,

In the file bl31/bl31_main.c, there is a function named bl31_lib_init with its definition. Simultaneously, the declaration of this function is included in include/bl31/bl31.h since the function bl31_lib_init used only in one translational unit. leading to a violation when running the Coverity MISRA-C analysis for the ZynqMP.
Addressing this issue need to remove the declaration of the function from the bl31.h file and making its definition static. To maintain visibility, included a static declaration in the bl31_main.c file. However, it will may impact in future modifications due to the removal of the declaration in bl31.h. Please provide your suggestions.

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