From patchwork Thu May 14 02:02:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Bur X-Patchwork-Id: 472173 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8A3D914027F for ; Thu, 14 May 2015 12:04:05 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 6999F1A047B for ; Thu, 14 May 2015 12:04:05 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e23smtp05.au.ibm.com (e23smtp05.au.ibm.com [202.81.31.147]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3CA9A1A0015 for ; Thu, 14 May 2015 12:03:49 +1000 (AEST) Received: from /spool/local by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 14 May 2015 12:03:48 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 14 May 2015 12:03:45 +1000 Received: from d23relay07.au.ibm.com (d23relay07.au.ibm.com [9.190.26.37]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id DFC802CE8055 for ; Thu, 14 May 2015 12:03:44 +1000 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t4E23akD25821296 for ; Thu, 14 May 2015 12:03:44 +1000 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t4E23CIF032639 for ; Thu, 14 May 2015 12:03:12 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t4E23Bku031798 for ; Thu, 14 May 2015 12:03:12 +1000 Received: from cyril.ozlabs.ibm.com (unknown [9.192.254.114]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id BE31DA03B1 for ; Thu, 14 May 2015 12:02:47 +1000 (AEST) From: Cyril Bur To: skiboot@lists.ozlabs.org Date: Thu, 14 May 2015 12:02:35 +1000 Message-Id: <1431568959-19933-3-git-send-email-cyril.bur@au1.ibm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431568959-19933-1-git-send-email-cyril.bur@au1.ibm.com> References: <1431568959-19933-1-git-send-email-cyril.bur@au1.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15051402-0017-0000-0000-00000139C9FD Subject: [Skiboot] [PATCH v2 2/6] libffs: add the offset of the TOC to partition entry addresses X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" 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 Reviewed-by: Alistair Popple --- 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); }