From patchwork Wed Aug 3 19:34:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 655583 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3s4NcW2JbBz9sxR for ; Thu, 4 Aug 2016 05:36:59 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3s4NcW1QwrzDqcq for ; Thu, 4 Aug 2016 05:36:59 +1000 (AEST) X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3s4NZ54JFZzDqS6 for ; Thu, 4 Aug 2016 05:34:53 +1000 (AEST) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F2CE781110; Wed, 3 Aug 2016 19:34:51 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-62.ams2.redhat.com [10.36.116.62]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u73JYiKN028877; Wed, 3 Aug 2016 15:34:50 -0400 From: Thomas Huth To: slof@lists.ozlabs.org Date: Wed, 3 Aug 2016 21:34:44 +0200 Message-Id: <1470252884-16602-5-git-send-email-thuth@redhat.com> In-Reply-To: <1470252884-16602-1-git-send-email-thuth@redhat.com> References: <1470252884-16602-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 03 Aug 2016 19:34:52 +0000 (UTC) Subject: [SLOF] [PATCH 4/4] Remove misleading padding fields from ROM header definition X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: areber@redhat.com MIME-Version: 1.0 Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" The first two bytes of the date field are unused - and the date is indeed encoded in the following six bytes, i.e. also using the padding bytes. So the header definition is currently very confusing. Let's simply remove the padding fields and make the date field a little bit bigger instead - and add a proper comment about the encoding of the date field. Signed-off-by: Thomas Huth --- include/calculatecrc.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/calculatecrc.h b/include/calculatecrc.h index 26a90df..a19a229 100644 --- a/include/calculatecrc.h +++ b/include/calculatecrc.h @@ -26,10 +26,8 @@ struct stH { uint64_t flashlen; // dyn char version[16]; // $DRIVER_INFO alignment! char platform_name[32]; // (hardware) headerfile - char date[6]; // dyn (format -> JB) - char padding1[2]; // padding byte - char mdate[6]; // modify date - char padding2[2]; // padding byte + char date[8]; // BCD encoded creation date (first two bytes unused) + char mdate[8]; // BCD encoded modification date (first two bytes unused) char platform_revision[4];// (hardware) headerfile uint32_t padding; uint64_t ui64CRC; // insert calculated CRC here