mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-mtd@lists.infradead.org,
	Boris Brezillon <boris.brezillon@free-electrons.com>,
	Brian Norris <computersforpeace@gmail.com>,
	Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>,
	David Woodhouse <dwmw2@infradead.org>,
	Marek Vasut <marek.vasut@gmail.com>,
	Richard Weinberger <richard@nod.at>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 5/5] mtd/rfd_ftl: Add some spaces for better code readability
Date: Sat, 6 Jan 2018 16:11:38 +0100	[thread overview]
Message-ID: <847904e4-c5a2-0716-24ae-c2ac085fe3a3@users.sourceforge.net> (raw)
In-Reply-To: <a595376a-c343-33ea-8607-370b88e19c61@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 6 Jan 2018 15:47:01 +0100

Use space characters at some source code places according to
the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/mtd/rfd_ftl.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/mtd/rfd_ftl.c b/drivers/mtd/rfd_ftl.c
index e3155ec4be64..b6cc3690b9ed 100644
--- a/drivers/mtd/rfd_ftl.c
+++ b/drivers/mtd/rfd_ftl.c
@@ -103,7 +103,7 @@ static int build_block_map(struct partition *part, int block_no)
 
 	block->state = BLOCK_OK;
 
-	for (i=0; i<part->data_sectors_per_block; i++) {
+	for (i = 0; i < part->data_sectors_per_block; i++) {
 		u16 entry;
 
 		entry = le16_to_cpu(part->header_cache[HEADER_MAP_OFFSET + i]);
@@ -193,10 +193,10 @@ static int scan_header(struct partition *part)
 	if (!part->sector_map)
 		goto free_blocks;
 
-	for (i=0; i<part->sector_count; i++)
+	for (i = 0; i < part->sector_count; i++)
 		part->sector_map[i] = -1;
 
-	for (i=0, blocks_found=0; i<part->total_blocks; i++) {
+	for (i = 0, blocks_found = 0; i < part->total_blocks; i++) {
 		rc = mtd_read(part->mbd.mtd, i * part->block_size,
 			      part->header_size, &retlen,
 			      (u_char *)part->header_cache);
@@ -380,7 +380,7 @@ static int move_block_contents(struct partition *part, int block_no, u_long *old
 		goto err;
 	}
 
-	for (i=0; i<part->data_sectors_per_block; i++) {
+	for (i = 0; i < part->data_sectors_per_block; i++) {
 		u16 entry = le16_to_cpu(map[HEADER_MAP_OFFSET + i]);
 		u_long addr;
 
@@ -452,7 +452,7 @@ static int reclaim_block(struct partition *part, u_long *old_sector)
 	else
 		old_sector_block = -1;
 
-	for (block=0; block<part->total_blocks; block++) {
+	for (block = 0; block < part->total_blocks; block++) {
 		int this_score;
 
 		if (block == part->reserved_block)
@@ -625,8 +625,7 @@ static int find_free_sector(const struct partition *part, const struct block *bl
 
 		if (++i == part->data_sectors_per_block)
 			i = 0;
-	}
-	while(i != stop);
+	} while (i != stop);
 
 	return -1;
 }
@@ -718,7 +717,7 @@ static int rfd_ftl_writesect(struct mtd_blktrans_dev *dev, u_long sector, char *
 
 	old_addr = part->sector_map[sector];
 
-	for (i=0; i<SECTOR_SIZE; i++) {
+	for (i = 0; i < SECTOR_SIZE; i++) {
 		if (!buf[i])
 			continue;
 
@@ -799,10 +798,9 @@ static void rfd_ftl_remove_dev(struct mtd_blktrans_dev *dev)
 	struct partition *part = (struct partition*)dev;
 	int i;
 
-	for (i=0; i<part->total_blocks; i++) {
+	for (i = 0; i < part->total_blocks; i++)
 		pr_debug("rfd_ftl_remove_dev:'%s': erase unit #%02d: %d erases\n",
 			part->mbd.mtd->name, i, part->blocks[i].erases);
-	}
 
 	del_mtd_blktrans_dev(dev);
 	vfree(part->sector_map);
-- 
2.15.1

      parent reply	other threads:[~2018-01-06 15:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-06 15:06 [PATCH 0/5] mtd/rfd_ftl: Adjustments for some function implementations SF Markus Elfring
2018-01-06 15:07 ` [PATCH 1/5] mtd/rfd_ftl: Delete an error message for a failed memory allocation in scan_header() SF Markus Elfring
2018-01-06 15:08 ` [PATCH 2/5] mtd/rfd_ftl: Less function calls in scan_header() after error detection SF Markus Elfring
2018-01-06 15:09 ` [PATCH 3/5] mtd/rfd_ftl: Improve a size determination in two functions SF Markus Elfring
2018-01-06 15:10 ` [PATCH 4/5] mtd/rfd_ftl: Return directly after a failed kmalloc() in erase_block() SF Markus Elfring
2018-01-06 15:11 ` SF Markus Elfring [this message]

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=847904e4-c5a2-0716-24ae-c2ac085fe3a3@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@wedev4u.fr \
    --cc=dwmw2@infradead.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=richard@nod.at \
    /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

Powered by JetHome