Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1774623imm; Wed, 16 May 2018 02:54:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoNqrA7oKKoxq0ekHxkK06WYYAuyd6s7Vd6+srjlY95M5k6Xwk//pr1g3Ey8JwBj0qsBTY6 X-Received: by 2002:a17:902:7d94:: with SMTP id a20-v6mr195910plm.123.1526464459411; Wed, 16 May 2018 02:54:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526464459; cv=none; d=google.com; s=arc-20160816; b=qiXgj2jKu9VpLmO6Sra7RXCp/txE/wtLr+lVUy7pPjPzDIFDso03xxOrBfgwxV4wnZ Pe1G1i3ftlJHnEORFBy64JrfaYY0WlGWsGn3GuTNQJz1ENCvK6jdP8oI9xSauY0wSpQ8 GT0RA98uQfoXSb/HbjPDF8YrggRzoPQByuMDaASl0C4p7UROYTDF+DOxVBbozH9R3tMB Yfa5j2R1jB9It+Tk2FiNcXegCOxWDr5CFMVZ8Drnh+y6gVW17tGohlhv+P1gM0ybjL2p ZL5ystHtyBJp9zHmdANqucs7xHH4YnbGwbQQRddmIgu31mfu9Zi2ZyfCzvGLSxSonZc4 fG3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=s3efiSKkM68TWRts1b+lAAWo7Xu5nIomW4wufMOcSDc=; b=KAtZaW5W/gfxCNU4cI2ZjvF2Wzhe9qcO+bi+cYrdVnPaG1FolvCW6M0iKOdOTnj8yp LK2tZhEWHeuiffGsbIyoVz3mp2yhUGm5wsG8+p63x0N5Ef98t4LpoDnspi2Cbh1tX5Ta pSHfys4SLdGFoiMElroqQwup2d/8SS1K1UL4Kr9FB3tsmGvlR/1XnqVtnkYOf3UEiiTh szB9c6R6yNMDLJv/RRSHphZH/bq1T8AM60igKuXYMCUtvO2Pypbl2qa9Vp+a0nkZ5pLx TVziOoHdF2RvD5OUtf5RpAJLejS2WiZj3ealkKsHDU9ibCzNh0ZSjWekQy56YfeJK6+2 m5hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=hF2Ion7C; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k26-v6si1753316pgf.522.2018.05.16.02.54.05; Wed, 16 May 2018 02:54:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=hF2Ion7C; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753270AbeEPJv6 (ORCPT + 99 others); Wed, 16 May 2018 05:51:58 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:48450 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752993AbeEPJqx (ORCPT ); Wed, 16 May 2018 05:46:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=s3efiSKkM68TWRts1b+lAAWo7Xu5nIomW4wufMOcSDc=; b=hF2Ion7CSGcXAdRbsKLEBhMFu MdyFZ8JPzNi7B2lr+IooB/3WKhFgqAcjqvHKxOappau3pSLfyUyEvE2lvAMf677PeV8gVAdviFAr4 8LVxvfUFuEXqQS0wcdSiIrPhEcPQG75F8/WTRUaHsH3myT+dkvQxTwt78oQrZx/mlBLtmaQncuKil qTpj7l+V2rZSsrpvOGLQmFLkmCN2FtSJ1hShkXbcgc5pP1RtZBq++Zkj9wPTw4fxqMEopNChsoJN/ DHypbaR22Eo5QAnm+l29SdJoARLIYGYQYF/UzTdaqjsQlKGp0KCYR0V3trZjyv2HCXhFAkLV7ZwMN iM97VDm4g==; Received: from 089144199016.atnat0008.highway.a1.net ([89.144.199.16] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIt14-00082B-ON; Wed, 16 May 2018 09:46:39 +0000 From: Christoph Hellwig To: Andrew Morton , Alexander Viro Cc: Alexey Dobriyan , Greg Kroah-Hartman , Jiri Slaby , Alessandro Zummo , Alexandre Belloni , linux-acpi@vger.kernel.org, drbd-dev@lists.linbit.com, linux-ide@vger.kernel.org, netdev@vger.kernel.org, linux-rtc@vger.kernel.org, megaraidlinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, devel@driverdev.osuosl.org, linux-afs@lists.infradead.org, linux-ext4@vger.kernel.org, jfs-discussion@lists.sourceforge.net, netfilter-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 39/42] ide: remove ide_driver_proc_write Date: Wed, 16 May 2018 11:43:43 +0200 Message-Id: <20180516094346.20506-40-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180516094346.20506-1-hch@lst.de> References: <20180516094346.20506-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The driver proc file hasn't been writeable for a long time, so this is just dead code. Signed-off-by: Christoph Hellwig Acked-by: "Eric W. Biederman" --- drivers/ide/ide-proc.c | 46 ------------------------------------------ 1 file changed, 46 deletions(-) diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c index 863db44c7916..b3b8b8822d6a 100644 --- a/drivers/ide/ide-proc.c +++ b/drivers/ide/ide-proc.c @@ -528,58 +528,12 @@ static int ide_driver_proc_open(struct inode *inode, struct file *file) return single_open(file, ide_driver_proc_show, PDE_DATA(inode)); } -static int ide_replace_subdriver(ide_drive_t *drive, const char *driver) -{ - struct device *dev = &drive->gendev; - int ret = 1; - int err; - - device_release_driver(dev); - /* FIXME: device can still be in use by previous driver */ - strlcpy(drive->driver_req, driver, sizeof(drive->driver_req)); - err = device_attach(dev); - if (err < 0) - printk(KERN_WARNING "IDE: %s: device_attach error: %d\n", - __func__, err); - drive->driver_req[0] = 0; - if (dev->driver == NULL) { - err = device_attach(dev); - if (err < 0) - printk(KERN_WARNING - "IDE: %s: device_attach(2) error: %d\n", - __func__, err); - } - if (dev->driver && !strcmp(dev->driver->name, driver)) - ret = 0; - - return ret; -} - -static ssize_t ide_driver_proc_write(struct file *file, const char __user *buffer, - size_t count, loff_t *pos) -{ - ide_drive_t *drive = PDE_DATA(file_inode(file)); - char name[32]; - - if (!capable(CAP_SYS_ADMIN)) - return -EACCES; - if (count > 31) - count = 31; - if (copy_from_user(name, buffer, count)) - return -EFAULT; - name[count] = '\0'; - if (ide_replace_subdriver(drive, name)) - return -EINVAL; - return count; -} - static const struct file_operations ide_driver_proc_fops = { .owner = THIS_MODULE, .open = ide_driver_proc_open, .read = seq_read, .llseek = seq_lseek, .release = single_release, - .write = ide_driver_proc_write, }; static int ide_media_proc_show(struct seq_file *m, void *v) -- 2.17.0