mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* drivers/staging/media/av7110/av7110.c:162: warning: cannot understand function prototype: '} else if (av7110_init_analog_module(av7110) == 0) '
@ 2025-04-26 13:54 kernel test robot
  2025-04-26 21:54 ` [PATCH] media: av7110: Workaround a compiler warning Stefan Herdler
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2025-04-26 13:54 UTC (permalink / raw)
  To: Stefan Herdler; +Cc: oe-kbuild-all, linux-kernel, Hans Verkuil

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   02ddfb981de88a2c15621115dd7be2431252c568
commit: 3c08dc38e3cf018a74c64e75cebcc803d973196c media: av7110: coding style fixes: comparsations
date:   11 months ago
config: x86_64-buildonly-randconfig-001-20250426 (https://download.01.org/0day-ci/archive/20250426/202504262127.FkkWHzfs-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250426/202504262127.FkkWHzfs-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202504262127.FkkWHzfs-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/staging/media/av7110/av7110.c:162: warning: cannot understand function prototype: '} else if (av7110_init_analog_module(av7110) == 0) '


vim +162 drivers/staging/media/av7110/av7110.c

   112	
   113	static void init_av7110_av(struct av7110 *av7110)
   114	{
   115		int ret;
   116		struct saa7146_dev *dev = av7110->dev;
   117	
   118		/* set internal volume control to maximum */
   119		av7110->adac_type = DVB_ADAC_TI;
   120		ret = av7110_set_volume(av7110, av7110->mixer.volume_left, av7110->mixer.volume_right);
   121		if (ret < 0)
   122			printk("dvb-ttpci:cannot set internal volume to maximum:%d\n",ret);
   123	
   124		ret = av7110_fw_cmd(av7110, COMTYPE_ENCODER, SetMonitorType,
   125				    1, (u16)av7110->display_ar);
   126		if (ret < 0)
   127			printk("dvb-ttpci: unable to set aspect ratio\n");
   128		ret = av7110_fw_cmd(av7110, COMTYPE_ENCODER, SetPanScanType,
   129				    1, av7110->display_panscan);
   130		if (ret < 0)
   131			printk("dvb-ttpci: unable to set pan scan\n");
   132	
   133		ret = av7110_fw_cmd(av7110, COMTYPE_ENCODER, SetWSSConfig, 2, 2, wss_cfg_4_3);
   134		if (ret < 0)
   135			printk("dvb-ttpci: unable to configure 4:3 wss\n");
   136		ret = av7110_fw_cmd(av7110, COMTYPE_ENCODER, SetWSSConfig, 2, 3, wss_cfg_16_9);
   137		if (ret < 0)
   138			printk("dvb-ttpci: unable to configure 16:9 wss\n");
   139	
   140		ret = av7710_set_video_mode(av7110, vidmode);
   141		if (ret < 0)
   142			printk("dvb-ttpci:cannot set video mode:%d\n",ret);
   143	
   144		/* handle different card types */
   145		/* remaining inits according to card and frontend type */
   146		av7110->analog_tuner_flags = 0;
   147		av7110->current_input = 0;
   148		if (dev->pci->subsystem_vendor == 0x13c2 && dev->pci->subsystem_device == 0x000a)
   149			av7110_fw_cmd(av7110, COMTYPE_AUDIODAC, ADSwitch, 1, 0); // SPDIF on
   150		if (i2c_writereg(av7110, 0x20, 0x00, 0x00) == 1) {
   151			printk ("dvb-ttpci: Crystal audio DAC @ card %d detected\n",
   152				av7110->dvb_adapter.num);
   153			av7110->adac_type = DVB_ADAC_CRYSTAL;
   154			i2c_writereg(av7110, 0x20, 0x01, 0xd2);
   155			i2c_writereg(av7110, 0x20, 0x02, 0x49);
   156			i2c_writereg(av7110, 0x20, 0x03, 0x00);
   157			i2c_writereg(av7110, 0x20, 0x04, 0x00);
   158	
   159			/**
   160			 * some special handling for the Siemens DVB-C cards...
   161			 */
 > 162		} else if (av7110_init_analog_module(av7110) == 0) {
   163			/* done. */
   164		} else if (dev->pci->subsystem_vendor == 0x110a) {
   165			printk("dvb-ttpci: DVB-C w/o analog module @ card %d detected\n",
   166				av7110->dvb_adapter.num);
   167			av7110->adac_type = DVB_ADAC_NONE;
   168		} else {
   169			av7110->adac_type = adac;
   170			printk("dvb-ttpci: adac type set to %d @ card %d\n",
   171				av7110->adac_type, av7110->dvb_adapter.num);
   172		}
   173	
   174		if (av7110->adac_type == DVB_ADAC_NONE || av7110->adac_type == DVB_ADAC_MSP34x0) {
   175			// switch DVB SCART on
   176			ret = av7110_fw_cmd(av7110, COMTYPE_AUDIODAC, MainSwitch, 1, 0);
   177			if (ret < 0)
   178				printk("dvb-ttpci:cannot switch on SCART(Main):%d\n",ret);
   179			ret = av7110_fw_cmd(av7110, COMTYPE_AUDIODAC, ADSwitch, 1, 1);
   180			if (ret < 0)
   181				printk("dvb-ttpci:cannot switch on SCART(AD):%d\n",ret);
   182			if (rgb_on &&
   183			    ((av7110->dev->pci->subsystem_vendor == 0x110a) ||
   184			     (av7110->dev->pci->subsystem_vendor == 0x13c2)) &&
   185			     (av7110->dev->pci->subsystem_device == 0x0000)) {
   186				saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTHI); // RGB on, SCART pin 16
   187				//saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); // SCARTpin 8
   188			}
   189		}
   190	
   191		if (dev->pci->subsystem_vendor == 0x13c2 && dev->pci->subsystem_device == 0x000e)
   192			av7110_fw_cmd(av7110, COMTYPE_AUDIODAC, SpdifSwitch, 1, 0); // SPDIF on
   193	
   194		ret = av7110_set_volume(av7110, av7110->mixer.volume_left, av7110->mixer.volume_right);
   195		if (ret < 0)
   196			printk("dvb-ttpci:cannot set volume :%d\n",ret);
   197	}
   198	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* [PATCH] media: av7110: Workaround a compiler warning
  2025-04-26 13:54 drivers/staging/media/av7110/av7110.c:162: warning: cannot understand function prototype: '} else if (av7110_init_analog_module(av7110) == 0) ' kernel test robot
@ 2025-04-26 21:54 ` Stefan Herdler
  2025-06-20 13:33   ` Hans Verkuil
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Herdler @ 2025-04-26 21:54 UTC (permalink / raw)
  To: lkp; +Cc: herdler, hverkuil, linux-kernel, oe-kbuild-all

Avoid compiler warning caused by an empty block statement.

Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202504262127.FkkWHzfs-lkp@intel.com/
---

I could not reproduce this warning with gcc10 here, but I already had similar
warnings with gcc12 on other projects.
I think it has most probably been triggered by the empty block statement.

I'm pretty confident this patch will fix the warning, but not 100% sure.

The kernel test robot will pick this patch and test is anyway, if I'm correct.
Let's wait, if it complains again.
That's the best I can do right now.

Regards
Stefan


 drivers/staging/media/av7110/av7110.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c
index bc9a2a40a..962536ed7 100644
--- a/drivers/staging/media/av7110/av7110.c
+++ b/drivers/staging/media/av7110/av7110.c
@@ -159,7 +159,7 @@ static void init_av7110_av(struct av7110 *av7110)
 		 * some special handling for the Siemens DVB-C cards...
 		 */
 	} else if (av7110_init_analog_module(av7110) == 0) {
-		/* done. */
+		goto init_skip_analog_module;
 	} else if (dev->pci->subsystem_vendor == 0x110a) {
 		pr_info("DVB-C w/o analog module @ card %d detected\n", av7110->dvb_adapter.num);
 		av7110->adac_type = DVB_ADAC_NONE;
@@ -168,6 +168,7 @@ static void init_av7110_av(struct av7110 *av7110)
 		pr_info("adac type set to %d @ card %d\n", av7110->adac_type, av7110->dvb_adapter.num);
 	}
 
+init_skip_analog_module:
 	if (av7110->adac_type == DVB_ADAC_NONE || av7110->adac_type == DVB_ADAC_MSP34x0) {
 		// switch DVB SCART on
 		ret = av7110_fw_cmd(av7110, COMTYPE_AUDIODAC, MainSwitch, 1, 0);
-- 
2.34.0


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

* Re: [PATCH] media: av7110: Workaround a compiler warning
  2025-04-26 21:54 ` [PATCH] media: av7110: Workaround a compiler warning Stefan Herdler
