mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: dm-devel@redhat.com, linux-raid@vger.kernel.org,
	Alasdair Kergon <agk@redhat.com>,
	Mike Snitzer <snitzer@redhat.com>, Shaohua Li <shli@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org,
	Julia Lawall <julia.lawall@lip6.fr>
Subject: [PATCH 2/9] md/dm-table: Reduce the scope for a variable in dm_table_verify_integrity()
Date: Sat, 1 Oct 2016 09:44:40 +0200	[thread overview]
Message-ID: <18a48c67-962d-2e61-7d24-dc145ec90935@users.sourceforge.net> (raw)
In-Reply-To: <45984567-4421-5f8d-ddf3-eb2a769a1860@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 1 Oct 2016 07:10:43 +0200

Move the definition for the variable "template_disk" into an if branch
so that an extra initialisation can be avoided at the beginning
by this refactoring.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/md/dm-table.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index f6b817c..73d38d0 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1391,14 +1391,13 @@ int dm_calculate_queue_limits(struct dm_table *table,
  */
 static void dm_table_verify_integrity(struct dm_table *t)
 {
-	struct gendisk *template_disk = NULL;
-
 	if (t->integrity_supported) {
 		/*
 		 * Verify that the original integrity profile
 		 * matches all the devices in this table.
 		 */
-		template_disk = dm_table_get_integrity_disk(t);
+		struct gendisk *template_disk = dm_table_get_integrity_disk(t);
+
 		if (template_disk &&
 		    blk_integrity_compare(dm_disk(t->md), template_disk) >= 0)
 			return;
-- 
2.10.0

  parent reply	other threads:[~2016-10-01  7:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-01  7:41 [PATCH 0/9] md/dm-table: Fine-tuning for several function implementations SF Markus Elfring
2016-10-01  7:43 ` [PATCH 1/9] md/dm-table: Use kmalloc_array() in realloc_argv() SF Markus Elfring
2016-10-01  7:44 ` SF Markus Elfring [this message]
2016-10-01  7:45 ` [PATCH 3/9] md/dm-table: Delete an unnecessary variable initialisation in dm_table_register_integrity() SF Markus Elfring
2016-10-01  7:46 ` [PATCH 4/9] md/dm-table: Delete an unnecessary variable initialisation in dm_split_args() SF Markus Elfring
2016-10-01  7:47 ` [PATCH 5/9] md/dm-table: Move an assignment for the variable "end" " SF Markus Elfring
2016-10-01  7:48 ` [PATCH 6/9] md/dm-table: Combine substrings for ten messages SF Markus Elfring
2016-10-01  7:50 ` [PATCH 7/9] md/dm-table: Adjust one function call together with a variable assignment SF Markus Elfring
2016-10-01  7:52 ` [PATCH 8/9] md/dm-table: Delete an unwanted space in high() SF Markus Elfring
2016-10-01  7:53 ` [PATCH 9/9] md/dm-table: Delete an unwanted space in dm_table_get_integrity_disk() SF Markus Elfring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18a48c67-962d-2e61-7d24-dc145ec90935@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=julia.lawall@lip6.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=shli@kernel.org \
    --cc=snitzer@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®