diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2017-11-08 19:59:09 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-11-20 20:35:24 -0600 |
commit | 1e038388f385eea2cbc0dae803442dc1fc140372 (patch) | |
tree | 57ce88a5d98b31adb8e7929c96b225fa6bc1ec16 /external | |
parent | 5d4241ddaf441bc357b4219154d3af1ff7c95cc9 (diff) | |
download | talos-skiboot-1e038388f385eea2cbc0dae803442dc1fc140372.tar.gz talos-skiboot-1e038388f385eea2cbc0dae803442dc1fc140372.zip |
gard: Replace is_valid_id with is_valid_record()
It was annoying me.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'external')
-rw-r--r-- | external/gard/gard.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/external/gard/gard.c b/external/gard/gard.c index 9505293d..0c8ac47e 100644 --- a/external/gard/gard.c +++ b/external/gard/gard.c @@ -182,9 +182,9 @@ static const char *path_type_to_str(enum path_type t) return "Unknown"; } -static bool is_valid_id(uint32_t record_id) +static bool is_valid_record(struct gard_record *g) { - return record_id != CLEARED_RECORD_ID; + return be32toh(g->record_id) != CLEARED_RECORD_ID; } static int do_iterate(struct gard_ctx *ctx, @@ -246,7 +246,7 @@ static int count_valid_records_i(struct gard_ctx *ctx, int pos, struct gard_reco if (!gard || !priv) return -1; - if (is_valid_id(be32toh(gard->record_id))) + if (is_valid_record(gard)) (*(int *)priv)++; return 0; @@ -272,7 +272,7 @@ static int do_list_i(struct gard_ctx *ctx, int pos, struct gard_record *gard, vo if (!gard) return -1; - if (is_valid_id(be32toh(gard->record_id))) + if (is_valid_record(gard)) printf("| %08x | %08x | %-15s |\n", be32toh(gard->record_id), be32toh(gard->errlog_eid), path_type_to_str(gard->target_id.type_size >> PATH_TYPE_SHIFT)); |