Skip to contentSkip to conversation

ALSA: memalloc: Drop snd_dma_pci_data() macro

PATCH New Takashi Iwai 2 participants 3 messages Nov 8, 2019 – Nov 10, 2019 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: memalloc: Drop snd_dma_pci_data() macro

Now that all users have been converted, we can drop snd_dma_pci_data() macro definition.

---
 include/sound/memalloc.h | 1 -
 1 file changed, 1 deletion(-)
include/sound/memalloc.h +0 -1
index 6ada3b8ede4e..3b47832b1c1f 100644
@@ -21,7 +21,6 @@ struct snd_dma_device {
 	struct device *dev;		/* generic device */
 };
 
-#define snd_dma_pci_data(pci)	(&(pci)->dev)
 #define snd_dma_continuous_data(x)	((struct device *)(__force unsigned long)(x))
 
 
Signature · 6 lines
2.16.4

_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
#1 lore raw
I love your patch! Yet something to improve:

Hi Takashi,

I love your patch! Yet something to improve:

[auto build test ERROR on sound/for-next]
[also build test ERROR on v5.4-rc6 next-20191108]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Takashi-Iwai/ALSA-memalloc-Drop-snd_dma_pci_data-macro/20191110-061209
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next
config: sparc64-allmodconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 7.4.0

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=sparc64

If you fix the issue, kindly add following tag

All error/warnings (new ones prefixed by >>):

drivers/media/pci/tw686x/tw686x-audio.c: In function 'tw686x_snd_pcm_init':

>> drivers/media/pci/tw686x/tw686x-audio.c:303:5: error: implicit declaration of function 'snd_dma_pci_data'; did you mean 'snd_pcm_mmap_data'? [-Werror=implicit-function-declaration]
        snd_dma_pci_data(dev->pci_dev),
        ^~~~~~~~~~~~~~~~
        snd_pcm_mmap_data
>> drivers/media/pci/tw686x/tw686x-audio.c:303:5: warning: passing argument 3 of 'snd_pcm_lib_preallocate_pages_for_all' makes pointer from integer without a cast [-Wint-conversion]

In file included from drivers/media/pci/tw686x/tw686x-audio.c:24:0:
include/sound/pcm.h:1183:6: note: expected 'void *' but argument is of type 'int'
void snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

vim +303 drivers/media/pci/tw686x/tw686x-audio.c

704a84ccdbf19f Ezequiel Garcia       2016-03-02  279  
704a84ccdbf19f Ezequiel Garcia       2016-03-02  280  static int tw686x_snd_pcm_init(struct tw686x_dev *dev)
704a84ccdbf19f Ezequiel Garcia       2016-03-02  281  {
704a84ccdbf19f Ezequiel Garcia       2016-03-02  282  	struct snd_card *card = dev->snd_card;
704a84ccdbf19f Ezequiel Garcia       2016-03-02  283  	struct snd_pcm *pcm;
704a84ccdbf19f Ezequiel Garcia       2016-03-02  284  	struct snd_pcm_substream *ss;
704a84ccdbf19f Ezequiel Garcia       2016-03-02  285  	unsigned int i;
704a84ccdbf19f Ezequiel Garcia       2016-03-02  286  	int err;
704a84ccdbf19f Ezequiel Garcia       2016-03-02  287  
704a84ccdbf19f Ezequiel Garcia       2016-03-02  288  	err = snd_pcm_new(card, card->driver, 0, 0, max_channels(dev), &pcm);
704a84ccdbf19f Ezequiel Garcia       2016-03-02  289  	if (err < 0)
704a84ccdbf19f Ezequiel Garcia       2016-03-02  290  		return err;
704a84ccdbf19f Ezequiel Garcia       2016-03-02  291  
704a84ccdbf19f Ezequiel Garcia       2016-03-02  292  	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &tw686x_pcm_ops);
704a84ccdbf19f Ezequiel Garcia       2016-03-02  293  	snd_pcm_chip(pcm) = dev;
704a84ccdbf19f Ezequiel Garcia       2016-03-02  294  	pcm->info_flags = 0;
c0decac19da390 Mauro Carvalho Chehab 2018-09-10  295  	strscpy(pcm->name, "tw686x PCM", sizeof(pcm->name));
704a84ccdbf19f Ezequiel Garcia       2016-03-02  296  
704a84ccdbf19f Ezequiel Garcia       2016-03-02  297  	for (i = 0, ss = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream;
704a84ccdbf19f Ezequiel Garcia       2016-03-02  298  	     ss; ss = ss->next, i++)
704a84ccdbf19f Ezequiel Garcia       2016-03-02  299  		snprintf(ss->name, sizeof(ss->name), "vch%u audio", i);
704a84ccdbf19f Ezequiel Garcia       2016-03-02  300  
62e94da3e9d8b9 Takashi Iwai          2019-02-06  301  	snd_pcm_lib_preallocate_pages_for_all(pcm,
704a84ccdbf19f Ezequiel Garcia       2016-03-02  302  				SNDRV_DMA_TYPE_DEV,
704a84ccdbf19f Ezequiel Garcia       2016-03-02 @303  				snd_dma_pci_data(dev->pci_dev),
447d7c32914598 Ezequiel Garcia       2016-06-04  304  				TW686X_AUDIO_PAGE_MAX * AUDIO_DMA_SIZE_MAX,
447d7c32914598 Ezequiel Garcia       2016-06-04  305  				TW686X_AUDIO_PAGE_MAX * AUDIO_DMA_SIZE_MAX);
62e94da3e9d8b9 Takashi Iwai          2019-02-06  306  	return 0;
704a84ccdbf19f Ezequiel Garcia       2016-03-02  307  }
704a84ccdbf19f Ezequiel Garcia       2016-03-02  308  

