Re: [PATCH] LoongArch: Drop -ffreestanding from CFLAGS

From: kernel test robot
Date: Fri Aug 04 2023 - 16:47:58 EST


Hi WANG,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.5-rc4]
[cannot apply to next-20230804]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/WANG-Xuerui/LoongArch-Drop-ffreestanding-from-CFLAGS/20230804-205642
base: linus/master
patch link: https://lore.kernel.org/r/20230804125609.2054719-1-kernel%40xen0n.name
patch subject: [PATCH] LoongArch: Drop -ffreestanding from CFLAGS
config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20230805/202308050433.0KAmYqQ2-lkp@xxxxxxxxx/config)
compiler: loongarch64-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230805/202308050433.0KAmYqQ2-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308050433.0KAmYqQ2-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

In file included from include/linux/irqflags.h:18,
from include/linux/spinlock.h:59,
from include/linux/debugobjects.h:6,
from include/linux/timer.h:8,
from include/linux/workqueue.h:9,
from drivers/media/usb/em28xx/em28xx.h:21,
from drivers/media/usb/em28xx/em28xx-audio.c:14:
arch/loongarch/include/asm/percpu.h:20:4: error: #error compiler support for the model attribute is necessary when a recent assembler is used
20 | # error compiler support for the model attribute is necessary when a recent assembler is used
| ^~~~~
drivers/media/usb/em28xx/em28xx-audio.c: In function 'em28xx_audio_init':
>> drivers/media/usb/em28xx/em28xx-audio.c:808:29: warning: variable 'devnr' set but not used [-Wunused-but-set-variable]
808 | static int devnr;
| ^~~~~
drivers/media/usb/em28xx/em28xx-audio.c: At top level:
drivers/media/usb/em28xx/em28xx-audio.c:47:12: warning: 'index' defined but not used [-Wunused-variable]
47 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
| ^~~~~


vim +/devnr +808 drivers/media/usb/em28xx/em28xx-audio.c

