Make the fdt_get_mem_regions memsize argument optional. It's only used in

by a few callers.

Sponsored by:	ABT Systems Ltd
This commit is contained in:
Andrew Turner 2016-03-01 09:45:27 +00:00
parent b2552c46b6
commit a43760692b
4 changed files with 5 additions and 7 deletions

View File

@ -918,11 +918,10 @@ decode_win_sdram_fixup(void)
struct mem_region mr[FDT_MEM_REGIONS];
uint8_t window_valid[MV_WIN_DDR_MAX];
int mr_cnt, err, i, j;
u_long memsize;
uint32_t valid_win_num = 0;
/* Grab physical memory regions information from device tree. */
err = fdt_get_mem_regions(mr, &mr_cnt, &memsize);
err = fdt_get_mem_regions(mr, &mr_cnt, NULL);
if (err != 0)
return (err);

View File

@ -1642,11 +1642,10 @@ decode_win_cesa_setup(struct cesa_softc *sc)
struct mem_region availmem_regions[FDT_MEM_REGIONS];
int availmem_regions_sz;
uint32_t br, cr, i;
u_long memsize;
/* Grab physical memory regions information from DTS */
if (fdt_get_mem_regions(availmem_regions, &availmem_regions_sz,
&memsize) != 0)
NULL) != 0)
return (ENXIO);
if (availmem_regions_sz > MV_WIN_CESA_MAX) {

View File

@ -705,7 +705,8 @@ fdt_get_mem_regions(struct mem_region *mr, int *mrcnt, u_long *memsize)
}
*mrcnt = i;
*memsize = memory_size;
if (memsize != NULL)
*memsize = memory_size;
rv = 0;
out:
return (rv);

View File

@ -739,7 +739,6 @@ initriscv(struct riscv_bootparams *rvbp)
vm_offset_t lastaddr;
int mem_regions_sz;
vm_size_t kernlen;
u_long memsize;
caddr_t kmdp;
int i;
@ -763,7 +762,7 @@ initriscv(struct riscv_bootparams *rvbp)
physmap_idx = 0;
/* Grab physical memory regions information from device tree. */
if (fdt_get_mem_regions(mem_regions, &mem_regions_sz, &memsize) != 0)
if (fdt_get_mem_regions(mem_regions, &mem_regions_sz, NULL) != 0)
panic("Cannot get physical memory regions");
for (i = 0; i < mem_regions_sz; i++)
add_physmap_entry(mem_regions[i].mr_start,