Linux block layer
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: linux-block@vger.kernel.org, linux-efi@vger.kernel.org,
	linux-ntfs-dev@lists.sourceforge.net, linux-s390@vger.kernel.org,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Christophe Jaillet" <christophe.jaillet@wanadoo.fr>,
	"Davidlohr Bueso" <dave@stgolabs.net>,
	"Jan Höppner" <hoeppner@linux.ibm.com>,
	"Jens Axboe" <axboe@kernel.dk>,
	"Josh Law" <objecting@objecting.org>,
	"Kees Cook" <kees@kernel.org>,
	"Md Haris Iqbal" <haris.iqbal@linux.dev>,
	"Richard Russon" <ldm@flatcap.org>,
	"Stefan Haberland" <sth@linux.ibm.com>,
	"Thorsten Blum" <thorsten.blum@linux.dev>,
	vulab@iscas.ac.cn
Cc: LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>,
	Woradorn Laodhanadhaworn <woradorn.laon@gmail.com>
Subject: [PATCH v2] block: partitions: Use seq_buf_putc() at 24 places
Date: Mon, 29 Jun 2026 09:16:09 +0200	[thread overview]
Message-ID: <7360cab3-7a2f-4903-85f1-0f03387b0d88@web.de> (raw)
In-Reply-To: <aj061omzs5WN5ar6@ashevche-desk.local>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 29 Jun 2026 08:10:24 +0200

Single line breaks should occasionally be put into a sequence buffer.
Thus use the seq_buf_putc() function in these implementations.

The source code was transformed by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---

v2:
* Andy Shevchenko requested to preserve two blank lines.

* The source code transformation was extended to all affected places
  for this software area.


 block/partitions/acorn.c   |  8 ++++----
 block/partitions/amiga.c   |  2 +-
 block/partitions/atari.c   |  2 +-
 block/partitions/cmdline.c |  2 +-
 block/partitions/efi.c     |  2 +-
 block/partitions/ibm.c     | 10 +++++-----
 block/partitions/karma.c   |  2 +-
 block/partitions/ldm.c     |  2 +-
 block/partitions/mac.c     |  2 +-
 block/partitions/msdos.c   |  4 ++--
 block/partitions/of.c      |  2 +-
 block/partitions/osf.c     |  2 +-
 block/partitions/sgi.c     |  2 +-
 block/partitions/sun.c     |  2 +-
 block/partitions/sysv68.c  |  2 +-
 block/partitions/ultrix.c  |  2 +-
 16 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/block/partitions/acorn.c b/block/partitions/acorn.c
index 067d6a27a3bd..c48250517448 100644
--- a/block/partitions/acorn.c
+++ b/block/partitions/acorn.c
@@ -290,7 +290,7 @@ int adfspart_check_ADFS(struct parsed_partitions *state)
 			break;
 		}
 	}
-	seq_buf_puts(&state->pp_buf, "\n");
+	seq_buf_putc(&state->pp_buf, '\n');
 	return 1;
 }
 #endif
@@ -397,7 +397,7 @@ int adfspart_check_ICS(struct parsed_partitions *state)
 	}
 
 	put_dev_sector(sect);
-	seq_buf_puts(&state->pp_buf, "\n");
+	seq_buf_putc(&state->pp_buf, '\n');
 	return 1;
 }
 #endif
@@ -468,7 +468,7 @@ int adfspart_check_POWERTEC(struct parsed_partitions *state)
 	}
 
 	put_dev_sector(sect);
-	seq_buf_puts(&state->pp_buf, "\n");
+	seq_buf_putc(&state->pp_buf, '\n');
 	return 1;
 }
 #endif
@@ -539,7 +539,7 @@ int adfspart_check_EESOX(struct parsed_partitions *state)
 
 		size = get_capacity(state->disk);
 		put_partition(state, slot++, start, size - start);
-		seq_buf_puts(&state->pp_buf, "\n");
+		seq_buf_putc(&state->pp_buf, '\n');
 	}
 
 	return i ? 1 : 0;
