From patchwork Tue Sep 26 16:33:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 9972319 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A68816037E for ; Tue, 26 Sep 2017 16:35:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96BC428EA0 for ; Tue, 26 Sep 2017 16:35:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8997D28EB5; Tue, 26 Sep 2017 16:35:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FEE428DD9 for ; Tue, 26 Sep 2017 16:35:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968950AbdIZQf5 (ORCPT ); Tue, 26 Sep 2017 12:35:57 -0400 Received: from guitar.tcltek.co.il ([192.115.133.116]:50074 "EHLO mx.tkos.co.il" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965387AbdIZQfz (ORCPT ); Tue, 26 Sep 2017 12:35:55 -0400 Received: from tarshish.tkos.co.il (unknown [10.0.8.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx.tkos.co.il (Postfix) with ESMTPSA id C92A44406D2; Tue, 26 Sep 2017 19:35:53 +0300 (IDT) From: Baruch Siach To: Hans Verkuil , Adam Jackson Cc: Linux Media Mailing List , Baruch Siach Subject: [PATCH 1/3] edid-decode: parse_cta: fix maybe uninitialized warning Date: Tue, 26 Sep 2017 19:33:38 +0300 Message-Id: <07a4901aea4f30db053028fd3a84806b7777ef64.1506443620.git.baruch@tkos.co.il> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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