From patchwork Thu Nov 1 20:24:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Bolle X-Patchwork-Id: 1686321 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id EC15E3FE1F for ; Thu, 1 Nov 2012 20:24:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758641Ab2KAUYd (ORCPT ); Thu, 1 Nov 2012 16:24:33 -0400 Received: from cpsmtpb-ews01.kpnxchange.com ([213.75.39.4]:58330 "EHLO cpsmtpb-ews01.kpnxchange.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754260Ab2KAUYc (ORCPT ); Thu, 1 Nov 2012 16:24:32 -0400 Received: from cpsps-ews09.kpnxchange.com ([10.94.84.176]) by cpsmtpb-ews01.kpnxchange.com with Microsoft SMTPSVC(7.5.7601.17514); Thu, 1 Nov 2012 21:24:10 +0100 Received: from CPSMTPM-TLF102.kpnxchange.com ([195.121.3.5]) by cpsps-ews09.kpnxchange.com with Microsoft SMTPSVC(7.5.7601.17514); Thu, 1 Nov 2012 21:24:10 +0100 Received: from [192.168.1.101] ([212.123.169.34]) by CPSMTPM-TLF102.kpnxchange.com with Microsoft SMTPSVC(7.5.7601.17514); Thu, 1 Nov 2012 21:24:30 +0100 Message-ID: <1351801470.1597.13.camel@x61.thuisdomein> Subject: [PATCH] [media] budget-av: only use t_state if initialized From: Paul Bolle To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 01 Nov 2012 21:24:30 +0100 X-Mailer: Evolution 3.4.4 (3.4.4-2.fc17) Mime-Version: 1.0 X-OriginalArrivalTime: 01 Nov 2012 20:24:30.0611 (UTC) FILETIME=[E5DECE30:01CDB86E] X-RcptDomain: vger.kernel.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Building budget-av.o triggers this GCC warning: In file included from drivers/media/pci/ttpci/budget-av.c:44:0: drivers/media/dvb-frontends/tda8261_cfg.h: In function ‘tda8261_get_bandwidth’: drivers/media/dvb-frontends/tda8261_cfg.h:68:21: warning: ‘t_state.bandwidth’ may be used uninitialized in this function [-Wuninitialized] Move the printk() that uses t_state.bandwith to the location where it should be initialized to fix this. Signed-off-by: Paul Bolle --- 0) Compile tested only. 1) By the way, the first two if()-tests in tda8261_get_bandwidth() should be superfluous. And the first two if()-tests in both tda8261_get_frequency() and tda8261_set_frequency() look bogus to me, as they should always succeed. If that's correct, there are some cleanups possible in this header. drivers/media/dvb-frontends/tda8261_cfg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/tda8261_cfg.h b/drivers/media/dvb-frontends/tda8261_cfg.h index 1af1ee4..4671074 100644 --- a/drivers/media/dvb-frontends/tda8261_cfg.h +++ b/drivers/media/dvb-frontends/tda8261_cfg.h @@ -78,7 +78,7 @@ static int tda8261_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth) return err; } *bandwidth = t_state.bandwidth; + printk("%s: Bandwidth=%d\n", __func__, t_state.bandwidth); } - printk("%s: Bandwidth=%d\n", __func__, t_state.bandwidth); return 0; }