From patchwork Thu Jun 1 20:58:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 9761163 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A8D7B60375 for ; Thu, 1 Jun 2017 20:59:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9898C28423 for ; Thu, 1 Jun 2017 20:59:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D82828501; Thu, 1 Jun 2017 20:59:57 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F65228423 for ; Thu, 1 Jun 2017 20:59:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751335AbdFAU7t (ORCPT ); Thu, 1 Jun 2017 16:59:49 -0400 Received: from mx2.suse.de ([195.135.220.15]:42490 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751194AbdFAU7J (ORCPT ); Thu, 1 Jun 2017 16:59:09 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6D59FAD4F; Thu, 1 Jun 2017 20:59:05 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Cc: Takashi Sakamoto , Mark Brown , Hans Verkuil , linux-media@vger.kernel.org, Felipe Balbi , Greg Kroah-Hartman , linux-usb@vger.kernel.org Subject: [PATCH v2 24/27] usb: gadget: u_uac1: Kill set_fs() usage Date: Thu, 1 Jun 2017 22:58:47 +0200 Message-Id: <20170601205850.24993-25-tiwai@suse.de> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170601205850.24993-1-tiwai@suse.de> References: <20170601205850.24993-1-tiwai@suse.de> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With the new API to perform the in-kernel buffer copy, we can get rid of set_fs() usage in this driver, finally. Signed-off-by: Takashi Iwai Acked-by: Greg Kroah-Hartman --- drivers/usb/gadget/function/u_uac1.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/usb/gadget/function/u_uac1.c b/drivers/usb/gadget/function/u_uac1.c index c78c84138a28..ca88e4c0fd1e 100644 --- a/drivers/usb/gadget/function/u_uac1.c +++ b/drivers/usb/gadget/function/u_uac1.c @@ -157,7 +157,6 @@ size_t u_audio_playback(struct gaudio *card, void *buf, size_t count) struct gaudio_snd_dev *snd = &card->playback; struct snd_pcm_substream *substream = snd->substream; struct snd_pcm_runtime *runtime = substream->runtime; - mm_segment_t old_fs; ssize_t result; snd_pcm_sframes_t frames; @@ -174,15 +173,11 @@ size_t u_audio_playback(struct gaudio *card, void *buf, size_t count) } frames = bytes_to_frames(runtime, count); - old_fs = get_fs(); - set_fs(KERNEL_DS); - result = snd_pcm_lib_write(snd->substream, (void __user *)buf, frames); + result = snd_pcm_kernel_write(snd->substream, buf, frames); if (result != frames) { ERROR(card, "Playback error: %d\n", (int)result); - set_fs(old_fs); goto try_again; } - set_fs(old_fs); return 0; }