From patchwork Fri Jul 27 16:28:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 10547431 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 31AD3112B for ; Fri, 27 Jul 2018 16:28:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F12E2BF48 for ; Fri, 27 Jul 2018 16:28:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 131642BF4B; Fri, 27 Jul 2018 16:28:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 172402BF48 for ; Fri, 27 Jul 2018 16:28:37 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 280C7267786; Fri, 27 Jul 2018 18:28:34 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 634C92677CC; Fri, 27 Jul 2018 18:28:31 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by alsa0.perex.cz (Postfix) with ESMTP id D7BBA267759 for ; Fri, 27 Jul 2018 18:28:24 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jul 2018 09:28:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,410,1526367600"; d="scan'208";a="78397509" Received: from nvora-mobl.amr.corp.intel.com (HELO localhost.localdomain) ([10.255.33.120]) by orsmga002.jf.intel.com with ESMTP; 27 Jul 2018 09:28:10 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Date: Fri, 27 Jul 2018 11:28:05 -0500 Message-Id: <20180727162805.20785-1-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.14.1 Cc: tiwai@suse.de, liam.r.girdwood@linux.intel.com, vkoul@kernel.org, broonie@kernel.org, Pierre-Louis Bossart Subject: [alsa-devel] [PATCH v2] ALSA: memalloc: declare snd_sgbuf_aligned_pages() unconditionally X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Pierre-Louis Bossart --- v2: add to solve compilation issue on ALPHA reported by 0-day include/sound/memalloc.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h index 9c3db3dce32b..67561b997915 100644 --- a/include/sound/memalloc.h +++ b/include/sound/memalloc.h @@ -24,6 +24,8 @@ #ifndef __SOUND_MEMALLOC_H #define __SOUND_MEMALLOC_H +#include + struct device; /* @@ -67,6 +69,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 +100,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 */