From patchwork Tue Oct 11 00:32:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Klimov X-Patchwork-Id: 9370019 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 EBB40607D2 for ; Tue, 11 Oct 2016 00:32:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D223E28D0A for ; Tue, 11 Oct 2016 00:32:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3D2C28831; Tue, 11 Oct 2016 00:32:58 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 08F5328831 for ; Tue, 11 Oct 2016 00:32:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752578AbcJKAc5 (ORCPT ); Mon, 10 Oct 2016 20:32:57 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:34316 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752538AbcJKAc4 (ORCPT ); Mon, 10 Oct 2016 20:32:56 -0400 Received: by mail-lf0-f66.google.com with SMTP id p80so875987lfp.1; Mon, 10 Oct 2016 17:32:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=ye+V7wR6NUhUfO7/kKyb2ltS1cNbP7hBNmstysszneA=; b=CV4pp/JuXw0oaiXdwWPEbdqvvnD/LM2Q0/Bj29uTmFGyPL4YpveeFdxky3ZoZFuo8M GB6m4D/8N5lHSYkPHI7S0XYLPAM0CikURp2lSs/7LgqgQxZwH5nxIlyBi/VA5S6OT2GL bFmVM/62OWpRxDs51/5fVUJV9mgVQ8OD//mUVYh7dfA2N0BHVsYWNn0QsKqfsefxKSwA kREO+XgW7yUl+SoQkOLzNSp0JAfehx3XhZ1W6JKPKPFIWyPG2YaATYtWRj45d8S7q0/h 2Rg0h6mWshxE/ZRVPr/c6Ac/fR0Bm3ARjBo3h2rsVYGJVSxb5IzinBfCGZ6/9rcu1Hta BKOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ye+V7wR6NUhUfO7/kKyb2ltS1cNbP7hBNmstysszneA=; b=DuVVCvIaQm2XHxYRMDKh1C8QkDftX8ojeYptQTlhBkccU/6VpKF70BLO00UL60/tiv 3fziGT8Mr88N1YIKAkHrc7mdntEan2bB61eUSqyB4kBVfld0Y4swuQHfOe0mzhACj96J YIzinRV68e5CExoywno6MQmnGfnWipxF2Zjf1keFUZZdy+AeB2ybFtVT10BXV356P98e gE86I32VNfFLb3stOG1/z7I57RIxn2RVHTkg/VYNKXvR5DG7a6U71a78VnvRg5qNB5IB qQdS9Z2QpkMxAAwbQyqJM9oSxiL8STmUBRY4AYVThh2rTUt3FClu+4mR8OIG6T6PtBqu pXTA== X-Gm-Message-State: AA6/9Rnyfepm310OigyJESb188b1XWtV84kPQI+uDUQfpHoSCdA3KN80K608qWBq48o9EQ== X-Received: by 10.194.104.98 with SMTP id gd2mr1045925wjb.216.1476145974655; Mon, 10 Oct 2016 17:32:54 -0700 (PDT) Received: from localhost.localdomain (cpc92794-cmbg19-2-0-cust242.5-4.cable.virginm.net. [81.96.84.243]) by smtp.gmail.com with ESMTPSA id 17sm1187731wju.44.2016.10.10.17.32.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Oct 2016 17:32:53 -0700 (PDT) From: Alexey Klimov To: axboe@kernel.dk, linux-block@vger.kernel.org, axboe@fb.com Cc: jmoyer@redhat.com, linux-kernel@vger.kernel.org, yury.norov@gmail.com, Alexey Klimov Subject: [PATCH RESEND] elevator: remove second argument in elevator_init() Date: Tue, 11 Oct 2016 01:32:49 +0100 Message-Id: <20161011003249.5010-1-klimov.linux@gmail.com> X-Mailer: git-send-email 2.9.3 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Last user of elevator_init() with non-NULL name as second argument that supposed to be s390 dasd driver has gone few releases ago. Drivers rely on elevator_change(), elevator_switch() and friends for example. Right now elevator_init() is always called as elevator_init(q, NULL). Patch removes passing of second name argument and its usage. While we're at it fix following if-check after removed lines. We know that elevator_type e is initialized by NULL and need to check only chosen_elevator. Signed-off-by: Alexey Klimov Reviewed-by: Jeff Moyer --- block/blk-core.c | 2 +- block/elevator.c | 10 ++-------- include/linux/elevator.h | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 36c7ac3..6e36d0b 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -871,7 +871,7 @@ blk_init_allocated_queue(struct request_queue *q, request_fn_proc *rfn, mutex_lock(&q->sysfs_lock); /* init elevator */ - if (elevator_init(q, NULL)) { + if (elevator_init(q)) { mutex_unlock(&q->sysfs_lock); goto fail; } diff --git a/block/elevator.c b/block/elevator.c index f7d973a..e810938 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -177,7 +177,7 @@ static void elevator_release(struct kobject *kobj) kfree(e); } -int elevator_init(struct request_queue *q, char *name) +int elevator_init(struct request_queue *q) { struct elevator_type *e = NULL; int err; @@ -196,18 +196,12 @@ int elevator_init(struct request_queue *q, char *name) q->end_sector = 0; q->boundary_rq = NULL; - if (name) { - e = elevator_get(name, true); - if (!e) - return -EINVAL; - } - /* * Use the default elevator specified by config boot param or * config option. Don't try to load modules as we could be running * off async and request_module() isn't allowed from async. */ - if (!e && *chosen_elevator) { + if (*chosen_elevator) { e = elevator_get(chosen_elevator, false); if (!e) printk(KERN_ERR "I/O scheduler %s not found\n", diff --git a/include/linux/elevator.h b/include/linux/elevator.h index e7f358d..ab6963e 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h @@ -159,7 +159,7 @@ extern void elv_unregister(struct elevator_type *); extern ssize_t elv_iosched_show(struct request_queue *, char *); extern ssize_t elv_iosched_store(struct request_queue *, const char *, size_t); -extern int elevator_init(struct request_queue *, char *); +extern int elevator_init(struct request_queue *); extern void elevator_exit(struct elevator_queue *); extern int elevator_change(struct request_queue *, const char *); extern bool elv_bio_merge_ok(struct request *, struct bio *);