Hi Nithin,
On 9/5/23 07:56, Nithin G via TF-A wrote:
Hi Sandrine,
Sorry I was in vacation. Thanks for responding,
No problem.
we are using zynqmp platform and building using coverity build. consider for only our build files while building it generates, these functions are not called in any other files and also instead of bl1 and bl2 we are using FSBL (first stage bootloader).
OK so that explains why you're not seeing any of the BL1/BL2 specific functions being referenced.
If I take another example in bl31 files, multi_console.c file: 1.console_getc
I think you're right about this one. There does not seem to be any platform port calling console_getc() right now.
Thinking further about it, it's not surprising... TF-A writes lots of information to the console but getting input from the user is very unusual. Unlike some other firmwares (e.g. UEFI), TF-A does not implement a shell or any kind of interactive user input mechanism.
I guess getc() was implemented for completeness of the console drivers - once you've got all the console setup and putc(), getc() almost comes for free.
2.console_unregister
This is used on Arm, Broadcom and Marvell platforms. Hence, it's no dead code from the point of view of TF-A codebase, even though it's not used on zynqmp platforms.
You can easily see this using `git grep console_unregister` command from TF-A top directory:
$ git grep console_unregister drivers/console/multi_console.c:console_t *console_unregister(console_t *to_be_deleted) include/drivers/console.h:console_t *console_unregister(console_t *console); plat/arm/board/fvp/fvp_console.c: (void)console_unregister(&fvp_runtime_console); plat/arm/common/arm_console.c: (void)console_unregister(&arm_boot_console); plat/brcm/board/common/bcm_console.c: (void)console_unregister(&bcm_boot_console); plat/brcm/board/common/bcm_console.c: (void)console_unregister(&bcm_runtime_console); plat/marvell/armada/a8k/a80x0_puzzle/board/system_power.c: (void)console_unregister(&console); plat/marvell/armada/common/marvell_console.c: (void)console_unregister(&marvell_boot_console); plat/marvell/armada/common/marvell_console.c: (void)console_unregister(&marvell_runtime_console);
I suggest you cross-check Coverity results against `git grep` results to identify dead code.
interrupt_mgmt.c file: 1.disable_intr_rm_local
Used by TSPD and TLKD.
2.enable_intr_rm_local
Used by TSPD.
For the above functions also not called in other files if I consider our build files for zynqmp build. Like these I am getting many unused functions in other files. Please suggest?
Sorry, I am not sure what you're asking for... We obviously can't remove functions which are unused on zynqmp platforms if they are used by some other platforms in the tree. If you find true dead code (like console_getc() above) we can open a discussion on this. But otherwise, I can't offer any advice. I guess you need to find a way to tell Coverity what's true dead code and what can be safely ignored in the case of your platform...
Best regards, Sandrine