From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH 2/2] ALSA: pcm: implement the mmap buffer mode for the anonymous dup Date: Mon, 04 Feb 2019 11:48:21 +0100 Message-ID: References: <20190204093910.23878-1-perex@perex.cz> <20190204093910.23878-3-perex@perex.cz> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id CD3F32674D5 for ; Mon, 4 Feb 2019 11:48:22 +0100 (CET) In-Reply-To: <20190204093910.23878-3-perex@perex.cz> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Jaroslav Kysela Cc: ALSA development , Baolin Wang , Phil Burk , Zach Riggle , Mark Brown , Leo Yan List-Id: alsa-devel@alsa-project.org On Mon, 04 Feb 2019 10:39:10 +0100, Jaroslav Kysela wrote: > > @@ -3295,6 +3311,9 @@ static int snd_pcm_mmap_status(struct snd_pcm_substream *substream, struct file > struct vm_area_struct *area) > { > long size; > + struct snd_pcm_file *pcm_file = file->private_data; > + if (pcm_file->perm != SNDRV_PCM_PERM_MODE_FULL) > + return -EPERM; This check can be better put to pcm_status_mmap_allowed(). > @@ -3331,6 +3350,9 @@ static int snd_pcm_mmap_control(struct snd_pcm_substream *substream, struct file > struct vm_area_struct *area) > { > long size; > + struct snd_pcm_file *pcm_file = file->private_data; > + if (pcm_file->perm != SNDRV_PCM_PERM_MODE_FULL) > + return -EPERM; Ditto, put to pcm_control_mmap_allowed(). Other than that, looks good to me: Reviewed-by: Takashi Iwai thanks, Takashi