Message ID | 20171130053129.22642-1-oohall@gmail.com |
---|---|
State | Accepted |
Headers | show |
Series | [1/8] gard: Allow records with an ID of 0xffffffff | expand |
Oliver O'Halloran <oohall@gmail.com> writes: > We currently assume that a record with an ID of 0xffffffff is invalid. > Apparently this is incorrect and we should display these records, so > expand the check to compare the entire record with 0xff rather than > just the ID. > > Signed-off-by: Oliver O'Halloran <oohall@gmail.com> > --- > external/gard/gard.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) series merged to master as of daf9ff43cd0a2845a06b4f6cb209eab0111e13a3
diff --git a/external/gard/gard.c b/external/gard/gard.c index a49151653aa0..c280bbf710ba 100644 --- a/external/gard/gard.c +++ b/external/gard/gard.c @@ -42,8 +42,6 @@ #include "gard.h" -#define CLEARED_RECORD_ID 0xFFFFFFFF - #define FDT_PATH "/proc/device-tree" #define FDT_FSP_NODE FDT_PATH"/fsps" #define FDT_ACTIVE_FLASH_PATH FDT_PATH"/chosen/ibm,system-flash" @@ -326,9 +324,11 @@ int parse_path(const char *str, struct entity_path *parsed) return 0; } +static struct gard_record blank_record; + static bool is_valid_record(struct gard_record *g) { - return be32toh(g->record_id) != CLEARED_RECORD_ID; + return memcmp(&blank_record, g, sizeof(*g)); } static int do_iterate(struct gard_ctx *ctx, @@ -806,6 +806,7 @@ int main(int argc, char **argv) ctx = &_ctx; memset(ctx, 0, sizeof(*ctx)); + memset(&blank_record, 0xff, sizeof(blank_record)); if (is_fsp()) { fprintf(stderr, "This is the OpenPower gard tool which does "
We currently assume that a record with an ID of 0xffffffff is invalid. Apparently this is incorrect and we should display these records, so expand the check to compare the entire record with 0xff rather than just the ID. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> --- external/gard/gard.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)