From patchwork Thu Apr 19 12:41:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 900851 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="UI7xAj+l"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40RdxG24SBz9s1X for ; Thu, 19 Apr 2018 22:45:06 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751228AbeDSMod (ORCPT ); Thu, 19 Apr 2018 08:44:33 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:41204 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751537AbeDSMoa (ORCPT ); Thu, 19 Apr 2018 08:44:30 -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=cBbdKHM7GeinFPesJMhJAN7DykfH1UqJGpgBtKiAIiw=; b=UI7xAj+lm/ukl+hlwQefkKcZp b6RiZBReUbkTshSW5gcTvtS+X3LNWF1WHv6ElCjv/z5dBhsDF+dC36N64n/yAqJhXRnrwmhWqEGMG MHD8iEpDrXL3NKWTJ8bPbZWEKgBrqGocPAjvzswUkrK4hSVAK/oQkybkei2T5W0QgiXXEbHhgHFe7 xd//dZBpL9GscU2U73OuJoGnK7UBO1/vpeyTJ+S+ZqHoF8OeJzXtElbAdGNCcrELpGrD/DbNxAMf1 dw3nd58FxR5VNBSVcXgurpVm9YKoPDlOTLmCI/2vfkXJfis46W/+22EON5mRMxDQ7WTVvsSidMLyC szNmJq5mA==; Received: from static-242-42-24-46.ipcom.comunitel.net ([46.24.42.242] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1f98ud-0004Ip-Lm; Thu, 19 Apr 2018 12:43:44 +0000 From: Christoph Hellwig To: Andrew Morton , Alexander Viro Cc: Alexey Dobriyan , Greg Kroah-Hartman , Jiri Slaby , Corey Minyard , 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 37/39] ide: remove ide_driver_proc_write Date: Thu, 19 Apr 2018 14:41:38 +0200 Message-Id: <20180419124140.9309-38-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419124140.9309-1-hch@lst.de> References: <20180419124140.9309-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-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@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 --- 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)