From patchwork Fri Nov 25 15:53:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinlong Chen X-Patchwork-Id: 26083 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4118918wrr; Fri, 25 Nov 2022 07:55:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf6evsZs2PMcPPYhOfqvQ0rCE/ad6RvvBw+Cr4FeaPq8YiNmncfklF0FybnSI0tx8tbUCCir X-Received: by 2002:a17:906:99c8:b0:7b5:ff35:6715 with SMTP id s8-20020a17090699c800b007b5ff356715mr15275255ejn.255.1669391750375; Fri, 25 Nov 2022 07:55:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669391750; cv=none; d=google.com; s=arc-20160816; b=mNgR4FgboMylPJ227eg5kXdSSENpgekXwg6X6ewS6NEK11sAIY3mYNmgvLGCsd/VFE 6SR0WUUOrg4+5nTRqD8Zr2Ix4nU8UrpeBfAIn9KIAWShoVyXjl3vRml2aa1MXMwt9G0p 8gkQm7TYA/UN3m/k+6EjF1hv/SkzNu5uXhbEkU8CR7EHAZxajgbjEtfJb3/Xot6e6IKS D3ekgYP5nh9hU1dManGXpKc/jpsS7LxbPJCq9o5VZLK+P7SV/aL9499I8ubCnsGvEOJf LAfVREskF+AXxrCG0lAn2a1MhgQvrbQGbcyOwyp3Xoz6ChFNFr/0ZJfRbvW4xdBLJTr2 zAVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=PKhOOvtlfb2qi0t8kP3a+apl+9/7kIQvBSOWJ9+Wfec=; b=P4GvdiALjqUGYqMnXDRAuqZq6n0LagNlm78Qq0ExYKUw8u/eLYrlxLsoEd4cxGKwg1 4xWPq3Y4QBtDbW+kfyzL/mtN1Zv+cz0afYKAVi5vTsnJyzMPKi4gb9h/K8waa9smtApr DtQrI6fn9UIACFzknhfM7OP5r42Gv8iIpA8O9HSy204lYBB4Slh+1lhx8qJPIyNYPoE2 kwsLZZbG1fJsXdgM9u0I0uYnh31dELmWRVryASVfrKIANBeQHhezPVS5EeKFhh5UmwuN 8kaidBp5AyjfHYxVfAV58J6zJt1trjW4XsPWDe1fCnEruCFUNHpxEqYnWKoi216ctA+g PtXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go14-20020a1709070d8e00b007aeb99bbb99si3050548ejc.48.2022.11.25.07.55.23; Fri, 25 Nov 2022 07:55:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229956AbiKYPyJ (ORCPT + 99 others); Fri, 25 Nov 2022 10:54:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229795AbiKYPxr (ORCPT ); Fri, 25 Nov 2022 10:53:47 -0500 Received: from zju.edu.cn (spam.zju.edu.cn [61.164.42.155]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 25CBF4EC0D; Fri, 25 Nov 2022 07:53:30 -0800 (PST) Received: from localhost.localdomain (unknown [10.14.30.50]) by mail-app4 (Coremail) with SMTP id cS_KCgCXK97s5IBjv2N5CA--.23174S4; Fri, 25 Nov 2022 23:53:26 +0800 (CST) From: Jinlong Chen To: axboe@kernel.dk Cc: hch@lst.de, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, nickyc975@zju.edu.cn Subject: [PATCH 2/4] elevator: replace continue with else-if in elv_iosched_show Date: Fri, 25 Nov 2022 23:53:12 +0800 Message-Id: <852b18c086ef08baec99d08479a3558a3d5db70f.1669391142.git.nickyc975@zju.edu.cn> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CM-TRANSID: cS_KCgCXK97s5IBjv2N5CA--.23174S4 X-Coremail-Antispam: 1UD129KBjvdXoWrtr48XryrAr18ArWrur4UJwb_yoW3AFb_Ka s5Xwn7J345Jr9Ikr1jvFn5tFWjvwn3Jr15Kwnrtr97ta90gFyfA3Wxua45JryDWFWUu3s8 Cw1DZFn7CryxKjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbIAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AK wVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20x vE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4UJVW0owA2z4x0Y4vEx4A2 jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAac4AC62xK8xCEY4 vEwIxC4wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv 7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r 1j6r4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCF04k20xvY0x0E wIxGrwCF04k20xvE74AGY7Cv6cx26r4fKr1UJr1l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2 IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v2 6r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2 IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv 67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyT uYvjfUOlksUUUUU X-CM-SenderInfo: qssqjiaqqzq6lmxovvfxof0/1tbiAgEDB1ZdtcjbFAAJs3 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750484124001718662?= X-GMAIL-MSGID: =?utf-8?q?1750484124001718662?= else-if is more readable than continue here. Signed-off-by: Jinlong Chen --- block/elevator.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/block/elevator.c b/block/elevator.c index 308bee253564..ffa750976d25 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -776,11 +776,9 @@ ssize_t elv_iosched_show(struct request_queue *q, char *name) spin_lock(&elv_list_lock); list_for_each_entry(e, &elv_list, list) { - if (e == cur) { + if (e == cur) len += sprintf(name+len, "[%s] ", cur->elevator_name); - continue; - } - if (elv_support_features(q, e)) + else if (elv_support_features(q, e)) len += sprintf(name+len, "%s ", e->elevator_name); } spin_unlock(&elv_list_lock);