From patchwork Wed Jun 19 22:01:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11005405 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E77DC112C for ; Wed, 19 Jun 2019 22:01:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6597286AE for ; Wed, 19 Jun 2019 22:01:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C904F28782; Wed, 19 Jun 2019 22:01: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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 7D739286AE for ; Wed, 19 Jun 2019 22:01:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726322AbfFSWB6 (ORCPT ); Wed, 19 Jun 2019 18:01:58 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:3312 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726230AbfFSWB5 (ORCPT ); Wed, 19 Jun 2019 18:01:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1560981717; x=1592517717; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=D9U2HPu6ZOTNILV65ybHX1iqiYPNs4JUq1wtjqsbBCM=; b=cErvzcsOZFhiIkH7HyVZBqvz63bLfyjDeN6rlw6ivp4M0xfsE5dlqLHl mw1AzIQ9/WESbb/lt2ytwyCQPDtat2NV+cWhpAA50XvnpSMgCiX2WZP2F V1eWtFrfNxkG4cDljCLMhE+o35pvto9vJmFsLDCjodk3YvgikoJWYNdDY DvOWjFxPCkRtiETm8N2RUPov5jidnQO1yohCxQ8awJt+JherHVWYT7bEj Dxx4ZAidgZXclFot2vQen5sXfbuJix1QMXZLo4VUenNpLds84Zjj0ft19 lHY5IBAuEohMj9mSXQn5rAYIcudWB9VaJDvwAWK3+FXxpiZZJk3vDgGYe g==; X-IronPort-AV: E=Sophos;i="5.63,394,1557158400"; d="scan'208";a="112236312" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 20 Jun 2019 06:01:57 +0800 IronPort-SDR: XdUTPXU7q0kB08y9B4fh14WyOQOMhl1IEmHdnm+DNC61z7CWBY6udtKNtB89ljupVdhaKXfjOu AeApBHQvQDmNXb3AvSZDpBNEaMH3ok55Goce4URErMsR2pRumYeTfkCvsm5lV8cgzKUeN3V7qj IfUEqBilmzyYZfCsew1hNiuSYQpqn5U+b+7gF1u+YTjqMLuI0ZDhCdkiCV4cFUbeVCYZvmDBlQ 5jzvAlnWpRvBsC1mgDJphAglZeXLVpAE6LL0H7laW8+98jrQzr81UzNOtLlZsie5GpGW4sMtVM KSJ0OxTPLRC5ZCS3cy8n1D61 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 19 Jun 2019 15:01:24 -0700 IronPort-SDR: dg/SAC+dFuS87lYfjxH5qi+mXUBJ08wfWJAM/AMMHgIZQF+2iiu4q2QYpUGgCn8geILGAhw62x IfKMSOcGz8dWYam0lIAzmlIaOXyc/7AxWkiiOScWL+lzDQoCYeFmtAz4NVCm79T2OsctqWF8KW 3hYS7VFZvVEfTqYM5RyMeztqZsJPlSFNyLZ4HLj16KMPzLMkMq6iXMuOKKx/Y7XvjD86LcnmoU WZX0KDMZFAzyyW+7Gj1QuE+kksF6umNFLCDZsb24vKwICtkbc2KpGED5C730gQj3hEczPthS/d z48= Received: from cmercuryqemu.hgst.com ([10.202.65.32]) by uls-op-cesaip01.wdc.com with ESMTP; 19 Jun 2019 15:01:57 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: Chaitanya Kulkarni Subject: [PATCH 1/3] block: get rid of redundant else Date: Wed, 19 Jun 2019 15:01:48 -0700 Message-Id: <20190619220150.6271-2-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190619220150.6271-1-chaitanya.kulkarni@wdc.com> References: <20190619220150.6271-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 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 This is a pure code cleanup patch and doesn't change any functionality. This removes the redundant else in the code which is not needed since we are returning from function anyway. Signed-off-by: Chaitanya Kulkarni --- block/blk-mq-debugfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 5d940ff124a5..84394835e2b0 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -779,8 +779,8 @@ static int blk_mq_debugfs_release(struct inode *inode, struct file *file) if (attr->show) return single_release(inode, file); - else - return seq_release(inode, file); + + return seq_release(inode, file); } static const struct file_operations blk_mq_debugfs_fops = { From patchwork Wed Jun 19 22:01:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11005407 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 60AD4112C for ; Wed, 19 Jun 2019 22:02:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EFE7286AE for ; Wed, 19 Jun 2019 22:02:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42F7128783; Wed, 19 Jun 2019 22:02:01 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 D5A3A286AE for ; Wed, 19 Jun 2019 22:02:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727244AbfFSWCA (ORCPT ); Wed, 19 Jun 2019 18:02:00 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:3312 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726230AbfFSWCA (ORCPT ); Wed, 19 Jun 2019 18:02:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1560981719; x=1592517719; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KlYi9Gd8YGlV34Ummeh1jSWI/pFfwkHWOYrKfb0A/yM=; b=lWIuuKPMZtLkPdbADuM1u2ontE+BuGWVa7TyhB5QAw21htcX+G3eMi7s /3ucOgm9puXBLopHWcsFydOT6eYoSegvStZHqqcpmXT8nfzFHJOvT9TFK BrL+pBt0AA2kEEqolXkXkk0JKJ/EPHGdodKl4S4BcKIOhJ2pemHxDqGXA 0a8zFCrq+vq21U4P2CEQvfxCn8q+29PovLOllJK0VAQptk3MFwAdN5TkW RjBw6WjXx5A9q2eJ32eL6qKia/AdA10qmj+2pCnL5IG+NwtYSI0rNhI2I uPqao58v8ygr/0ZTe1CMagdCJxpVNKCviwCmIo1JOIRVf7E8u+ynrHxQT A==; X-IronPort-AV: E=Sophos;i="5.63,394,1557158400"; d="scan'208";a="112236315" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 20 Jun 2019 06:01:59 +0800 IronPort-SDR: u5OOWluertQ2NZFLPnQVSHKsc4fWzdo5LJ48VzaiZIwFyIr45PfeqU9EL0IuUBG+LhvvvQ7opY J6+9kDfE4zHjRlMisyzzePfaqbFdi2B1s+IEtqtQ8/VJybsFysuzAjMAOohHvGDfLY9wvvoJM2 hIAl4hdlkr+ot4nKjRS4rS8mMAzt3Q+CABpDneY9hZDdmG3ElQfg4AHBI/E1sh+nj84nph+0tv 3mgX93ertNgdeQHWL9l9wWCpDE/wNLEA7R0MmWaMC+fCgV/fFsGyx/Ne/sTczCdwmIRVM7TUkQ KU+k59AAn6vemPQ0itIj59bK Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 19 Jun 2019 15:01:26 -0700 IronPort-SDR: cdgZbE7KcHsyqQ1scyjyC3WsC7KA5hh/zi1UAbTPi+lX64RqmEFfiG4kJq9f7mfDdIsBBAvfG+ OQ6aEFnPRccV8f8E5S6OTFlYcQHgOy990XRGvLdQzCpvXJjBL4+C+cEFwCDHlRO0uEk94RreqU 04+l9SXAgf2pnfAI+xiwmTeVZMJs03d0ZaOtiQ1jIGNII3OTGklzdOuOFlDnoJRczOE+ock1kZ hifAXDF1Ij0aGxGUZTzRrR0TttiTiYUFt+GN2y4k8n9B3ZTCwG3rxqGGYi3WDqhyA6aiwYCWLA xIU= Received: from cmercuryqemu.hgst.com ([10.202.65.32]) by uls-op-cesaip01.wdc.com with ESMTP; 19 Jun 2019 15:01:59 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: Chaitanya Kulkarni Subject: [PATCH 2/3] block: use right format specifier for op Date: Wed, 19 Jun 2019 15:01:49 -0700 Message-Id: <20190619220150.6271-3-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190619220150.6271-1-chaitanya.kulkarni@wdc.com> References: <20190619220150.6271-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 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 In function __blk_mq_debugfs_rq_show variable op has unsigned int type. Since op can never be negative use %u format specifier to match the variable type. Signed-off-by: Chaitanya Kulkarni --- block/blk-mq-debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 84394835e2b0..03b6aabbe602 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -347,7 +347,7 @@ int __blk_mq_debugfs_rq_show(struct seq_file *m, struct request *rq) if (op < ARRAY_SIZE(op_name) && op_name[op]) seq_printf(m, "%s", op_name[op]); else - seq_printf(m, "%d", op); + seq_printf(m, "%u", op); seq_puts(m, ", .cmd_flags="); blk_flags_show(m, rq->cmd_flags & ~REQ_OP_MASK, cmd_flag_name, ARRAY_SIZE(cmd_flag_name)); From patchwork Wed Jun 19 22:01:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11005409 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0B5E0112C for ; Wed, 19 Jun 2019 22:02:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE4CE286AE for ; Wed, 19 Jun 2019 22:02:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2AA328783; Wed, 19 Jun 2019 22:02:03 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 95180286AE for ; Wed, 19 Jun 2019 22:02:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730449AbfFSWCC (ORCPT ); Wed, 19 Jun 2019 18:02:02 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:3312 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726230AbfFSWCC (ORCPT ); Wed, 19 Jun 2019 18:02:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1560981722; x=1592517722; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3krMBlXIv+fvQVshUknz3FAaRGbmVERZA4kodq1qrYI=; b=TuZrO3RZFFNDyukhP007uEE+krQ5bDAPlm5swsOs3/0ow+kRvMbUyWga K10MSQAp2iOrrIiin4beIK+idJGopYwj8Pq1sBKEz/p8oRAh7k9COPz58 Eb0WCAapHqvVJ5zmI33I9ydvD/0AW3j3Z1iur1iQNwDFUabNYb9xR6JIg GhDcejIvN44SmtMeve5NnshhLYXEScvtUgxNkow+nQMo/n+PdBCgqFkhQ oA5Pj3rJ4FVkEgELyKpJLR6c1ZyluBOLQ2eRr9rkBKM9mmyG9P2FsJdie hxgkqQxSYZwERfirLu5AfeJukHhosiqHaRdmy8JZfRVTDMmFbIS7EjlCv w==; X-IronPort-AV: E=Sophos;i="5.63,394,1557158400"; d="scan'208";a="112236317" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 20 Jun 2019 06:02:02 +0800 IronPort-SDR: nC1thnorkCFYRKrMuN/aTZuBlgcS/x7YV00V11mloa/NB+x5/FNEGTMHoRLNEakwuH8ov/kHTz csuQLDSp2KV/UsBe2ZPjUTlg+2aC/MlXyI1fEcXwTTljGG79c5L8hOq2WhfXIpzU4khiwrmi0r SLju45Ci3S5SJPIiwEuwYkrf8WO6HiD8iwx+PmDIQeVQh2Au0DhSTUNL1ML9uXtbWAQlVf752H URudBOodBR93KLTdw+PES3MfHus00W8U12vaBOsEm0PhwgDJdHki4rPeeHvSmHj0PHg34NY0jD YPyml6MP8+36/lZA6k/CWyd1 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 19 Jun 2019 15:01:29 -0700 IronPort-SDR: Eh8nzoEjEo4/6sQZ7gX/2V9zmDpDLOmexXzIJESF5tcnbR1eZkpiazr2OnIY4svmD+OHRqQIXB 3Xl59w86j++8O1FoI1JzBPF/4JI6Bp5CdWFtZNxiu7GQPXC0dmHpwKJUCVKzMFGwZIZDze3mN4 X9Pb0uckaGhqyj0gKiBjkfyL8U4D8wufWHvkeN79KDhAmtIIlG9JmaszRJVCNEzZAw2ajM9veG 8MjzHORUHRJHORJMUZ36YNeS7WezI2T5xOeZiP+GeP8/IPDIMGFDIQrhCVIfPgRCXQlrzZVp9d HRE= Received: from cmercuryqemu.hgst.com ([10.202.65.32]) by uls-op-cesaip01.wdc.com with ESMTP; 19 Jun 2019 15:02:02 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: Chaitanya Kulkarni Subject: [PATCH 3/3] block: code cleanup queue_poll_stat_show() Date: Wed, 19 Jun 2019 15:01:50 -0700 Message-Id: <20190619220150.6271-4-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190619220150.6271-1-chaitanya.kulkarni@wdc.com> References: <20190619220150.6271-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 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 This is a pure code cleanup patch and doesn't change any functionality. Having multiple coding styles in the code creates confusion when someone tries to add a new code. Make queue_poll_stat_show() consistent by adding spaces around binary operators with the rest of the code. Signed-off-by: Chaitanya Kulkarni --- block/blk-mq-debugfs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 03b6aabbe602..a8376cc06a39 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -29,13 +29,13 @@ static int queue_poll_stat_show(void *data, struct seq_file *m) struct request_queue *q = data; int bucket; - for (bucket = 0; bucket < BLK_MQ_POLL_STATS_BKTS/2; bucket++) { - seq_printf(m, "read (%d Bytes): ", 1 << (9+bucket)); - print_stat(m, &q->poll_stat[2*bucket]); + for (bucket = 0; bucket < (BLK_MQ_POLL_STATS_BKTS / 2); bucket++) { + seq_printf(m, "read (%d Bytes): ", 1 << (9 + bucket)); + print_stat(m, &q->poll_stat[2 * bucket]); seq_puts(m, "\n"); - seq_printf(m, "write (%d Bytes): ", 1 << (9+bucket)); - print_stat(m, &q->poll_stat[2*bucket+1]); + seq_printf(m, "write (%d Bytes): ", 1 << (9 + bucket)); + print_stat(m, &q->poll_stat[2 * bucket + 1]); seq_puts(m, "\n"); } return 0;