lib: sbi_scratch: remove owner from sbi_scratch_alloc_offset

The parameter owner of function sbi_scratch_alloc_offset() is never used.
The scratch memory is small. We should not use it for debug information in
future. Hence eliminate the parameter.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Xiang W <wxjstz@126.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
Heinrich Schuchardt
2021-05-29 21:54:29 +02:00
committed by Anup Patel
parent 66c4fca532
commit f30b18944e
8 changed files with 10 additions and 18 deletions

View File

@@ -98,7 +98,7 @@ int sbi_scratch_init(struct sbi_scratch *scratch);
* @return zero on failure and non-zero (>= SBI_SCRATCH_EXTRA_SPACE_OFFSET) * @return zero on failure and non-zero (>= SBI_SCRATCH_EXTRA_SPACE_OFFSET)
* on success * on success
*/ */
unsigned long sbi_scratch_alloc_offset(unsigned long size, const char *owner); unsigned long sbi_scratch_alloc_offset(unsigned long size);
/** Free-up extra space in sbi_scratch */ /** Free-up extra space in sbi_scratch */
void sbi_scratch_free_offset(unsigned long offset); void sbi_scratch_free_offset(unsigned long offset);

View File

@@ -451,8 +451,7 @@ int sbi_hart_init(struct sbi_scratch *scratch, bool cold_boot)
sbi_hart_expected_trap = &__sbi_expected_trap_hext; sbi_hart_expected_trap = &__sbi_expected_trap_hext;
hart_features_offset = sbi_scratch_alloc_offset( hart_features_offset = sbi_scratch_alloc_offset(
sizeof(struct hart_features), sizeof(struct hart_features));
"HART_FEATURES");
if (!hart_features_offset) if (!hart_features_offset)
return SBI_ENOMEM; return SBI_ENOMEM;
} }

View File

@@ -185,8 +185,7 @@ int sbi_hsm_init(struct sbi_scratch *scratch, u32 hartid, bool cold_boot)
struct sbi_hsm_data *hdata; struct sbi_hsm_data *hdata;
if (cold_boot) { if (cold_boot) {
hart_data_offset = sbi_scratch_alloc_offset(sizeof(*hdata), hart_data_offset = sbi_scratch_alloc_offset(sizeof(*hdata));
"HART_DATA");
if (!hart_data_offset) if (!hart_data_offset)
return SBI_ENOMEM; return SBI_ENOMEM;

View File

@@ -233,8 +233,7 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid)
if (rc) if (rc)
sbi_hart_hang(); sbi_hart_hang();
init_count_offset = sbi_scratch_alloc_offset(__SIZEOF_POINTER__, init_count_offset = sbi_scratch_alloc_offset(__SIZEOF_POINTER__);
"INIT_COUNT");
if (!init_count_offset) if (!init_count_offset)
sbi_hart_hang(); sbi_hart_hang();

View File

@@ -227,8 +227,7 @@ int sbi_ipi_init(struct sbi_scratch *scratch, bool cold_boot)
struct sbi_ipi_data *ipi_data; struct sbi_ipi_data *ipi_data;
if (cold_boot) { if (cold_boot) {
ipi_data_off = sbi_scratch_alloc_offset(sizeof(*ipi_data), ipi_data_off = sbi_scratch_alloc_offset(sizeof(*ipi_data));
"IPI_DATA");
if (!ipi_data_off) if (!ipi_data_off)
return SBI_ENOMEM; return SBI_ENOMEM;
ret = sbi_ipi_event_create(&ipi_smode_ops); ret = sbi_ipi_event_create(&ipi_smode_ops);

View File

@@ -40,7 +40,7 @@ int sbi_scratch_init(struct sbi_scratch *scratch)
return 0; return 0;
} }
unsigned long sbi_scratch_alloc_offset(unsigned long size, const char *owner) unsigned long sbi_scratch_alloc_offset(unsigned long size)
{ {
u32 i; u32 i;
void *ptr; void *ptr;

View File

@@ -121,8 +121,7 @@ int sbi_timer_init(struct sbi_scratch *scratch, bool cold_boot)
const struct sbi_platform *plat = sbi_platform_ptr(scratch); const struct sbi_platform *plat = sbi_platform_ptr(scratch);
if (cold_boot) { if (cold_boot) {
time_delta_off = sbi_scratch_alloc_offset(sizeof(*time_delta), time_delta_off = sbi_scratch_alloc_offset(sizeof(*time_delta));
"TIME_DELTA");
if (!time_delta_off) if (!time_delta_off)
return SBI_ENOMEM; return SBI_ENOMEM;

View File

@@ -380,19 +380,16 @@ int sbi_tlb_init(struct sbi_scratch *scratch, bool cold_boot)
const struct sbi_platform *plat = sbi_platform_ptr(scratch); const struct sbi_platform *plat = sbi_platform_ptr(scratch);
if (cold_boot) { if (cold_boot) {
tlb_sync_off = sbi_scratch_alloc_offset(sizeof(*tlb_sync), tlb_sync_off = sbi_scratch_alloc_offset(sizeof(*tlb_sync));
"IPI_TLB_SYNC");
if (!tlb_sync_off) if (!tlb_sync_off)
return SBI_ENOMEM; return SBI_ENOMEM;
tlb_fifo_off = sbi_scratch_alloc_offset(sizeof(*tlb_q), tlb_fifo_off = sbi_scratch_alloc_offset(sizeof(*tlb_q));
"IPI_TLB_FIFO");
if (!tlb_fifo_off) { if (!tlb_fifo_off) {
sbi_scratch_free_offset(tlb_sync_off); sbi_scratch_free_offset(tlb_sync_off);
return SBI_ENOMEM; return SBI_ENOMEM;
} }
tlb_fifo_mem_off = sbi_scratch_alloc_offset( tlb_fifo_mem_off = sbi_scratch_alloc_offset(
SBI_TLB_FIFO_NUM_ENTRIES * SBI_TLB_INFO_SIZE, SBI_TLB_FIFO_NUM_ENTRIES * SBI_TLB_INFO_SIZE);
"IPI_TLB_FIFO_MEM");
if (!tlb_fifo_mem_off) { if (!tlb_fifo_mem_off) {
sbi_scratch_free_offset(tlb_fifo_off); sbi_scratch_free_offset(tlb_fifo_off);
sbi_scratch_free_offset(tlb_sync_off); sbi_scratch_free_offset(tlb_sync_off);