mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-25 07:41:42 +01:00
treewide: Make carray arrays const and NULL-terminated
This allows the compiler to generate significantly better code, because it does not have to maintain either the loop counter or loop limit. Plus there are half as many symbols to relocate. This also simplifies passing carray arrays to helper functions. Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:

committed by
Anup Patel

parent
23ef9c5f00
commit
df1c100001
@@ -13,8 +13,7 @@
|
||||
#include <sbi_utils/ipi/fdt_ipi.h>
|
||||
|
||||
/* List of FDT ipi drivers generated at compile time */
|
||||
extern struct fdt_ipi *fdt_ipi_drivers[];
|
||||
extern unsigned long fdt_ipi_drivers_size;
|
||||
extern struct fdt_ipi *const fdt_ipi_drivers[];
|
||||
|
||||
int fdt_ipi_init(void)
|
||||
{
|
||||
@@ -23,7 +22,7 @@ int fdt_ipi_init(void)
|
||||
const struct fdt_match *match;
|
||||
const void *fdt = fdt_get_address();
|
||||
|
||||
for (pos = 0; pos < fdt_ipi_drivers_size; pos++) {
|
||||
for (pos = 0; fdt_ipi_drivers[pos]; pos++) {
|
||||
drv = fdt_ipi_drivers[pos];
|
||||
|
||||
noff = -1;
|
||||
|
Reference in New Issue
Block a user