@ 2025-06-20 13:33   ` Hans Verkuil
  2025-06-24  3:36     ` Stefan Herdler
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Verkuil @ 2025-06-20 13:33 UTC (permalink / raw)
  To: Stefan Herdler, lkp; +Cc: hverkuil, linux-kernel, oe-kbuild-all

Hi Stefan,

On 26/04/2025 23:54, Stefan Herdler wrote:
> Avoid compiler warning caused by an empty block statement.
> 
> Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202504262127.FkkWHzfs-lkp@intel.com/
> ---
> 
> I could not reproduce this warning with gcc10 here, but I already had similar
> warnings with gcc12 on other projects.
> I think it has most probably been triggered by the empty block statement.
> 
> I'm pretty confident this patch will fix the warning, but not 100% sure.
> 
> The kernel test robot will pick this patch and test is anyway, if I'm correct.
> Let's wait, if it complains again.
> That's the best I can do right now.

Is this patch still needed? I noticed that it wasn't CC-ed to the linux-media
mailinglist, so it never appeared in patchwork, and was never picked up.

If it is still needed, then please post it to linux-media and it will be
picked up for v6.17.

Regards,

	Hans

> 
> Regards
> Stefan
> 
> 
>  drivers/staging/media/av7110/av7110.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c
> index bc9a2a40a..962536ed7 100644
> --- a/drivers/staging/media/av7110/av7110.c
> +++ b/drivers/staging/media/av7110/av7110.c
> @@ -159,7 +159,7 @@ static void init_av7110_av(struct av7110 *av7110)
>  		 * some special handling for the Siemens DVB-C cards...
>  		 */
>  	} else if (av7110_init_analog_module(av7110) == 0) {
> -		/* done. */
> +		goto init_skip_analog_module;
>  	} else if (dev->pci->subsystem_vendor == 0x110a) {
>  		pr_info("DVB-C w/o analog module @ card %d detected\n", av7110->dvb_adapter.num);
>  		av7110->adac_type = DVB_ADAC_NONE;
> @@ -168,6 +168,7 @@ static void init_av7110_av(struct av7110 *av7110)
>  		pr_info("adac type set to %d @ card %d\n", av7110->adac_type, av7110->dvb_adapter.num);
>  	}
>  
> +init_skip_analog_module:
>  	if (av7110->adac_type == DVB_ADAC_NONE || av7110->adac_type == DVB_ADAC_MSP34x0) {
>  		// switch DVB SCART on
>  		ret = av7110_fw_cmd(av7110, COMTYPE_AUDIODAC, MainSwitch, 1, 0);


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

* Re: [PATCH] media: av7110: Workaround a compiler warning
  2025-06-20 13:33   ` Hans Verkuil
@ 2025-06-24  3:36     ` Stefan Herdler
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Herdler @ 2025-06-24  3:36 UTC (permalink / raw)
  To: Hans Verkuil, lkp; +Cc: hverkuil, linux-kernel, oe-kbuild-all

Hi Hans,

On 20/06/25 15:33 Hans Verkuil wrote:
> Hi Stefan,
> 
> On 26/04/2025 23:54, Stefan Herdler wrote:
>> Avoid compiler warning caused by an empty block statement.
>>
>> Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de>
>> Reported-by: kernel test robot <lkp@intel.com>
>> Closes: https://lore.kernel.org/oe-kbuild-all/202504262127.FkkWHzfs-lkp@intel.com/
>> ---
>>
>> I could not reproduce this warning with gcc10 here, but I already had similar
>> warnings with gcc12 on other projects.
>> I think it has most probably been triggered by the empty block statement.
>>
>> I'm pretty confident this patch will fix the warning, but not 100% sure.
>>
>> The kernel test robot will pick this patch and test is anyway, if I'm correct.
>> Let's wait, if it complains again.
>> That's the best I can do right now.
> 
> Is this patch still needed? I noticed that it wasn't CC-ed to the linux-media
> mailinglist, so it never appeared in patchwork, and was never picked up.

Thanks for the hint, next time I CC the media-list too.


Meanwhile I think the patch isn't necessary.
In haven't found any other evidence that there is something wrong.
- I wasn't able to reproduce this warning.
- Debian has recent builds of kernel 6.15.3 with gcc 14.
    The kernel-package contains the "dvb-ttpci.ko" file[1] and there are no
    warnings (for this module) in the build log[2].

The warning still doesn't make sense to me -there is no function statement-
and the code looks o.k. to me too.
The only debatable thing is the empty function block, which is generally
suggested to avoid.
Meanwhile I think a null statement ";" is maybe a more elegant solution here.

Is there a recommend practice for this? I haven't found anything in the
documentation so far.


Regards
Stefan

[1]: https://packages.debian.org/search?searchon=contents&keywords=dvb-ttpci.ko&mode=path&suite=experimental&arch=any
[2]: https://buildd.debian.org/status/logs.php?pkg=linux&ver=6.15.3-1%7Eexp1&arch=amd64&suite=experimental

> 
> If it is still needed, then please post it to linux-media and it will be
> picked up for v6.17.
> 
> Regards,
> 
> 	Hans
> 
>>
>> Regards
>> Stefan
>>
>>
>>  drivers/staging/media/av7110/av7110.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c
>> index bc9a2a40a..962536ed7 100644
>> --- a/drivers/staging/media/av7110/av7110.c
>> +++ b/drivers/staging/media/av7110/av7110.c
>> @@ -159,7 +159,7 @@ static void init_av7110_av(struct av7110 *av7110)
>>  		 * some special handling for the Siemens DVB-C cards...
>>  		 */
>>  	} else if (av7110_init_analog_module(av7110) == 0) {
>> -		/* done. */
>> +		goto init_skip_analog_module;
>>  	} else if (dev->pci->subsystem_vendor == 0x110a) {
>>  		pr_info("DVB-C w/o analog module @ card %d detected\n", av7110->dvb_adapter.num);
>>  		av7110->adac_type = DVB_ADAC_NONE;
>> @@ -168,6 +168,7 @@ static void init_av7110_av(struct av7110 *av7110)
>>  		pr_info("adac type set to %d @ card %d\n", av7110->adac_type, av7110->dvb_adapter.num);
>>  	}
>>  
>> +init_skip_analog_module:
>>  	if (av7110->adac_type == DVB_ADAC_NONE || av7110->adac_type == DVB_ADAC_MSP34x0) {
>>  		// switch DVB SCART on
>>  		ret = av7110_fw_cmd(av7110, COMTYPE_AUDIODAC, MainSwitch, 1, 0);
> 


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

end of thread, other threads:[~2025-06-24  3:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-26 13:54 drivers/staging/media/av7110/av7110.c:162: warning: cannot understand function prototype: '} else if (av7110_init_analog_module(av7110) == 0) ' kernel test robot
2025-04-26 21:54 ` [PATCH] media: av7110: Workaround a compiler warning Stefan Herdler
2025-06-20 13:33   ` Hans Verkuil
2025-06-24  3:36     ` Stefan Herdler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®