All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Abd-Alrhman Masalkhi <abd.masalkhi@gmail.com>,
	linux-block@vger.kernel.org
Subject: [PATCH 5/6] block: simplify disk name formatting in check_partition
Date: Tue, 27 Jul 2021 08:25:17 +0200	[thread overview]
Message-ID: <20210727062518.122108-6-hch@lst.de> (raw)
In-Reply-To: <20210727062518.122108-1-hch@lst.de>

disk_name for partition 0 just copies out the disk_name field.  Replace
the call to disk_name with a %s format specifier.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/partitions/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/partitions/core.c b/block/partitions/core.c
index 4230d4f71879..48e001aa1930 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -136,7 +136,7 @@ static struct parsed_partitions *check_partition(struct gendisk *hd)
 	state->pp_buf[0] = '\0';
 
 	state->bdev = hd->part0;
-	disk_name(hd, 0, state->name);
+	snprintf(state->name, BDEVNAME_SIZE, "%s", hd->disk_name);
 	snprintf(state->pp_buf, PAGE_SIZE, " %s:", state->name);
 	if (isdigit(state->name[strlen(state->name)-1]))
 		sprintf(state->name, "p");
-- 
2.30.2


  parent reply	other threads:[~2021-07-27  6:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27  6:25 remove disk_name() Christoph Hellwig
2021-07-27  6:25 ` [PATCH 1/6] block: reduce stack usage in diskstats_show Christoph Hellwig
2021-07-27  8:32   ` Hannes Reinecke
2021-07-27  6:25 ` [PATCH 2/6] block: use the %pg format specifier in printk_all_partitions Christoph Hellwig
2021-07-27  6:25 ` [PATCH 3/6] block: use the %pg format specifier in show_partition Christoph Hellwig
2021-07-27  6:25 ` [PATCH 4/6] block: simplify printing the device names disk_stack_limits Christoph Hellwig
2021-07-27  6:25 ` Christoph Hellwig [this message]
2021-07-27  6:25 ` [PATCH 6/6] block: remove disk_name() Christoph Hellwig
2021-07-27 17:36 ` Martin K. Petersen
2021-07-28  1:41 ` Jens Axboe

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=20210727062518.122108-6-hch@lst.de \
    --to=hch@lst.de \
    --cc=abd.masalkhi@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.