diff mbox

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

Message ID 1470252884-16602-5-git-send-email-thuth@redhat.com
State Accepted
Headers show

Commit Message

Thomas Huth Aug. 3, 2016, 7:34 p.m. UTC
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@redhat.com>
---
 include/calculatecrc.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox

Patch

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