All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] si2135: Declare the structs even if frontend is not enabled
@ 2014-07-28 13:38 Mauro Carvalho Chehab
  2014-07-29  5:38 ` Matthias Schwarzott
  0 siblings, 1 reply; 2+ messages in thread
From: Mauro Carvalho Chehab @ 2014-07-28 13:38 UTC (permalink / raw)
  To: Matthias Schwarzott
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List, Mauro Carvalho Chehab

As reported by Kbuildtest:

   In file included from drivers/media/usb/cx231xx/cx231xx-dvb.c:35:0:
   drivers/media/dvb-frontends/si2165.h:57:9: warning: 'struct si2165_config' declared inside parameter list [enabled by default]
     struct i2c_adapter *i2c)
            ^
   drivers/media/dvb-frontends/si2165.h:57:9: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
   drivers/media/usb/cx231xx/cx231xx-dvb.c:157:21: error: variable 'hauppauge_930C_HD_1113xx_si2165_config' has initializer but incomplete type
    static const struct si2165_config hauppauge_930C_HD_1113xx_si2165_config = {
                        ^
   drivers/media/usb/cx231xx/cx231xx-dvb.c:158:2: error: unknown field 'i2c_addr' specified in initializer
     .i2c_addr = 0x64,
     ^
   drivers/media/usb/cx231xx/cx231xx-dvb.c:158:2: warning: excess elements in struct initializer [enabled by default]
   drivers/media/usb/cx231xx/cx231xx-dvb.c:158:2: warning: (near initialization for 'hauppauge_930C_HD_1113xx_si2165_config') [enabled by default]
   drivers/media/usb/cx231xx/cx231xx-dvb.c:159:2: error: unknown field 'chip_mode' specified in initializer
     .chip_mode = SI2165_MODE_PLL_XTAL,
     ^
   drivers/media/usb/cx231xx/cx231xx-dvb.c:159:15: error: 'SI2165_MODE_PLL_XTAL' undeclared here (not in a function)
     .chip_mode = SI2165_MODE_PLL_XTAL,
                  ^
   drivers/media/usb/cx231xx/cx231xx-dvb.c:159:2: warning: excess elements in struct initializer [enabled by default]
     .chip_mode = SI2165_MODE_PLL_XTAL,
     ^
   drivers/media/usb/cx231xx/cx231xx-dvb.c:159:2: warning: (near initialization for 'hauppauge_930C_HD_1113xx_si2165_config') [enabled by default]
   drivers/media/usb/cx231xx/cx231xx-dvb.c:160:2: error: unknown field 'ref_freq_Hz' specified in initializer
     .ref_freq_Hz = 16000000,
     ^
   drivers/media/usb/cx231xx/cx231xx-dvb.c:160:2: warning: excess elements in struct initializer [enabled by default]
   drivers/media/usb/cx231xx/cx231xx-dvb.c:160:2: warning: (near initialization for 'hauppauge_930C_HD_1113xx_si2165_config') [enabled by default]
>> drivers/media/usb/cx231xx/cx231xx-dvb.c:163:21: error: variable 'pctv_quatro_stick_1114xx_si2165_config' has initializer but incomplete type
    static const struct si2165_config pctv_quatro_stick_1114xx_si2165_config = {
                        ^
   drivers/media/usb/cx231xx/cx231xx-dvb.c:164:2: error: unknown field 'i2c_addr' specified in initializer
     .i2c_addr = 0x64,
     ^
   drivers/media/usb/cx231xx/cx231xx-dvb.c:164:2: warning: excess elements in struct initializer [enabled by default]
>> drivers/media/usb/cx231xx/cx231xx-dvb.c:164:2: warning: (near initialization for 'pctv_quatro_stick_1114xx_si2165_config') [enabled by default]
   drivers/media/usb/cx231xx/cx231xx-dvb.c:165:2: error: unknown field 'chip_mode' specified in initializer
     .chip_mode = SI2165_MODE_PLL_EXT,
     ^
>> drivers/media/usb/cx231xx/cx231xx-dvb.c:165:15: error: 'SI2165_MODE_PLL_EXT' undeclared here (not in a function)
     .chip_mode = SI2165_MODE_PLL_EXT,
                  ^
   drivers/media/usb/cx231xx/cx231xx-dvb.c:165:2: warning: excess elements in struct initializer [enabled by default]
     .chip_mode = SI2165_MODE_PLL_EXT,
     ^
>> drivers/media/usb/cx231xx/cx231xx-dvb.c:165:2: warning: (near initialization for 'pctv_quatro_stick_1114xx_si2165_config') [enabled by default]
   drivers/media/usb/cx231xx/cx231xx-dvb.c:166:2: error: unknown field 'ref_freq_Hz' specified in initializer
     .ref_freq_Hz = 24000000,
     ^
   drivers/media/usb/cx231xx/cx231xx-dvb.c:166:2: warning: excess elements in struct initializer [enabled by default]
>> drivers/media/usb/cx231xx/cx231xx-dvb.c:166:2: warning: (near initialization for 'pctv_quatro_stick_1114xx_si2165_config') [enabled by default]
   drivers/media/usb/cx231xx/cx231xx-dvb.c: In function 'dvb_init':
   drivers/media/usb/cx231xx/cx231xx-dvb.c:731:3: warning: passing argument 1 of 'si2165_attach' from incompatible pointer type [enabled by default]
      dev->dvb->frontend = dvb_attach(si2165_attach,
      ^
   In file included from drivers/media/usb/cx231xx/cx231xx-dvb.c:35:0:
   drivers/media/dvb-frontends/si2165.h:55:36: note: expected 'const struct si2165_config *' but argument is of type 'const struct si2165_config *'
    static inline struct dvb_frontend *si2165_attach(
                                       ^
   drivers/media/usb/cx231xx/cx231xx-dvb.c:764:3: warning: passing argument 1 of 'si2165_attach' from incompatible pointer type [enabled by default]
      dev->dvb->frontend = dvb_attach(si2165_attach,
      ^
   In file included from drivers/media/usb/cx231xx/cx231xx-dvb.c:35:0:
   drivers/media/dvb-frontends/si2165.h:55:36: note: expected 'const struct si2165_config *' but argument is of type 'const struct si2165_config *'
    static inline struct dvb_frontend *si2165_attach(
                                       ^

That happens because the frontend was disabled by .config, but the
si2165_attach void stub require those structs, and also the
drivers that call it.

While here, remove the duplicated info about the possible I2C
addresses.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
---
 drivers/media/dvb-frontends/si2165.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/media/dvb-frontends/si2165.h b/drivers/media/dvb-frontends/si2165.h
index 7a6b59ded4e2..efaa08123b92 100644
--- a/drivers/media/dvb-frontends/si2165.h
+++ b/drivers/media/dvb-frontends/si2165.h
@@ -22,8 +22,6 @@
 
 #include <linux/dvb/frontend.h>
 
-#if IS_ENABLED(CONFIG_DVB_SI2165)
-
 enum {
 	SI2165_MODE_OFF = 0x00,
 	SI2165_MODE_PLL_EXT = 0x20,
@@ -47,7 +45,7 @@ struct si2165_config {
 	bool inversion;
 };
 
-/* Addresses: 0x64,0x65,0x66,0x67 */
+#if IS_ENABLED(CONFIG_DVB_SI2165)
 struct dvb_frontend *si2165_attach(
 	const struct si2165_config *config,
 	struct i2c_adapter *i2c);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] si2135: Declare the structs even if frontend is not enabled
  2014-07-28 13:38 [PATCH] si2135: Declare the structs even if frontend is not enabled Mauro Carvalho Chehab
@ 2014-07-29  5:38 ` Matthias Schwarzott
  0 siblings, 0 replies; 2+ messages in thread