diff --git a/block/partitions/amiga.c b/block/partitions/amiga.c
index 8325046a14eb..a272f64450ec 100644
--- a/block/partitions/amiga.c
+++ b/block/partitions/amiga.c
@@ -194,7 +194,7 @@ int amiga_partition(struct parsed_partitions *state)
 		}
 		res = 1;
 	}
-	seq_buf_puts(&state->pp_buf, "\n");
+	seq_buf_putc(&state->pp_buf, '\n');
 
 rdb_done:
 	return res;
diff --git a/block/partitions/atari.c b/block/partitions/atari.c
index 2438d1448f38..58863c1a2723 100644
--- a/block/partitions/atari.c
+++ b/block/partitions/atari.c
@@ -150,7 +150,7 @@ int atari_partition(struct parsed_partitions *state)
 #endif
 	put_dev_sector(sect);
 
-	seq_buf_puts(&state->pp_buf, "\n");
+	seq_buf_putc(&state->pp_buf, '\n');
 
 	return 1;
 }
diff --git a/block/partitions/cmdline.c b/block/partitions/cmdline.c
index 4fd52ed154b4..50075eccaade 100644
--- a/block/partitions/cmdline.c
+++ b/block/partitions/cmdline.c
@@ -377,7 +377,7 @@ int cmdline_partition(struct parsed_partitions *state)
 	cmdline_parts_set(parts, disk_size, state);
 	cmdline_parts_verifier(1, state);
 
-	seq_buf_puts(&state->pp_buf, "\n");
+	seq_buf_putc(&state->pp_buf, '\n');
 
 	return 1;
 }
diff --git a/block/partitions/efi.c b/block/partitions/efi.c
index 9865d59093fa..650b91efc832 100644
--- a/block/partitions/efi.c
+++ b/block/partitions/efi.c
@@ -751,6 +751,6 @@ int efi_partition(struct parsed_partitions *state)
 	}
 	kfree(ptes);
 	kfree(gpt);
-	seq_buf_puts(&state->pp_buf, "\n");
+	seq_buf_putc(&state->pp_buf, '\n');
 	return 1;
 }
diff --git a/block/partitions/ibm.c b/block/partitions/ibm.c
index 54047e722a9d..a57de3b192fc 100644
--- a/block/partitions/ibm.c
+++ b/block/partitions/ibm.c
@@ -217,7 +217,7 @@ static int find_vol1_partitions(struct parsed_partitions *state,
 		blk++;
 		data = read_part_sector(state, blk * secperblk, &sect);
 	}
-	seq_buf_puts(&state->pp_buf, "\n");
+	seq_buf_putc(&state->pp_buf, '\n');
 
 	if (!data)
 		return -1;
@@ -254,7 +254,7 @@ static int find_lnx1_partitions(struct parsed_partitions *state,
 		size = nr_sectors;
 		if (size != geo_size) {
 			if (!info) {
-				seq_buf_puts(&state->pp_buf, "\n");
+				seq_buf_putc(&state->pp_buf, '\n');
 				return 1;
 			}
 			if (!strcmp(info->type, "ECKD"))
@@ -266,7 +266,7 @@ static int find_lnx1_partitions(struct parsed_partitions *state,
 	/* first and only partition starts in the first block after the label */
 	offset = labelsect + secperblk;
 	put_partition(state, 1, offset, size - offset);
-	seq_buf_puts(&state->pp_buf, "\n");
+	seq_buf_putc(&state->pp_buf, '\n');
 	return 1;
 }
 
@@ -307,7 +307,7 @@ static int find_cms1_partitions(struct parsed_partitions *state,
 	}
 
 	put_partition(state, 1, offset, size-offset);
-	seq_buf_puts(&state->pp_buf, "\n");
+	seq_buf_putc(&state->pp_buf, '\n');
 	return 1;
 }
 
@@ -388,7 +388,7 @@ int ibm_partition(struct parsed_partitions *state)
 			size = nr_sectors;
 			offset = (info->label_block + 1) * (blocksize >> 9);
 			put_partition(state, 1, offset, size-offset);
-			seq_buf_puts(&state->pp_buf, "\n");
+			seq_buf_putc(&state->pp_buf, '\n');
 		}
 	} else
 		res = 0;
