Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp2555435rdg; Mon, 14 Aug 2023 06:24:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFqDY5MXDtatYkY/VK861eu6Nsu1ySvGgxjX9DpDLEfhPtsKPFO0Cp+YvcIgozfz6rsbp8r X-Received: by 2002:aa7:c911:0:b0:523:364b:e6a9 with SMTP id b17-20020aa7c911000000b00523364be6a9mr6758713edt.38.1692019488316; Mon, 14 Aug 2023 06:24:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692019488; cv=none; d=google.com; s=arc-20160816; b=v/3a4qE51amu11H2MUcWWu8YxmqyMLwQj3ntSudIav+6K2FkHYOVp6lY/hlJAh464Q SWQQwNe0vig2i3t5XVVo4v4VRs4y5ikCnUYguDoVKQ7GpmCjM5W9CQaPOmeFgwyUYXw3 AVR94wy1Kezo48GROkqPt53xNC7pzK8Vr/Un+UdWMocctTgz2EFuw7qeDM5U3WCMNcYR 0dq5jJrZsaPcAxpwOmRe7xi5gE61AZll1VkdygAiXTssKsrdm9R+gOHRQyeqC4JgSj01 gOP1f965M2FRhFJLKPv27EX8MNefIoBp7KjcnlA5QI93LmgSchc8FPQfvFeLAQjZZGWa DJdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=DzfPkrsHVrap+B5JD7fqRR+3BmI5kvbs99homa/INDo=; fh=DP61/jJCya+1W1X7P2vK6pKSD4lkczCotBkmA6jh/us=; b=O6dC4zHKR5eXc6qHJfSLvyVjGT3tPIRb1bi2xV5oGPXfslDUlV/rAQpnlg5HK/zXwh 2EdyDMNREmJx/hRGPVvo8EBaRGCQedB5//HcOsAxn+s0TgobHmzjgVQ/OHdTP9tyllad vcZ2BYWCBybe1XEjdqN1koGe6Io5hTvEVRrngge5Y4J5gVQxnM3WH62aeh8EXVYmOrh5 yTaS7UFHW+I70+9fktRSwMzS4FlNAD+MjL9N4L2VIT5I4ep7jH0k7PyO3R2T3QeJKwNL lvRTSPQU+rMVlaM6ys701XAaLVBJy5MJmtfLpyRDqr3MibVlKr9f+caFysGCkTUhyOOr gp0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="WbY4jj3/"; dkim=neutral (no key) header.i=@suse.de header.b=099nYc38; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e5-20020a50fb85000000b005254cf8c6e9si3192284edq.656.2023.08.14.06.24.23; Mon, 14 Aug 2023 06:24:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="WbY4jj3/"; dkim=neutral (no key) header.i=@suse.de header.b=099nYc38; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232744AbjHNL5j (ORCPT + 99 others); Mon, 14 Aug 2023 07:57:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233163AbjHNL4t (ORCPT ); Mon, 14 Aug 2023 07:56:49 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A300319B1 for ; Mon, 14 Aug 2023 04:56:33 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B21791FD6A; Mon, 14 Aug 2023 11:55:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1692014157; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DzfPkrsHVrap+B5JD7fqRR+3BmI5kvbs99homa/INDo=; b=WbY4jj3/sk00FggPcUN6O0aD11Ah7Xhq+9Ug/mn6uRgymnckvhjVFU6IXtJSwKdQ+dk/2F Yo/d032FvvXeB8krreZ/19OZkriFdaDStfhsTIy1uA7WzBm919g5MiiVnx/TSdrbROjrAG lrYKqiLMEQUOOb9NKAlWSEsgEK2AGl4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1692014157; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DzfPkrsHVrap+B5JD7fqRR+3BmI5kvbs99homa/INDo=; b=099nYc389SygLDTBfFZDK/anaM2wRHsyU4Xjdu8kvoIqxfk4wm3T2Fest5dDR87Ll+kAnz HVUVFF0jBqvphtDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9181E138EE; Mon, 14 Aug 2023 11:55:57 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id UEaxIU0W2mRnMAAAMHmgww (envelope-from ); Mon, 14 Aug 2023 11:55:57 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org, Takashi Iwai Subject: [PATCH 25/25] ALSA: pcm: Drop obsoleted PCM copy_user and copy_kernel ops Date: Mon, 14 Aug 2023 13:55:23 +0200 Message-Id: <20230814115523.15279-26-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230814115523.15279-1-tiwai@suse.de> References: <20230814115523.15279-1-tiwai@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Finally all users have been converted to the new PCM copy ops, let's drop the obsoleted copy_kernel and copy_user ops completely. Signed-off-by: Takashi Iwai --- include/sound/pcm.h | 5 ----- sound/core/pcm_lib.c | 18 +----------------- sound/core/pcm_native.c | 2 +- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/include/sound/pcm.h b/include/sound/pcm.h index f75beead79e3..958a0b284b5f 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -71,11 +71,6 @@ struct snd_pcm_ops { unsigned long pos, unsigned long bytes); int (*copy)(struct snd_pcm_substream *substream, int channel, unsigned long pos, struct iov_iter *iter, unsigned long bytes); - int (*copy_user)(struct snd_pcm_substream *substream, int channel, - unsigned long pos, void __user *buf, - unsigned long bytes); - int (*copy_kernel)(struct snd_pcm_substream *substream, int channel, - unsigned long pos, void *buf, unsigned long bytes); struct page *(*page)(struct snd_pcm_substream *substream, unsigned long offset); int (*mmap)(struct snd_pcm_substream *substream, struct vm_area_struct *vma); diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 3303914c58ea..4859fb1caec9 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -2031,19 +2031,6 @@ static int default_read_copy(struct snd_pcm_substream *substream, return 0; } -/* a wrapper for calling old copy_kernel or copy_user ops */ -static int call_old_copy(struct snd_pcm_substream *substream, - int channel, unsigned long hwoff, - struct iov_iter *iter, unsigned long bytes) -{ - if (iov_iter_is_kvec(iter)) - return substream->ops->copy_kernel(substream, channel, hwoff, - iter_iov_addr(iter), bytes); - else - return substream->ops->copy_user(substream, channel, hwoff, - iter_iov_addr(iter), bytes); -} - /* call transfer with the filled iov_iter */ static int do_transfer(struct snd_pcm_substream *substream, int c, unsigned long hwoff, void *data, unsigned long bytes, @@ -2147,7 +2134,7 @@ static int pcm_sanity_check(struct snd_pcm_substream *substream) if (PCM_RUNTIME_CHECK(substream)) return -ENXIO; runtime = substream->runtime; - if (snd_BUG_ON(!substream->ops->copy && !substream->ops->copy_user && !runtime->dma_area)) + if (snd_BUG_ON(!substream->ops->copy && !runtime->dma_area)) return -EINVAL; if (runtime->state == SNDRV_PCM_STATE_OPEN) return -EBADFD; @@ -2255,9 +2242,6 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream, } else { if (substream->ops->copy) transfer = substream->ops->copy; - else if ((in_kernel && substream->ops->copy_kernel) || - (!in_kernel && substream->ops->copy_user)) - transfer = call_old_copy; else transfer = is_playback ? default_write_copy : default_read_copy; diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 34efd4d198d6..bd9ddf412b46 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -809,7 +809,7 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream, runtime->boundary *= 2; /* clear the buffer for avoiding possible kernel info leaks */ - if (runtime->dma_area && !substream->ops->copy && !substream->ops->copy_user) { + if (runtime->dma_area && !substream->ops->copy) { size_t size = runtime->dma_bytes; if (runtime->info & SNDRV_PCM_INFO_MMAP) -- 2.35.3