From 742697cb98c5056f20cb0924f76aff63e0781173 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 6 Jun 2022 17:36:34 +0200 Subject: [PATCH] di-edid-decode: only print serial number if non-zero Upstream edid-decode hides the serial number in this case. The spec says that it's optional, and set to zero when unused. Signed-off-by: Simon Ser --- di-edid-decode.c | 4 +++- include/libdisplay-info/edid.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/di-edid-decode.c b/di-edid-decode.c index 87229d4..81e1dd8 100644 --- a/di-edid-decode.c +++ b/di-edid-decode.c @@ -168,7 +168,9 @@ main(void) printf(" Vendor & Product Identification:\n"); printf(" Manufacturer: %.3s\n", vendor_product->manufacturer); printf(" Model: %" PRIu16 "\n", vendor_product->product); - printf(" Serial Number: %" PRIu32 "\n", vendor_product->serial); + if (vendor_product->serial != 0) { + printf(" Serial Number: %" PRIu32 "\n", vendor_product->serial); + } if (vendor_product->model_year != 0) { printf(" Model year: %d\n", vendor_product->model_year); } else { diff --git a/include/libdisplay-info/edid.h b/include/libdisplay-info/edid.h index 4e78590..a65db90 100644 --- a/include/libdisplay-info/edid.h +++ b/include/libdisplay-info/edid.h @@ -36,7 +36,7 @@ di_edid_get_revision(const struct di_edid *edid); struct di_edid_vendor_product { char manufacturer[3]; uint16_t product; - uint32_t serial; + uint32_t serial; /* zero if unset */ /* These fields are zero if unset */ int manufacture_week;