* [PATCH 1/3] edid-decode: parse_cta: fix maybe uninitialized warning
@ 2017-09-26 16:33 Baruch Siach
2017-09-26 16:33 ` [PATCH 2/3] edid-decode: detailed_block: " Baruch Siach
2017-09-26 16:33 ` [PATCH 3/3] edid-decode: parse_extension: " Baruch Siach
0 siblings, 2 replies; 3+ messages in thread
From: Baruch Siach @ 2017-09-26 16:33 UTC (permalink / raw)
To: Hans Verkuil, Adam Jackson; +Cc: Linux Media Mailing List, Baruch Siach
Fix the following warning:
edid-decode.c: In function ‘parse_cta’:
edid-decode.c:142:5: warning: ‘v’ may be used uninitialized in this function [-Wmaybe-uninitialized]
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
edid-decode.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/edid-decode.c b/edid-decode.c
index 5592227d1db5..3df35ec6d07f 100644
--- a/edid-decode.c
+++ b/edid-decode.c
@@ -124,7 +124,7 @@ struct field {
static void
decode_value(struct field *field, int val, const char *prefix)
{
- struct value *v;
+ struct value *v = NULL;
int i;
for (i = 0; i < field->n_values; i++) {
@@ -139,7 +139,8 @@ decode_value(struct field *field, int val, const char *prefix)
return;
}
- printf("%s%s: %s (%d)\n", prefix, field->name, v->description, val);
+ printf("%s%s: %s (%d)\n", prefix, field->name,
+ v ? v->description : "unknown", val);
}
static void
--
2.14.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/3] edid-decode: detailed_block: fix maybe uninitialized warning
2017-09-26 16:33 [PATCH 1/3] edid-decode: parse_cta: fix maybe uninitialized warning Baruch Siach
@ 2017-09-26 16:33 ` Baruch Siach
2017-09-26 16:33 ` [PATCH 3/3] edid-decode: parse_extension: " Baruch Siach
1 sibling, 0 replies; 3+ messages in thread
From: Baruch Siach @ 2017-09-26 16:33 UTC (permalink / raw)
To: Hans Verkuil, Adam Jackson; +Cc: Linux Media Mailing List, Baruch Siach
Fix the following warnings:
edid-decode.c: In function ‘detailed_block’:
edid-decode.c:394:2: warning: ‘width’ may be used uninitialized in this function [-Wmaybe-uninitialized]
edid-decode.c:394:2: warning: ‘ratio’ may be used uninitialized in this function [-Wmaybe-uninitialized]
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
edid-decode.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/edid-decode.c b/edid-decode.c
index 3df35ec6d07f..4abd79333d61 100644
--- a/edid-decode.c
+++ b/edid-decode.c
@@ -348,6 +348,10 @@ detailed_cvt_descriptor(unsigned char *x, int first)
width = 8 * (((height * 15) / 9) / 8);
ratio = "15:9";
break;
+ default:
+ width = 0;
+ ratio = "unknown";
+ break;
}
if (x[1] & 0x03)
--
2.14.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 3/3] edid-decode: parse_extension: fix maybe uninitialized warning
2017-09-26 16:33 [PATCH 1/3] edid-decode: parse_cta: fix maybe uninitialized warning Baruch Siach
2017-09-26 16:33 ` [PATCH 2/3] edid-decode: detailed_block: " Baruch Siach
@ 2017-09-26 16:33 ` Baruch Siach
1 sibling, 0 replies; 3+ messages in thread
From: Baruch Siach @ 2017-09-26 16:33 UTC (permalink / raw)
To: Hans Verkuil, Adam Jackson; +Cc: Linux Media Mailing List, Baruch Siach
Fix the following warning:
edid-decode.c: In function ‘main’:
edid-decode.c:2962:26: warning: ‘conformant_extension’ may be used uninitialized in this function [-Wmaybe-uninitialized]
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
edid-decode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/edid-decode.c b/edid-decode.c
index 4abd79333d61..d3aafa926900 100644
--- a/edid-decode.c
+++ b/edid-decode.c
@@ -2397,7 +2397,7 @@ extension_version(unsigned char *x)
static int
parse_extension(unsigned char *x)
{
- int conformant_extension;
+ int conformant_extension = 0;
printf("\n");
switch(x[0]) {
--
2.14.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-09-26 16:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-26 16:33 [PATCH 1/3] edid-decode: parse_cta: fix maybe uninitialized warning Baruch Siach
2017-09-26 16:33 ` [PATCH 2/3] edid-decode: detailed_block: " Baruch Siach
2017-09-26 16:33 ` [PATCH 3/3] edid-decode: parse_extension: " Baruch Siach
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).