diff --git a/block/partitions/karma.c b/block/partitions/karma.c
index a4e3c5050177..b0ab84169538 100644
--- a/block/partitions/karma.c
+++ b/block/partitions/karma.c
@@ -53,7 +53,7 @@ int karma_partition(struct parsed_partitions *state)
 		}
 		slot++;
 	}
-	seq_buf_puts(&state->pp_buf, "\n");
+	seq_buf_putc(&state->pp_buf, '\n');
 	put_dev_sector(sect);
 	return 1;
 }
diff --git a/block/partitions/ldm.c b/block/partitions/ldm.c
index c0bdcae58a3e..d1bbc9fb09f9 100644
--- a/block/partitions/ldm.c
+++ b/block/partitions/ldm.c
@@ -597,7 +597,7 @@ static bool ldm_create_data_partitions (struct parsed_partitions *pp,
 		part_num++;
 	}
 
-	seq_buf_puts(&pp->pp_buf, "\n");
+	seq_buf_putc(&pp->pp_buf, '\n');
 	return true;
 }
 
diff --git a/block/partitions/mac.c b/block/partitions/mac.c
index df03ca428e15..bb570b5a6eaa 100644
--- a/block/partitions/mac.c
+++ b/block/partitions/mac.c
@@ -152,6 +152,6 @@ int mac_partition(struct parsed_partitions *state)
 #endif
 
 	put_dev_sector(sect);
-	seq_buf_puts(&state->pp_buf, "\n");
+	seq_buf_putc(&state->pp_buf, '\n');
 	return 1;
 }
diff --git a/block/partitions/msdos.c b/block/partitions/msdos.c
index 200ea53ea6a2..4a96541f5351 100644
--- a/block/partitions/msdos.c
+++ b/block/partitions/msdos.c
@@ -608,7 +608,7 @@ int msdos_partition(struct parsed_partitions *state)
 			fb = (struct fat_boot_sector *) data;
 			if (slot == 1 && fb->reserved && fb->fats
 				&& fat_valid_media(fb->media)) {
-				seq_buf_puts(&state->pp_buf, "\n");
+				seq_buf_putc(&state->pp_buf, '\n');
 				put_dev_sector(sect);
 				return 1;
 			} else {
@@ -672,7 +672,7 @@ int msdos_partition(struct parsed_partitions *state)
 			seq_buf_puts(&state->pp_buf, "[EZD]");
 	}
 
-	seq_buf_puts(&state->pp_buf, "\n");
+	seq_buf_putc(&state->pp_buf, '\n');
 
 	/* second pass - output for each on a separate line */
 	p = (struct msdos_partition *) (0x1be + data);
diff --git a/block/partitions/of.c b/block/partitions/of.c
index 53664ea06b65..7803e6f4ecdd 100644
--- a/block/partitions/of.c
+++ b/block/partitions/of.c
@@ -104,7 +104,7 @@ int of_partition(struct parsed_partitions *state)
 		slot++;
 	}
 
-	seq_buf_puts(&state->pp_buf, "\n");
+	seq_buf_putc(&state->pp_buf, '\n');
 
 	of_node_put(partitions_np);
 	return 1;
diff --git a/block/partitions/osf.c b/block/partitions/osf.c
index 2a692584dba9..6f83d4759a5d 100644
--- a/block/partitions/osf.c
+++ b/block/partitions/osf.c
@@ -81,7 +81,7 @@ int osf_partition(struct parsed_partitions *state)
 				le32_to_cpu(partition->p_size));
 		slot++;
 	}
