Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] b2c2: flexcop: avoid unused function warnings

The flexcop driver has two functions that are normally used, except
when multiple frontend drivers are disabled:

drivers/media/common/b2c2/flexcop-fe-tuner.c:42:12: warning: 'flexcop_set_voltage' defined but not used [-Wunused-function]
drivers/media/common/b2c2/flexcop-fe-tuner.c:71:12: warning: 'flexcop_sleep' defined but not used [-Wunused-function]

This avoids the build warning by updating the #ifdef for flexcop_set_voltage
to the exact condition under which it is used. For flexcop_sleep, the
condition is rather complex, so I resort to marking it as __maybe_unused,
so the compiler can silently drop it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Arnd Bergmann and committed by
Mauro Carvalho Chehab
733d0def b97baa3e

+2 -2
+2 -2
drivers/media/common/b2c2/flexcop-fe-tuner.c
··· 38 38 #endif 39 39 40 40 /* lnb control */ 41 - #if FE_SUPPORTED(MT312) || FE_SUPPORTED(STV0299) 41 + #if (FE_SUPPORTED(MT312) || FE_SUPPORTED(STV0299)) && FE_SUPPORTED(PLL) 42 42 static int flexcop_set_voltage(struct dvb_frontend *fe, 43 43 enum fe_sec_voltage voltage) 44 44 { ··· 68 68 #endif 69 69 70 70 #if FE_SUPPORTED(S5H1420) || FE_SUPPORTED(STV0299) || FE_SUPPORTED(MT312) 71 - static int flexcop_sleep(struct dvb_frontend* fe) 71 + static int __maybe_unused flexcop_sleep(struct dvb_frontend* fe) 72 72 { 73 73 struct flexcop_device *fc = fe->dvb->priv; 74 74 if (fc->fe_sleep)