[Skiboot] [PATCH v2 2/6] libffs: add the offset of the TOC to partition entry addresses

Alistair Popple alistair at popple.id.au
Fri May 22 12:01:16 AEST 2015


Comment below.

On Thu, 14 May 2015 12:02:35 Cyril Bur wrote:
> The accessor for ffs partition entries should be adding the offset of the
> TOC to the absolute address of the partition entries as the TOC is not
> necessarily at 0 within in the flash.
> 
> Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
> ---
>  libflash/libffs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libflash/libffs.c b/libflash/libffs.c
> index 1f5cd94..55e6895 100644
> --- a/libflash/libffs.c
> +++ b/libflash/libffs.c
> @@ -244,7 +244,7 @@ static struct ffs_entry *ffs_get_part(struct ffs_handle
> *ffs, uint32_t index, if (index > ffs->hdr.entry_count)
>  		return NULL;
>  	if (out_offset)
> -		*out_offset = offset;
> +		*out_offset = ffs->toc_offset + offset;
>  	return (struct ffs_entry *)(ffs->cache + offset);

You update out_offset to toc_offset + offset but still return the cached entry 
at offset. This assumes ffs->cache starts at toc_offset, does it?

If so:

Reviewed-by: Alistair Popple <alistair at popple.id.au>

>  }



More information about the Skiboot mailing list