966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 801
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 802 static int em28xx_audio_init(struct em28xx *dev)
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 803 {
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 804 struct em28xx_audio *adev = &dev->adev;
c6d48134cb2682 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2016-12-07 805 struct usb_device *udev = interface_to_usbdev(dev->intf);
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 806 struct snd_pcm *pcm;
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 807 struct snd_card *card;
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 @808 static int devnr;
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 809 int err;
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 810
c5874208ff78a5 drivers/media/usb/em28xx/em28xx-audio.c Frank Schaefer 2014-09-13 811 if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR) {
9f90f5371f52b4 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2018-03-03 812 /*
9f90f5371f52b4 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2018-03-03 813 * This device does not support the extension (in this case
9f90f5371f52b4 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2018-03-03 814 * the device is expecting the snd-usb-audio module or
9f90f5371f52b4 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2018-03-03 815 * doesn't have analog audio support at all)
9f90f5371f52b4 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2018-03-03 816 */
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 817 return 0;
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 818 }
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 819
29b05e22f5c68c drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2016-12-07 820 dev_info(&dev->intf->dev, "Binding audio extension\n");
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 821
47677e51e2a404 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-03-05 822 kref_get(&dev->ref);
47677e51e2a404 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-03-05 823
29b05e22f5c68c drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2016-12-07 824 dev_info(&dev->intf->dev,
ce8591ff023ef8 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2016-10-20 825 "em28xx-audio.c: Copyright (C) 2006 Markus Rechberger\n");
29b05e22f5c68c drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2016-12-07 826 dev_info(&dev->intf->dev,
ce8591ff023ef8 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2016-10-20 827 "em28xx-audio.c: Copyright (C) 2007-2016 Mauro Carvalho Chehab\n");
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 828
29b05e22f5c68c drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2016-12-07 829 err = snd_card_new(&dev->intf->dev, index[devnr], "Em28xx Audio",
e735688875208f drivers/media/usb/em28xx/em28xx-audio.c Takashi Iwai 2014-01-29 830 THIS_MODULE, 0, &card);
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 831 if (err < 0)
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 832 return err;
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 833
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 834 spin_lock_init(&adev->slock);
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 835 adev->sndcard = card;
c6d48134cb2682 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2016-12-07 836 adev->udev = udev;
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 837
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 838 err = snd_pcm_new(card, "Em28xx Audio", 0, 0, 1, &pcm);
0cd03a0cb20c75 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 839 if (err < 0)
0cd03a0cb20c75 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 840 goto card_free;
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 841
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 842 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_em28xx_pcm_capture);
2abb1b2daf88ee drivers/media/usb/em28xx/em28xx-audio.c Takashi Iwai 2019-12-10 843 snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_VMALLOC, NULL, 0, 0);
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 844 pcm->info_flags = 0;
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 845 pcm->private_data = dev;
cc1e6315e83db0 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2018-09-10 846 strscpy(pcm->name, "Empia 28xx Capture", sizeof(pcm->name));
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 847
cc1e6315e83db0 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2018-09-10 848 strscpy(card->driver, "Em28xx-Audio", sizeof(card->driver));
cc1e6315e83db0 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2018-09-10 849 strscpy(card->shortname, "Em28xx Audio", sizeof(card->shortname));
cc1e6315e83db0 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2018-09-10 850 strscpy(card->longname, "Empia Em28xx Audio", sizeof(card->longname));
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 851
a5c075cfd2386a drivers/media/usb/em28xx/em28xx-audio.c Frank Schaefer 2014-03-24 852 INIT_WORK(&adev->wq_trigger, audio_trigger);
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 853
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 854 if (dev->audio_mode.ac97 != EM28XX_NO_AC97) {
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 855 em28xx_cvol_new(card, dev, "Video", AC97_VIDEO);
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 856 em28xx_cvol_new(card, dev, "Line In", AC97_LINE);
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 857 em28xx_cvol_new(card, dev, "Phone", AC97_PHONE);
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 858 em28xx_cvol_new(card, dev, "Microphone", AC97_MIC);
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 859 em28xx_cvol_new(card, dev, "CD", AC97_CD);
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 860 em28xx_cvol_new(card, dev, "AUX", AC97_AUX);
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 861 em28xx_cvol_new(card, dev, "PCM", AC97_PCM);
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 862
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 863 em28xx_cvol_new(card, dev, "Master", AC97_MASTER);
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 864 em28xx_cvol_new(card, dev, "Line", AC97_HEADPHONE);
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 865 em28xx_cvol_new(card, dev, "Mono", AC97_MASTER_MONO);
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 866 em28xx_cvol_new(card, dev, "LFE", AC97_CENTER_LFE_MASTER);
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 867 em28xx_cvol_new(card, dev, "Surround", AC97_SURROUND_MASTER);
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 868 }
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 869
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 870 err = em28xx_audio_urb_init(dev);
0cd03a0cb20c75 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 871 if (err)
0cd03a0cb20c75 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 872 goto card_free;
966f4163751b45 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 873
6d79468dd85375 drivers/media/video/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2008-01-05 874 err = snd_card_register(card);
0cd03a0cb20c75 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 875 if (err < 0)
0cd03a0cb20c75 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 876 goto urb_free;
6d79468dd85375 drivers/media/video/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2008-01-05 877
29b05e22f5c68c drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2016-12-07 878 dev_info(&dev->intf->dev, "Audio extension successfully initialized\n");
a52932b405f230 drivers/media/video/em28xx/em28xx-audio.c Markus Rechberger 2008-01-05 879 return 0;
0cd03a0cb20c75 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 880
0cd03a0cb20c75 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 881 urb_free:
0cd03a0cb20c75 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 882 em28xx_audio_free_urb(dev);
0cd03a0cb20c75 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 883
0cd03a0cb20c75 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 884 card_free:
0cd03a0cb20c75 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 885 snd_card_free(card);
452f236fcf845b drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-14 886 adev->sndcard = NULL;
0cd03a0cb20c75 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 887
0cd03a0cb20c75 drivers/media/usb/em28xx/em28xx-audio.c Mauro Carvalho Chehab 2014-01-12 888 return err;
a52932b405f230 drivers/media/video/em28xx/em28xx-audio.c Markus Rechberger 2008-01-05 889 }
a52932b405f230 drivers/media/video/em28xx/em28xx-audio.c Markus Rechberger 2008-01-05 890

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