From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3319EC433E1 for ; Mon, 17 Aug 2020 07:44:45 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D291820738 for ; Mon, 17 Aug 2020 07:44:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ULgPyG8A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D291820738 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4BVQzv1q6kzDqPK for ; Mon, 17 Aug 2020 17:44:43 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=casper.srs.infradead.org (client-ip=2001:8b0:10b:1236::1; helo=casper.infradead.org; envelope-from=batv+1cabf852a0fb828109f5+6203+infradead.org+hch@casper.srs.infradead.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=ULgPyG8A; dkim-atps=neutral Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4BVQjl3BNRzDqN5 for ; Mon, 17 Aug 2020 17:32:27 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=bPO6IUsgQ1dooQn8lqNrZ8txirq2bFGwte1YnA3ccwk=; b=ULgPyG8AIdpi54WFRLGQa3atjG MYcmUn91T2ZJwQ8XUjt9xRibemgLD7hIV+9q374K0MCkC0goKr1Y5e6cPl974kSIuI9du3LtRhqWy pVNlGGcYWdlFvV35a8J+rXDvK/p4cY4tcFx0JloEF90rwLpx6aRcRrKuOjirQ9xAKtPSPbpuRxs7c 3Ey2vwIhY4owqJn2UjpCnCdSPT4bw5VuudP/c4hvH+V44EHWcyL4DPUp+UiUSngAzDKo4/Iu/3U4j qumfNWtUCBhkIE77s5aYJXDpSNz0oppHKsoMsQuY93PpZh7c4n94SxD6zUNW0R+Mw0/+U5Ii6zhDS k6IPCgFQ==; Received: from [2001:4bb8:188:3918:4550:cdf7:3d45:afb9] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1k7Zcu-0000uv-IA; Mon, 17 Aug 2020 07:32:17 +0000 From: Christoph Hellwig To: Al Viro , Michael Ellerman , x86@kernel.org Subject: [PATCH 01/11] mem: remove duplicate ops for /dev/zero and /dev/null Date: Mon, 17 Aug 2020 09:32:02 +0200 Message-Id: <20200817073212.830069-2-hch@lst.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817073212.830069-1-hch@lst.de> References: <20200817073212.830069-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Kees Cook , linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" There is no good reason to implement both the traditional ->read and ->write as well as the iter based ops. So implement just the iter based ones. Suggested-by: Al Viro Signed-off-by: Christoph Hellwig --- drivers/char/mem.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 687d4af6945d36..14851f36787372 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -670,18 +670,6 @@ static ssize_t write_port(struct file *file, const char __user *buf, return tmp-buf; } -static ssize_t read_null(struct file *file, char __user *buf, - size_t count, loff_t *ppos) -{ - return 0; -} - -static ssize_t write_null(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) -{ - return count; -} - static ssize_t read_iter_null(struct kiocb *iocb, struct iov_iter *to) { return 0; @@ -872,7 +860,6 @@ static int open_port(struct inode *inode, struct file *filp) #define zero_lseek null_lseek #define full_lseek null_lseek -#define write_zero write_null #define write_iter_zero write_iter_null #define open_mem open_port #define open_kmem open_mem @@ -903,8 +890,6 @@ static const struct file_operations __maybe_unused kmem_fops = { static const struct file_operations null_fops = { .llseek = null_lseek, - .read = read_null, - .write = write_null, .read_iter = read_iter_null, .write_iter = write_iter_null, .splice_write = splice_write_null, @@ -919,7 +904,6 @@ static const struct file_operations __maybe_unused port_fops = { static const struct file_operations zero_fops = { .llseek = zero_lseek, - .write = write_zero, .read_iter = read_iter_zero, .write_iter = write_iter_zero, .mmap = mmap_zero, -- 2.28.0