From patchwork Fri Jan 15 01:46:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Klimov X-Patchwork-Id: 8037331 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 53D259F32E for ; Fri, 15 Jan 2016 01:46:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 72645204FB for ; Fri, 15 Jan 2016 01:46:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 61682204F6 for ; Fri, 15 Jan 2016 01:46:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751193AbcAOBq2 (ORCPT ); Thu, 14 Jan 2016 20:46:28 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:34276 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750805AbcAOBq1 (ORCPT ); Thu, 14 Jan 2016 20:46:27 -0500 Received: by mail-wm0-f42.google.com with SMTP id u188so5448806wmu.1; Thu, 14 Jan 2016 17:46:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=ev+TQ3ZMUK28atiyh65J+b/vV0lzu1AWLq49NUYSAuA=; b=QONBHN4EuqjzmYadkPx3fkIy/MDMmaKyevqaF+xJEvpz+z7RnFguzOPuF8ZPJd9I+I NdIwrMPuPBArbd5po8pEngDA23q0/noRU8x9ovKRZKk+Pgv3A+wkA37KIw/onY0j4f03 hHFZ3lZiFpXnp7ytdhVOOQ2xm4vZVek2xtQ2gOte/bD0Mrlo1ACc9x/ef7Ia6gXvHLFo uAxT3heSA+kmugY12QWBJB8BIYfaFR3qDSe3S7mWXqJWTO4sd07ShJpF/7xYShg0SHAA ZLsUjxMbeR4OFFOLTCC+Yc9RE342kYz/yg0D9rf7EmlnitzWenRBNirnIZ57LOVUBQ/7 Qf/Q== 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=ev+TQ3ZMUK28atiyh65J+b/vV0lzu1AWLq49NUYSAuA=; b=eYhJh9J27kuuws87wHMeHU6Ktm2BcawqUfUXXTgKTY9wqsTYIrhKSZrEKXWPjMnmai RmbNZ2ZX/BEcJtOouzJ9B0NDCf9zO+NJF7PmcGi/dqqy40SAUobMG89kjGIqbh41xsmc WXT0AaQAPpEYwBJQFCFNEaFp+RebzoCcukZKYeX7drZZJuKGXZxHLxVLt/03G8UZz1bz yiiTMeEfY5GxvBRWTbMCL6sp1cShV8eOgtLyYk+bhr8fZjQtnOXPwkcK2BjMKchsVf94 dsRLQaf/okRQ3KZQ/Wd9ePez/X6ZrCC9n6XoneChMfxd52lEqIaBgS8bbwS3VAZ9Ecyt Dt1A== X-Gm-Message-State: ALoCoQlSicCTAFAgXQmUbXkFvkyB3l1mwOSccXgxh90sP1V67g9LY3j+UQnGvUjZxSNqiABgxvT45VrNp3jMOUNcK1gDVzn0fQ== X-Received: by 10.194.172.35 with SMTP id az3mr8300570wjc.64.1452822385748; Thu, 14 Jan 2016 17:46:25 -0800 (PST) Received: from localhost.localdomain (cpc91216-cmbg18-2-0-cust122.5-4.cable.virginm.net. [81.103.31.123]) by smtp.gmail.com with ESMTPSA id 73sm320518wmm.7.2016.01.14.17.46.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Jan 2016 17:46:24 -0800 (PST) From: Alexey Klimov To: axboe@kernel.dk, linux-block@vger.kernel.org Cc: linux-kernel@vger.kernel.org, yury.norov@gmail.com, klimov.linux@gmail.com Subject: [PATCH] elevator: remove second argument in elevator_init() Date: Fri, 15 Jan 2016 01:46:11 +0000 Message-Id: <1452822371-4967-1-git-send-email-klimov.linux@gmail.com> X-Mailer: git-send-email 2.5.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.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 33e2f62..f742ef4 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -861,7 +861,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 c3555c9..ff5c830 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 638b324..0ae0efd 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h @@ -154,7 +154,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_rq_merge_ok(struct request *, struct bio *);