[alsa-devel] [PATCH 5/8] ALSA: pcm: Move PCM_RUNTIME_CHECK() macro into local header

kbuild test robot lkp at intel.com
Sun Nov 17 11:28:49 CET 2019


Hi Takashi,

I love your patch! Yet something to improve:

[auto build test ERROR on sound/for-next]
[also build test ERROR on next-20191115]
[cannot apply to v5.4-rc7]
[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-pcm-API-cleanups-and-extensions/20191117-170136
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next
config: arc-randconfig-a0031-20191117 (attached as .config)
compiler: arc-elf-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=arc 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp at intel.com>

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

   In file included from include/linux/init.h:5:0,
                    from include/linux/io.h:10,
                    from sound/core/pcm_memory.c:7:
   sound/core/pcm_memory.c: In function 'snd_pcm_lib_malloc_pages':
>> sound/core/pcm_memory.c:351:6: error: implicit declaration of function 'PCM_RUNTIME_CHECK' [-Werror=implicit-function-declaration]
     if (PCM_RUNTIME_CHECK(substream))
         ^
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                       ^~~~
>> sound/core/pcm_memory.c:351:2: note: in expansion of macro 'if'
     if (PCM_RUNTIME_CHECK(substream))
     ^~
   cc1: some warnings being treated as errors

vim +/PCM_RUNTIME_CHECK +351 sound/core/pcm_memory.c

51e9f2e665bf2b Takashi Iwai   2008-07-30  334  
^1da177e4c3f41 Linus Torvalds 2005-04-16  335  /**
^1da177e4c3f41 Linus Torvalds 2005-04-16  336   * snd_pcm_lib_malloc_pages - allocate the DMA buffer
^1da177e4c3f41 Linus Torvalds 2005-04-16  337   * @substream: the substream to allocate the DMA buffer to
^1da177e4c3f41 Linus Torvalds 2005-04-16  338   * @size: the requested buffer size in bytes
^1da177e4c3f41 Linus Torvalds 2005-04-16  339   *
^1da177e4c3f41 Linus Torvalds 2005-04-16  340   * Allocates the DMA buffer on the BUS type given earlier to
^1da177e4c3f41 Linus Torvalds 2005-04-16  341   * snd_pcm_lib_preallocate_xxx_pages().
^1da177e4c3f41 Linus Torvalds 2005-04-16  342   *
eb7c06e8e9c93b Yacine Belkadi 2013-03-11  343   * Return: 1 if the buffer is changed, 0 if not changed, or a negative
^1da177e4c3f41 Linus Torvalds 2005-04-16  344   * code on failure.
^1da177e4c3f41 Linus Torvalds 2005-04-16  345   */
877211f5e1b119 Takashi Iwai   2005-11-17  346  int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size)
^1da177e4c3f41 Linus Torvalds 2005-04-16  347  {
877211f5e1b119 Takashi Iwai   2005-11-17  348  	struct snd_pcm_runtime *runtime;
^1da177e4c3f41 Linus Torvalds 2005-04-16  349  	struct snd_dma_buffer *dmab = NULL;
^1da177e4c3f41 Linus Torvalds 2005-04-16  350  
7eaa943c8ed8e9 Takashi Iwai   2008-08-08 @351  	if (PCM_RUNTIME_CHECK(substream))
7eaa943c8ed8e9 Takashi Iwai   2008-08-08  352  		return -EINVAL;
7eaa943c8ed8e9 Takashi Iwai   2008-08-08  353  	if (snd_BUG_ON(substream->dma_buffer.dev.type ==
7eaa943c8ed8e9 Takashi Iwai   2008-08-08  354  		       SNDRV_DMA_TYPE_UNKNOWN))
7eaa943c8ed8e9 Takashi Iwai   2008-08-08  355  		return -EINVAL;
^1da177e4c3f41 Linus Torvalds 2005-04-16  356  	runtime = substream->runtime;
^1da177e4c3f41 Linus Torvalds 2005-04-16  357  
^1da177e4c3f41 Linus Torvalds 2005-04-16  358  	if (runtime->dma_buffer_p) {
^1da177e4c3f41 Linus Torvalds 2005-04-16  359  		/* perphaps, we might free the large DMA memory region
^1da177e4c3f41 Linus Torvalds 2005-04-16  360  		   to save some space here, but the actual solution
^1da177e4c3f41 Linus Torvalds 2005-04-16  361  		   costs us less time */
^1da177e4c3f41 Linus Torvalds 2005-04-16  362  		if (runtime->dma_buffer_p->bytes >= size) {
^1da177e4c3f41 Linus Torvalds 2005-04-16  363  			runtime->dma_bytes = size;
^1da177e4c3f41 Linus Torvalds 2005-04-16  364  			return 0;	/* ok, do not change */
^1da177e4c3f41 Linus Torvalds 2005-04-16  365  		}
^1da177e4c3f41 Linus Torvalds 2005-04-16  366  		snd_pcm_lib_free_pages(substream);
^1da177e4c3f41 Linus Torvalds 2005-04-16  367  	}
877211f5e1b119 Takashi Iwai   2005-11-17  368  	if (substream->dma_buffer.area != NULL &&
877211f5e1b119 Takashi Iwai   2005-11-17  369  	    substream->dma_buffer.bytes >= size) {
^1da177e4c3f41 Linus Torvalds 2005-04-16  370  		dmab = &substream->dma_buffer; /* use the pre-allocated buffer */
^1da177e4c3f41 Linus Torvalds 2005-04-16  371  	} else {
ca2c0966562cfb Takashi Iwai   2005-09-09  372  		dmab = kzalloc(sizeof(*dmab), GFP_KERNEL);
^1da177e4c3f41 Linus Torvalds 2005-04-16  373  		if (! dmab)
^1da177e4c3f41 Linus Torvalds 2005-04-16  374  			return -ENOMEM;
^1da177e4c3f41 Linus Torvalds 2005-04-16  375  		dmab->dev = substream->dma_buffer.dev;
^1da177e4c3f41 Linus Torvalds 2005-04-16  376  		if (snd_dma_alloc_pages(substream->dma_buffer.dev.type,
^1da177e4c3f41 Linus Torvalds 2005-04-16  377  					substream->dma_buffer.dev.dev,
^1da177e4c3f41 Linus Torvalds 2005-04-16  378  					size, dmab) < 0) {
^1da177e4c3f41 Linus Torvalds 2005-04-16  379  			kfree(dmab);
^1da177e4c3f41 Linus Torvalds 2005-04-16  380  			return -ENOMEM;
^1da177e4c3f41 Linus Torvalds 2005-04-16  381  		}
^1da177e4c3f41 Linus Torvalds 2005-04-16  382  	}
^1da177e4c3f41 Linus Torvalds 2005-04-16  383  	snd_pcm_set_runtime_buffer(substream, dmab);
^1da177e4c3f41 Linus Torvalds 2005-04-16  384  	runtime->dma_bytes = size;
^1da177e4c3f41 Linus Torvalds 2005-04-16  385  	return 1;			/* area was changed */
^1da177e4c3f41 Linus Torvalds 2005-04-16  386  }
e88e8ae639a490 Takashi Iwai   2006-04-28  387  EXPORT_SYMBOL(snd_pcm_lib_malloc_pages);
e88e8ae639a490 Takashi Iwai   2006-04-28  388  

:::::: The code at line 351 was first introduced by commit
:::::: 7eaa943c8ed8e91e05d0f5d0dc7a18e3319b45cf ALSA: Kill snd_assert() in sound/core/*

:::::: TO: Takashi Iwai <tiwai at suse.de>
:::::: CC: Jaroslav Kysela <perex at perex.cz>

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 27868 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20191117/b6cd2a20/attachment-0001.gz>


More information about the Alsa-devel mailing list