From 74ecd54caba26722441cfa006deb299bfa1ee6b8 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 30 Dec 2008 00:18:31 -0200 Subject: af9013: Fix gcc false warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Mauro Carvalho Chehab drivers/media/dvb/frontends/af9013.c: In function ‘af9013_set_coeff’: drivers/media/dvb/frontends/af9013.c:231: warning: ‘ns_coeff2_8k’ may be used uninitialized in this function drivers/media/dvb/frontends/af9013.c:230: warning: ‘ns_coeff2_2k’ may be used uninitialized in this function drivers/media/dvb/frontends/af9013.c:229: warning: ‘ns_coeff1_8193nu’ may be used uninitialized in this function drivers/media/dvb/frontends/af9013.c:228: warning: ‘ns_coeff1_8192nu’ may be used uninitialized in this function drivers/media/dvb/frontends/af9013.c:227: warning: ‘ns_coeff1_8191nu’ may be used uninitialized in this function drivers/media/dvb/frontends/af9013.c:226: warning: ‘ns_coeff1_2048nu’ may be used uninitialized in this function drivers/media/dvb/frontends/af9013.c: In function ‘af9013_update_snr’: drivers/media/dvb/frontends/af9013.c:1012: warning: ‘snr_table’ may be used uninitialized in this function Priority: normal Signed-off-by: Mauro Carvalho Chehab CC: Antti Palosaari --- linux/drivers/media/dvb/frontends/af9013.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/linux/drivers/media/dvb/frontends/af9013.c b/linux/drivers/media/dvb/frontends/af9013.c index 692b68a9e..b2b50fb4c 100644 --- a/linux/drivers/media/dvb/frontends/af9013.c +++ b/linux/drivers/media/dvb/frontends/af9013.c @@ -223,12 +223,12 @@ static int af9013_set_coeff(struct af9013_state *state, fe_bandwidth_t bw) int ret = 0; u8 i = 0; u8 buf[24]; - u32 ns_coeff1_2048nu; - u32 ns_coeff1_8191nu; - u32 ns_coeff1_8192nu; - u32 ns_coeff1_8193nu; - u32 ns_coeff2_2k; - u32 ns_coeff2_8k; + u32 uninitialized_var(ns_coeff1_2048nu); + u32 uninitialized_var(ns_coeff1_8191nu); + u32 uninitialized_var(ns_coeff1_8192nu); + u32 uninitialized_var(ns_coeff1_8193nu); + u32 uninitialized_var(ns_coeff2_2k); + u32 uninitialized_var(ns_coeff2_8k); deb_info("%s: adc_clock:%d bw:%d\n", __func__, state->config.adc_clock, bw); @@ -1009,7 +1009,7 @@ static int af9013_update_snr(struct dvb_frontend *fe) int ret; u8 buf[3], i, len; u32 quant = 0; - struct snr_table *snr_table; + struct snr_table *uninitialized_var(snr_table); /* check if quantizer ready (for snr) */ ret = af9013_read_reg_bits(state, 0xd2e1, 3, 1, &buf[0]); -- cgit v1.2.3 From e3acd26b88b26b4b6e00b890278c72a66a6b7c10 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 30 Dec 2008 00:36:40 -0200 Subject: Fix compilation for kernels older than 2.6.28 From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- v4l/compat.h | 4 ++-- v4l/scripts/make_config_compat.pl | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/v4l/compat.h b/v4l/compat.h index de192e8cf..22281f6f9 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -339,8 +339,8 @@ usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd) #define list_first_entry(ptr, type, member) \ list_entry((ptr)->next, type, member) -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28) -#define netdev_priv(dev) (dev->priv) +#ifdef NEED_NETDEV_PRIV +#define netdev_priv(dev) ((dev)->priv) #endif /* diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl index 3a8bdd81e..8fb7a9441 100755 --- a/v4l/scripts/make_config_compat.pl +++ b/v4l/scripts/make_config_compat.pl @@ -197,6 +197,25 @@ sub check_algo_control() close INNET; } +sub check_net_dev() +{ + my $file = "$kdir/include/linux/netdevice.h"; + my $need_compat = 1; + + open INNET, "<$file" or die "File not found: $file"; + while () { + if (m/netdev_priv/) { + $need_compat = 0; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NEED_NETDEV_PRIV 1\n"; + } + close INNET; +} + sub check_other_dependencies() { check_spin_lock(); @@ -209,6 +228,7 @@ sub check_other_dependencies() check_proc_create(); check_pcm_lock(); check_algo_control(); + check_net_dev(); } # Do the basic rules -- cgit v1.2.3 From b368ca4c3ea78c6d07ee807cbf4f33913adfbc30 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 30 Dec 2008 00:44:20 -0200 Subject: zoran: fix warning for a variable not used MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Mauro Carvalho Chehab Fix this warning: drivers/media/video/zoran/zoran_card.c:156: warning: ‘zr36067_pci_tbl’ defined but not used Currently, zoran driver relies on a find routine that doesn't use the pci table. Priority: normal Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/zoran/zoran_card.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux/drivers/media/video/zoran/zoran_card.c b/linux/drivers/media/video/zoran/zoran_card.c index d5026ae51..639fa55e6 100644 --- a/linux/drivers/media/video/zoran/zoran_card.c +++ b/linux/drivers/media/video/zoran/zoran_card.c @@ -154,12 +154,14 @@ MODULE_DESCRIPTION("Zoran-36057/36067 JPEG codec driver"); MODULE_AUTHOR("Serguei Miridonov"); MODULE_LICENSE("GPL"); +#if 0 static struct pci_device_id zr36067_pci_tbl[] = { {PCI_VENDOR_ID_ZORAN, PCI_DEVICE_ID_ZORAN_36057, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {0} }; MODULE_DEVICE_TABLE(pci, zr36067_pci_tbl); +#endif int zoran_num; /* number of Buzs in use */ struct zoran *zoran[BUZ_MAX]; -- cgit v1.2.3