]> git.baikalelectronics.ru Git - kernel.git/commit
[media] tda18212: tda18218: use 'val' if initialized
authorPaul Bolle <pebolle@tiscali.nl>
Thu, 1 Nov 2012 20:00:09 +0000 (17:00 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 21 Dec 2012 20:25:13 +0000 (18:25 -0200)
commit80f7d68fc3899e29920d3b377dd83250a685f965
tree73a42c53539da33dc2c88bec6b012592c6c4cb65
parente335cf49c0ad9215e72d26c341d8e380a4dd4c9e
[media] tda18212: tda18218: use 'val' if initialized

Commits e67d4813c137ee88234e47ac5dabc5d89fec4d29 ("[media] tda18212:
silence compiler warning") and 97cc0a00dd17da63885f27e6813d82ff28a0ef67
("[media] tda18218: silence compiler warning") silenced warnings
equivalent to these:
    drivers/media/tuners/tda18212.c: In function ‘tda18212_attach’:
    drivers/media/tuners/tda18212.c:299:2: warning: ‘val’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    drivers/media/tuners/tda18218.c: In function ‘tda18218_attach’:
    drivers/media/tuners/tda18218.c:305:2: warning: ‘val’ may be used uninitialized in this function [-Wmaybe-uninitialized]
But in both cases 'val' will still be used uninitialized if the calls
of tda18212_rd_reg() or tda18218_rd_reg() fail. Fix this by only
printing the "chip id" if the calls of those functions were successful.
This allows to drop the uninitialized_var() stopgap measure.
Also stop printing the return values of tda18212_rd_reg() or
tda18218_rd_reg(), as these are not interesting.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/tuners/tda18212.c
drivers/media/tuners/tda18218.c