:::::: The code at line 303 was first introduced by commit
:::::: 704a84ccdbf19fdce9adfda0b936dfdcac52fa49 [media] media: Support Intersil/Techwell TW686x-based video capture cards

:::::: TO: Ezequiel Garcia <[email protected]> :::::: CC: Mauro Carvalho Chehab <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

#2 lore raw
In reply to Takashi Iwai
I love your patch! Yet something to improve:

Hi Takashi,

I love your patch! Yet something to improve:

[auto build test ERROR on sound/for-next]
[also build test ERROR on v5.4-rc6 next-20191108]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Takashi-Iwai/ALSA-memalloc-Drop-snd_dma_pci_data-macro/20191110-061209
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag

All errors (new ones prefixed by >>):

drivers/media/pci/tw686x/tw686x-audio.c: In function 'tw686x_snd_pcm_init':

>> drivers/media/pci/tw686x/tw686x-audio.c:303:5: error: implicit declaration of function 'snd_dma_pci_data'; did you mean 'snd_dma_pointer'? [-Werror=implicit-function-declaration]
        snd_dma_pci_data(dev->pci_dev),
        ^~~~~~~~~~~~~~~~
        snd_dma_pointer

drivers/media/pci/tw686x/tw686x-audio.c:303:5: warning: passing argument 3 of 'snd_pcm_lib_preallocate_pages_for_all' makes pointer from integer without a cast [-Wint-conversion] In file included from drivers/media/pci/tw686x/tw686x-audio.c:24:0:
include/sound/pcm.h:1183:6: note: expected 'void *' but argument is of type 'int'
void snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

vim +303 drivers/media/pci/tw686x/tw686x-audio.c

704a84ccdbf19f Ezequiel Garcia       2016-03-02  279  
704a84ccdbf19f Ezequiel Garcia       2016-03-02  280  static int tw686x_snd_pcm_init(struct tw686x_dev *dev)
704a84ccdbf19f Ezequiel Garcia       2016-03-02  281  {
704a84ccdbf19f Ezequiel Garcia       2016-03-02  282  	struct snd_card *card = dev->snd_card;
704a84ccdbf19f Ezequiel Garcia       2016-03-02  283  	struct snd_pcm *pcm;
704a84ccdbf19f Ezequiel Garcia       2016-03-02  284  	struct snd_pcm_substream *ss;
704a84ccdbf19f Ezequiel Garcia       2016-03-02  285  	unsigned int i;
704a84ccdbf19f Ezequiel Garcia       2016-03-02  286  	int err;
704a84ccdbf19f Ezequiel Garcia       2016-03-02  287  
704a84ccdbf19f Ezequiel Garcia       2016-03-02  288  	err = snd_pcm_new(card, card->driver, 0, 0, max_channels(dev), &pcm);
704a84ccdbf19f Ezequiel Garcia       2016-03-02  289  	if (err < 0)
704a84ccdbf19f Ezequiel Garcia       2016-03-02  290  		return err;
704a84ccdbf19f Ezequiel Garcia       2016-03-02  291  
704a84ccdbf19f Ezequiel Garcia       2016-03-02  292  	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &tw686x_pcm_ops);
704a84ccdbf19f Ezequiel Garcia       2016-03-02  293  	snd_pcm_chip(pcm) = dev;
704a84ccdbf19f Ezequiel Garcia       2016-03-02  294  	pcm->info_flags = 0;
c0decac19da390 Mauro Carvalho Chehab 2018-09-10  295  	strscpy(pcm->name, "tw686x PCM", sizeof(pcm->name));
704a84ccdbf19f Ezequiel Garcia       2016-03-02  296  
704a84ccdbf19f Ezequiel Garcia       2016-03-02  297  	for (i = 0, ss = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream;
704a84ccdbf19f Ezequiel Garcia       2016-03-02  298  	     ss; ss = ss->next, i++)
704a84ccdbf19f Ezequiel Garcia       2016-03-02  299  		snprintf(ss->name, sizeof(ss->name), "vch%u audio", i);
704a84ccdbf19f Ezequiel Garcia       2016-03-02  300  
62e94da3e9d8b9 Takashi Iwai          2019-02-06  301  	snd_pcm_lib_preallocate_pages_for_all(pcm,
704a84ccdbf19f Ezequiel Garcia       2016-03-02  302  				SNDRV_DMA_TYPE_DEV,
704a84ccdbf19f Ezequiel Garcia       2016-03-02 @303  				snd_dma_pci_data(dev->pci_dev),
447d7c32914598 Ezequiel Garcia       2016-06-04  304  				TW686X_AUDIO_PAGE_MAX * AUDIO_DMA_SIZE_MAX,
447d7c32914598 Ezequiel Garcia       2016-06-04  305  				TW686X_AUDIO_PAGE_MAX * AUDIO_DMA_SIZE_MAX);
62e94da3e9d8b9 Takashi Iwai          2019-02-06  306  	return 0;
704a84ccdbf19f Ezequiel Garcia       2016-03-02  307  }
704a84ccdbf19f Ezequiel Garcia       2016-03-02  308  

:::::: The code at line 303 was first introduced by commit
:::::: 704a84ccdbf19fdce9adfda0b936dfdcac52fa49 [media] media: Support Intersil/Techwell TW686x-based video capture cards

:::::: TO: Ezequiel Garcia <[email protected]> :::::: CC: Mauro Carvalho Chehab <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation