From patchwork Sat Jan 6 15:11:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 856388 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MPpYZFAz"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zDQ4J0zzlz9s7G for ; Sun, 7 Jan 2018 02:12:00 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eMZyarTNECcCOwAooHVB9acAR+8Uwxd1nQ1r07+ubso=; b=MPpYZFAzLSkrDG TpsfYvsX+c5aAKkbaSIBOJksGnPcEeAaP205bxBweWJP+dR0MXvWn8opPyP9KXF8Eyj+umnnutQgH 2U7L1PmTJ4Y7CSCJ823sC2NTNp3kl/tDh0QhH88cb83TFgniwLVqHhczwMwSAeqOTGbZ6pKAw4Vps czS/d2Qp+RHWPj4XX5I4R/Tz4WK7+S/dy4TaJ7fqTIg3v3vJby0laTSBvfABlIkWw0c31HpfoCrt6 /ALJWD0+erfwHXv1mnPYf2ofAriFJumQmimwYLNu+hYNxTgi2K3cvLEGbGRDAdq4XdWtMYJfoLJ2c 9tpSN8a164NzKyTBH8+Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eXq8Z-00027i-Ki; Sat, 06 Jan 2018 15:11:55 +0000 Received: from mout.web.de ([212.227.15.3]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eXq8W-00026D-Hg for linux-mtd@lists.infradead.org; Sat, 06 Jan 2018 15:11:54 +0000 Received: from [192.168.1.3] ([85.182.74.56]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MAjet-1ejdQW2GKZ-00BwTe; Sat, 06 Jan 2018 16:11:39 +0100 Subject: [PATCH 5/5] mtd/rfd_ftl: Add some spaces for better code readability From: SF Markus Elfring To: linux-mtd@lists.infradead.org, Boris Brezillon , Brian Norris , Cyrille Pitchen , David Woodhouse , Marek Vasut , Richard Weinberger References: Message-ID: <847904e4-c5a2-0716-24ae-c2ac085fe3a3@users.sourceforge.net> Date: Sat, 6 Jan 2018 16:11:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:yZqjO2/lkIkFvLzLKA0u/LnLq7d9Ndgklf99Do32ml89mwHA4Ai tGWUH3URrGE46FyPHlh8J16a16QcnJcGSf5VsAYQwJxTe96oEG/Q263X7vDu6/QhczAGs3x 2N2kW/HuhIpeGbx0WyPHYqdFlCn0v+gY5OQMTxpxfi27UIuvg/kEv/6gSUIvTNHQESD9ebC 85BebE9hq55sCBdPocl9Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:oWrvHMrzKPY=:1DaQIvGPkpvJOKmeAyYMBY 6MRuatWicLdAHkzi7l90O+XadIHsQSFPhTRoSltbru24h6DHKXpOewVT8hO61AKWzxHJ/447x X632HIfc3Rvr6j7mXJR9SMa5OW5NPfH+SQ1sP9XFR1kFhmx7Baw7Ig9nLrLdvyZPXq1aKj39h aezZaqVXcp13StiVVLukVCZwN/UMxf+hfyNJ38JG2U2HGGXShL+zLKK1SuT3i+3CZ4YgPm8u6 d/F73DjNp3UvnD2Kwn4zxXb+Wjv4sIiQ3spJrF/S7Ih8g2rT4SAHJ28e3M7TGQGkwet8fDT27 Z+0x1YmISJZQ/kUJNC9I30dPnHT0xbTgOkjdGm6XTypTTVx6gtc6tVjX/ciZ/srq2alHTP1BR 72ARaam+Z7lizdAOQo0VQPxr0RVrd0KMl9txe+bFEzeW5YomiMecOrhv23Jjj4B2ixnA4kxN+ fLc01yPvTwSMZOEATDZPJ+pT0lT5sRU608DSpqi728VKGlMhtUlPN2WfcfpRMpG07NXSmldxt aL43sH04Upo+3p+UUPw4RIaEFLOoGYFyRpILErcrUsfrv+p9YyMQOXKqxLP9/FdngG1n/uUvH U4DGvh+WApTBZQWnmtmaiI+za9cE0se7IZhIh8d3hgzrZ6nqpjDsvx04kbOsnY6rNv/rjaRwO Ze5iOCHk/arX5JJ9pidUdx4CPowYR3p0LC6SnsoNHjCLLx/BUHgN/p7gXGedaY5TjuZp4b4Ho 3ISTjGB3Euq3kEG9DiKiZxmznDYVOsEeItODDoSZQ2hotL5Qaus4i8MKOXzg4efljZ12nTyaY kwmvFXQ+tOnFovBgwdZdN4DzhEQOPswIztE3sw8BQBYi8udqnM= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180106_071152_927345_D67DB472 X-CRM114-Status: GOOD ( 10.83 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [212.227.15.3 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [212.227.15.3 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, LKML Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Markus Elfring 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 --- 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; idata_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; isector_count; i++) + for (i = 0; i < part->sector_count; i++) part->sector_map[i] = -1; - for (i=0, blocks_found=0; itotal_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; idata_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; blocktotal_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; itotal_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);