[PATCH edid-decode 3/3] Adjust broken header warning message

Tormod Volden lists.tormod at gmail.com
Tue Dec 20 13:17:26 PST 2011


From: Tormod Volden <debian.tormod at gmail.com>

Do not check edid pointer since it was already done.

Remove commented return statement.

Also separate declaration from code, which fixes remaining
gcc -pedantic warnings.

Signed-off-by: Tormod Volden <debian.tormod at gmail.com>
---
 edid-decode.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/edid-decode.c b/edid-decode.c
index 3244ae1..f2b416e 100644
--- a/edid-decode.c
+++ b/edid-decode.c
@@ -939,9 +939,8 @@ int main(int argc, char **argv)
 
     dump_breakdown(edid);
 
-    if (!edid || memcmp(edid, "\x00\xFF\xFF\xFF\xFF\xFF\xFF\x00", 8)) {
-	printf("No header found\n");
-	// return 1;
+    if (memcmp(edid, "\x00\xFF\xFF\xFF\xFF\xFF\xFF\x00", 8)) {
+	printf("No valid header found\n");
     }
 
     printf("EDID version: %hd.%hd\n", edid[0x12], edid[0x13]);
@@ -1021,9 +1020,10 @@ int main(int argc, char **argv)
 	if (!nonconformant_digital_display)
 	    nonconformant_digital_display = edid[0x14] & conformance_mask;
     } else {
-	analog = 1;
 	int voltage = (edid[0x14] & 0x60) >> 5;
 	int sync = (edid[0x14] & 0x0F);
+
+	analog = 1;
 	printf("Analog display, Input voltage level: %s V\n",
 	       voltage == 3 ? "0.7/0.7" :
 	       voltage == 2 ? "1.0/0.4" :
-- 
1.7.5.4



More information about the xorg-devel mailing list