Skip to content

Commit 86628ad

Browse files
jeff-lien-sndkigaw
authored andcommitted
ocp: Fix timestamp displayed by fw-activate-history command
The current code is displaying all 8 bytes of the timestamp field for the timestamp. The timestamp value is only in the first 6 bytes. The 7th byte contains the origin and synch fields and the 8th byte is reserved. Signed-off-by: jeff-lien-wdc <jeff.lien@wdc.com>
1 parent cd4c95a commit 86628ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/ocp/ocp-fw-activation-history.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static void ocp_fw_activation_history_normal(const struct fw_activation_history
6666
printf(" %-22s%d\n", "activation count:",
6767
le16_to_cpu(entry->activation_count));
6868
printf(" %-22s%"PRIu64"\n", "timestamp:",
69-
le64_to_cpu(entry->timestamp));
69+
(0x0000FFFFFFFFFFFF & le64_to_cpu(entry->timestamp)));
7070
printf(" %-22s%"PRIu64"\n", "power cycle count:",
7171
le64_to_cpu(entry->power_cycle_count));
7272
printf(" %-22s%.*s\n", "previous firmware:", (int)sizeof(entry->previous_fw),
@@ -106,7 +106,7 @@ static void ocp_fw_activation_history_json(const struct fw_activation_history *f
106106
json_object_add_value_uint(entry_obj, "activation count",
107107
le16_to_cpu(entry->activation_count));
108108
json_object_add_value_uint64(entry_obj, "timestamp",
109-
le64_to_cpu(entry->timestamp));
109+
(0x0000FFFFFFFFFFFF & le64_to_cpu(entry->timestamp)));
110110
json_object_add_value_uint(entry_obj, "power cycle count",
111111
le64_to_cpu(entry->power_cycle_count));
112112

0 commit comments

Comments
 (0)