[alsa-devel] [PATCH] ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally
Make this helper inline function available for all platforms. This helps solve 0-day compilation issues when CONFIG_SND_DMA_SGBUF is not defined.
Reported-by: kbuild test robot lkp@intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- include/sound/memalloc.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h index 9c3db3dce32b..c669900e6cbe 100644 --- a/include/sound/memalloc.h +++ b/include/sound/memalloc.h @@ -67,6 +67,14 @@ struct snd_dma_buffer { void *private_data; /* private for allocator; don't touch */ };
+/* + * return the pages matching with the given byte size + */ +static inline unsigned int snd_sgbuf_aligned_pages(size_t size) +{ + return (size + PAGE_SIZE - 1) >> PAGE_SHIFT; +} + #ifdef CONFIG_SND_DMA_SGBUF /* * Scatter-Gather generic device pages @@ -90,14 +98,6 @@ struct snd_sg_buf { struct device *dev; };
-/* - * return the pages matching with the given byte size - */ -static inline unsigned int snd_sgbuf_aligned_pages(size_t size) -{ - return (size + PAGE_SIZE - 1) >> PAGE_SHIFT; -} - /* * return the physical address at the corresponding offset */
On Wed, 25 Jul 2018 22:15:56 +0200, Pierre-Louis Bossart wrote:
Make this helper inline function available for all platforms. This helps solve 0-day compilation issues when CONFIG_SND_DMA_SGBUF is not defined.
Reported-by: kbuild test robot lkp@intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com
Currently it's triggered only by the new Intel patches, so no urgent material.
I can put this to for-next branch, or to another immutable branch, so that Mark can pull in. Or, it's fine that Mark applies to his tree together with other Intel patches, too. Mark, what's your preference?
In the last case, feel free to take my ack: Reviewed-by: Takashi Iwai tiwai@suse.de
thanks,
Takashi
include/sound/memalloc.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h index 9c3db3dce32b..c669900e6cbe 100644 --- a/include/sound/memalloc.h +++ b/include/sound/memalloc.h @@ -67,6 +67,14 @@ struct snd_dma_buffer { void *private_data; /* private for allocator; don't touch */ };
+/*
- return the pages matching with the given byte size
- */
+static inline unsigned int snd_sgbuf_aligned_pages(size_t size) +{
- return (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
+}
#ifdef CONFIG_SND_DMA_SGBUF /*
- Scatter-Gather generic device pages
@@ -90,14 +98,6 @@ struct snd_sg_buf { struct device *dev; };
-/*
- return the pages matching with the given byte size
- */
-static inline unsigned int snd_sgbuf_aligned_pages(size_t size) -{
- return (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
-}
/*
- return the physical address at the corresponding offset
*/
2.14.1
On Thu, Jul 26, 2018 at 08:28:41AM +0200, Takashi Iwai wrote:
I can put this to for-next branch, or to another immutable branch, so that Mark can pull in. Or, it's fine that Mark applies to his tree together with other Intel patches, too. Mark, what's your preference?
In the last case, feel free to take my ack: Reviewed-by: Takashi Iwai tiwai@suse.de
Since I can just do it immediately I applied it and pushed out a signed tag for it:
The following changes since commit ce397d215ccd07b8ae3f71db689aedb85d56ab40:
Linux 4.18-rc1 (2018-06-17 08:04:49 +0900)
are available in the Git repository at:
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git tags/alsa-add-snd-sgbuf-aligned-pages
for you to fetch changes up to 4cae99d9b5305ab8cccc839fccceb81ec9e5abda:
ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally (2018-07-26 17:05:29 +0100)
---------------------------------------------------------------- ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally
Make this helper inline function available for all platforms. This helps solve 0-day compilation issues when CONFIG_SND_DMA_SGBUF is not defined.
---------------------------------------------------------------- Pierre-Louis Bossart (1): ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally
include/sound/memalloc.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
Hi Pierre-Louis,
I love your patch! Yet something to improve:
[auto build test ERROR on sound/for-next] [also build test ERROR on v4.18-rc6 next-20180725] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Pierre-Louis-Bossart/ALSA-memalloc-... base: https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next config: alpha-allyesconfig (attached as .config) compiler: alpha-linux-gnu-gcc (Debian 7.2.0-11) 7.2.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.2.0 make.cross ARCH=alpha
All errors (new ones prefixed by >>):
In file included from include/sound/pcm.h:27:0, from sound/core/pcm_iec958.c:11: include/sound/memalloc.h: In function 'snd_sgbuf_aligned_pages':
include/sound/memalloc.h:75:17: error: 'PAGE_SIZE' undeclared (first use in this function); did you mean 'TASK_SIZE'?
return (size + PAGE_SIZE - 1) >> PAGE_SHIFT; ^~~~~~~~~ TASK_SIZE include/sound/memalloc.h:75:17: note: each undeclared identifier is reported only once for each function it appears in
include/sound/memalloc.h:75:35: error: 'PAGE_SHIFT' undeclared (first use in this function); did you mean 'PAGE_SIZE'?
return (size + PAGE_SIZE - 1) >> PAGE_SHIFT; ^~~~~~~~~~ PAGE_SIZE
vim +75 include/sound/memalloc.h
69 70 /* 71 * return the pages matching with the given byte size 72 */ 73 static inline unsigned int snd_sgbuf_aligned_pages(size_t size) 74 {
75 return (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
76 } 77
--- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
On Thu, 26 Jul 2018 16:51:55 +0200, kbuild test robot wrote:
Hi Pierre-Louis,
I love your patch! Yet something to improve:
[auto build test ERROR on sound/for-next] [also build test ERROR on v4.18-rc6 next-20180725] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Pierre-Louis-Bossart/ALSA-memalloc-... base: https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next config: alpha-allyesconfig (attached as .config) compiler: alpha-linux-gnu-gcc (Debian 7.2.0-11) 7.2.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.2.0 make.cross ARCH=alpha
All errors (new ones prefixed by >>):
In file included from include/sound/pcm.h:27:0, from sound/core/pcm_iec958.c:11: include/sound/memalloc.h: In function 'snd_sgbuf_aligned_pages':
include/sound/memalloc.h:75:17: error: 'PAGE_SIZE' undeclared (first use in this function); did you mean 'TASK_SIZE'?
return (size + PAGE_SIZE - 1) >> PAGE_SHIFT; ^~~~~~~~~ TASK_SIZE
OK, we need to include <asm/page.h> in this header file.
Pierre, care to resend with the fix?
thanks,
Takashi
On 7/27/18 12:11 AM, Takashi Iwai wrote:
On Thu, 26 Jul 2018 16:51:55 +0200, kbuild test robot wrote:
Hi Pierre-Louis,
I love your patch! Yet something to improve:
[auto build test ERROR on sound/for-next] [also build test ERROR on v4.18-rc6 next-20180725] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Pierre-Louis-Bossart/ALSA-memalloc-... base: https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next config: alpha-allyesconfig (attached as .config) compiler: alpha-linux-gnu-gcc (Debian 7.2.0-11) 7.2.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.2.0 make.cross ARCH=alpha
All errors (new ones prefixed by >>):
In file included from include/sound/pcm.h:27:0, from sound/core/pcm_iec958.c:11: include/sound/memalloc.h: In function 'snd_sgbuf_aligned_pages':
include/sound/memalloc.h:75:17: error: 'PAGE_SIZE' undeclared (first use in this function); did you mean 'TASK_SIZE'?
return (size + PAGE_SIZE - 1) >> PAGE_SHIFT; ^~~~~~~~~ TASK_SIZE
OK, we need to include <asm/page.h> in this header file.
Pierre, care to resend with the fix?
yes, will do later today.
The patch
ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
From 4cae99d9b5305ab8cccc839fccceb81ec9e5abda Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Date: Wed, 25 Jul 2018 15:15:56 -0500 Subject: [PATCH] ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally
Make this helper inline function available for all platforms. This helps solve 0-day compilation issues when CONFIG_SND_DMA_SGBUF is not defined.
Reported-by: kbuild test robot lkp@intel.com Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Takashi Iwai tiwai@suse.de Signed-off-by: Mark Brown broonie@kernel.org --- include/sound/memalloc.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h index 9c3db3dce32b..c669900e6cbe 100644 --- a/include/sound/memalloc.h +++ b/include/sound/memalloc.h @@ -67,6 +67,14 @@ struct snd_dma_buffer { void *private_data; /* private for allocator; don't touch */ };
+/* + * return the pages matching with the given byte size + */ +static inline unsigned int snd_sgbuf_aligned_pages(size_t size) +{ + return (size + PAGE_SIZE - 1) >> PAGE_SHIFT; +} + #ifdef CONFIG_SND_DMA_SGBUF /* * Scatter-Gather generic device pages @@ -90,14 +98,6 @@ struct snd_sg_buf { struct device *dev; };
-/* - * return the pages matching with the given byte size - */ -static inline unsigned int snd_sgbuf_aligned_pages(size_t size) -{ - return (size + PAGE_SIZE - 1) >> PAGE_SHIFT; -} - /* * return the physical address at the corresponding offset */
Hi Pierre-Louis,
I love your patch! Yet something to improve:
[auto build test ERROR on sound/for-next] [also build test ERROR on v4.18-rc6 next-20180725] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Pierre-Louis-Bossart/ALSA-memalloc-... base: https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next config: microblaze-allmodconfig (attached as .config) compiler: microblaze-linux-gcc (GCC) 8.1.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=8.1.0 make.cross ARCH=microblaze
All errors (new ones prefixed by >>):
In file included from include/sound/pcm.h:27, from sound/core/pcm_iec958.c:11: include/sound/memalloc.h: In function 'snd_sgbuf_aligned_pages': include/sound/memalloc.h:75:17: error: 'PAGE_SIZE' undeclared (first use in this function); did you mean 'TASK_SIZE'? return (size + PAGE_SIZE - 1) >> PAGE_SHIFT; ^~~~~~~~~ TASK_SIZE include/sound/memalloc.h:75:17: note: each undeclared identifier is reported only once for each function it appears in
include/sound/memalloc.h:75:35: error: 'PAGE_SHIFT' undeclared (first use in this function); did you mean 'NMI_SHIFT'?
return (size + PAGE_SIZE - 1) >> PAGE_SHIFT; ^~~~~~~~~~ NMI_SHIFT
vim +75 include/sound/memalloc.h
69 70 /* 71 * return the pages matching with the given byte size 72 */ 73 static inline unsigned int snd_sgbuf_aligned_pages(size_t size) 74 {
75 return (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
76 } 77
--- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
participants (4)
-
kbuild test robot
-
Mark Brown
-
Pierre-Louis Bossart
-
Takashi Iwai