From: Matthias Schwarzott @ 2014-07-29  5:38 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List, Mauro Carvalho Chehab

On 28.07.2014 15:38, Mauro Carvalho Chehab wrote:
> As reported by Kbuildtest:
> 
>    In file included from drivers/media/usb/cx231xx/cx231xx-dvb.c:35:0:
>    drivers/media/dvb-frontends/si2165.h:57:9: warning: 'struct si2165_config' declared inside parameter list [enabled by default]
>      struct i2c_adapter *i2c)
>             ^
>    drivers/media/dvb-frontends/si2165.h:57:9: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
>    drivers/media/usb/cx231xx/cx231xx-dvb.c:157:21: error: variable 'hauppauge_930C_HD_1113xx_si2165_config' has initializer but incomplete type
>     static const struct si2165_config hauppauge_930C_HD_1113xx_si2165_config = {
>                         ^
>    drivers/media/usb/cx231xx/cx231xx-dvb.c:158:2: error: unknown field 'i2c_addr' specified in initializer
>      .i2c_addr = 0x64,
>      ^

Good catch.

Matthias

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-29  5:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-28 13:38 [PATCH] si2135: Declare the structs even if frontend is not enabled Mauro Carvalho Chehab
2014-07-29  5:38 ` Matthias Schwarzott

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.