-	seq_buf_puts(&state->pp_buf, "\n");
+	seq_buf_putc(&state->pp_buf, '\n');
 	put_dev_sector(sect);
 	return 1;
 }
diff --git a/block/partitions/sgi.c b/block/partitions/sgi.c
index 2383ca63cd66..f743e3583417 100644
--- a/block/partitions/sgi.c
+++ b/block/partitions/sgi.c
@@ -79,7 +79,7 @@ int sgi_partition(struct parsed_partitions *state)
 		}
 		slot++;
 	}
-	seq_buf_puts(&state->pp_buf, "\n");
+	seq_buf_putc(&state->pp_buf, '\n');
 	put_dev_sector(sect);
 	return 1;
 }
diff --git a/block/partitions/sun.c b/block/partitions/sun.c
index 92c645fcd2e0..c71bad78f34a 100644
--- a/block/partitions/sun.c
+++ b/block/partitions/sun.c
@@ -121,7 +121,7 @@ int sun_partition(struct parsed_partitions *state)
 		}
 		slot++;
 	}
-	seq_buf_puts(&state->pp_buf, "\n");
+	seq_buf_putc(&state->pp_buf, '\n');
 	put_dev_sector(sect);
 	return 1;
 }
diff --git a/block/partitions/sysv68.c b/block/partitions/sysv68.c
index 470e0f9de7be..31d348ac2dfb 100644
--- a/block/partitions/sysv68.c
+++ b/block/partitions/sysv68.c
@@ -86,7 +86,7 @@ int sysv68_partition(struct parsed_partitions *state)
 		}
 		slot++;
 	}
-	seq_buf_puts(&state->pp_buf, "\n");
+	seq_buf_putc(&state->pp_buf, '\n');
 	put_dev_sector(sect);
 	return 1;
 }
diff --git a/block/partitions/ultrix.c b/block/partitions/ultrix.c
index b4b9ddc57a5d..8ac42fda25d1 100644
--- a/block/partitions/ultrix.c
+++ b/block/partitions/ultrix.c
@@ -39,7 +39,7 @@ int ultrix_partition(struct parsed_partitions *state)
 					      label->pt_part[i].pi_blkoff,
 					      label->pt_part[i].pi_nblocks);
 		put_dev_sector(sect);
-		seq_buf_puts(&state->pp_buf, "\n");
+		seq_buf_putc(&state->pp_buf, '\n');
 		return 1;
 	} else {
 		put_dev_sector(sect);
-- 
2.54.0


  reply	other threads:[~2026-06-29  7:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-25  8:08 [PATCH] block: partitions: Use seq_buf_putc() in cmdline_partition() Markus Elfring
2026-06-25  8:18 ` Andy Shevchenko
2026-06-25 12:18   ` Markus Elfring
2026-06-25 14:27     ` Andy Shevchenko
2026-06-29  7:16       ` Markus Elfring [this message]
2026-06-29  7:35         ` [PATCH v2] block: partitions: Use seq_buf_putc() at 24 places Andy Shevchenko
2026-06-26 16:48 ` block: partitions: Use seq_buf_putc() in cmdline_partition() Markus Elfring
2026-06-27  5:30   ` Christophe JAILLET
2026-06-27  7:28     ` 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=7360cab3-7a2f-4903-85f1-0f03387b0d88@web.de \
    --to=markus.elfring@web.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=axboe@kernel.dk \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dave@stgolabs.net \
    --cc=haris.iqbal@linux.dev \
    --cc=hoeppner@linux.ibm.com \
    --cc=kees@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=ldm@flatcap.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-ntfs-dev@lists.sourceforge.net \
    --cc=linux-s390@vger.kernel.org \
    --cc=objecting@objecting.org \
    --cc=rostedt@goodmis.org \
    --cc=sth@linux.ibm.com \
    --cc=thorsten.blum@linux.dev \
    --cc=vulab@iscas.ac.cn \
    --cc=woradorn.laon@gmail.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