All of lore.kernel.org
 help / color / mirror / Atom feed
From: mwilck@suse.com
To: Christophe Varoqui <christophe.varoqui@opensvc.com>,
	Benjamin Marzinski <bmarzins@redhat.com>
Cc: dm-devel@redhat.com, Martin Wilck <mwilck@suse.com>
Subject: [dm-devel] [PATCH 05/11] libmultipath: drop padding code in _snprint_pathgroup()
Date: Sat, 27 Nov 2021 16:20:00 +0100	[thread overview]
Message-ID: <20211127152006.8035-6-mwilck@suse.com> (raw)
In-Reply-To: <20211127152006.8035-1-mwilck@suse.com>

From: Martin Wilck <mwilck@suse.com>

We don't use padding for pathgroup fields, field width is always 0.
Remove this dead code.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 libmultipath/print.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/libmultipath/print.c b/libmultipath/print.c
index fcbaa5a..924bca3 100644
--- a/libmultipath/print.c
+++ b/libmultipath/print.c
@@ -1167,25 +1167,16 @@ int _snprint_pathgroup(const struct gen_pathgroup *ggp, struct strbuf *line,
 {
 	int initial_len = get_strbuf_len(line);
 	const char *f;
-	struct pathgroup_data *data;
 	int rc;
 
 	for (f = strchr(format, '%'); f; f = strchr(++format, '%')) {
-		int iwc;
-
 		if ((rc = __append_strbuf_str(line, format, f - format)) < 0)
 			return rc;
 
 		format = f + 1;
-		if ((iwc = pgd_lookup(*format)) == -1)
-			continue; /* unknown wildcard */
-		data = &pgd[iwc];
 
 		if ((rc = ggp->ops->snprint(ggp, line, *format)) < 0)
 			return rc;
-		else if ((unsigned int)rc < data->width)
-			if ((rc = fill_strbuf(line, ' ', data->width - rc)) < 0)
-				return rc;
 	}
 
 	if ((rc = print_strbuf(line, "%s\n", format)) < 0)
-- 
2.33.1


--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


  parent reply	other threads:[~2021-11-27 15:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-27 15:19 [dm-devel] [PATCH 00/11] multipath-tools: improvements for pretty-printing code mwilck
2021-11-27 15:19 ` [dm-devel] [PATCH 01/11] libmultipath: make multipath_data etc. static mwilck
2021-11-27 15:19 ` [dm-devel] [PATCH 02/11] libmultipath: move path_data etc. to print.c mwilck
2021-11-27 15:19 ` [dm-devel] [PATCH 03/11] libmultipath: make pd_lookup() etc. return an index mwilck
2021-11-27 15:19 ` [dm-devel] [PATCH 04/11] libmultipath: use ARRAY_SIZE for iterating over wildcard arrays mwilck
2021-11-27 15:20 ` mwilck [this message]
2021-11-27 15:20 ` [dm-devel] [PATCH 06/11] libmultipath: snprint_foreign_topology(): split out lockless variant mwilck
2021-11-27 15:20 ` [dm-devel] [PATCH 07/11] multipathd: drop unnecessary path layout calls mwilck
2021-11-27 15:20 ` [dm-devel] [PATCH 08/11] libmultipath: add a cleanup function for unsigned char * mwilck
2021-11-27 15:20 ` [dm-devel] [PATCH 09/11] libmultipath: make sprint_path_marginal() static mwilck
2021-11-27 15:20 ` [dm-devel] [PATCH 10/11] libmultipath: introduce width argument for pretty-printing functions mwilck
2021-11-27 15:20 ` [dm-devel] [PATCH 11/11] libmultipath: change wildcard handler tables to static const mwilck

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=20211127152006.8035-6-mwilck@suse.com \
    --to=mwilck@suse.com \
    --cc=bmarzins@redhat.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@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 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.