[SLOF] [PATCH 4/4] Remove misleading padding fields from ROM header definition

Thomas Huth thuth at redhat.com
Thu Aug 4 05:34:44 AEST 2016

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 <thuth at redhat.com>
 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

More information about the SLOF mailing list