* [PATCH 5/5] [MTD][MTDPART] Handle remaining checkpatch findings
@ 2008-07-18 16:01 Atsushi Nemoto
2008-07-18 16:23 ` Jörn Engel
0 siblings, 1 reply; 3+ messages in thread
From: Atsushi Nemoto @ 2008-07-18 16:01 UTC (permalink / raw)
To: dwmw2; +Cc: joern, linux-mtd, akpm
Handle wargnings about long lines and braces. Now mtdpart.c is
checkpatch-clean.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
This is a patch against mtd-2.6 tree.
drivers/mtd/mtdpart.c | 38 +++++++++++++++++++++++++-------------
1 files changed, 25 insertions(+), 13 deletions(-)
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index edb90b5..020315a 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -324,7 +324,9 @@ static struct mtd_part *add_one_partition(struct mtd_info *master,
/* allocate the partition structure */
slave = kzalloc(sizeof(*slave), GFP_KERNEL);
if (!slave) {
- printk(KERN_ERR"memory allocation error while creating partitions for \"%s\"\n",
+ printk(KERN_ERR
+ "memory allocation error while creating partitions for"
+ " \"%s\"\n",
master->name);
del_mtd_partitions(master);
return NULL;
@@ -397,7 +399,9 @@ static struct mtd_part *add_one_partition(struct mtd_info *master,
slave->offset = cur_offset;
if ((cur_offset % master->erasesize) != 0) {
/* Round up to next erasesize */
- slave->offset = ((cur_offset / master->erasesize) + 1) * master->erasesize;
+ slave->offset =
+ ((cur_offset / master->erasesize) + 1) *
+ master->erasesize;
printk(KERN_NOTICE "Moving partition %d: "
"0x%08x -> 0x%08x\n", partno,
cur_offset, slave->offset);
@@ -414,13 +418,16 @@ static struct mtd_part *add_one_partition(struct mtd_info *master,
/* let's register it anyway to preserve ordering */
slave->offset = 0;
slave->mtd.size = 0;
- printk(KERN_ERR"mtd: partition \"%s\" is out of reach -- disabled\n",
+ printk(KERN_ERR
+ "mtd: partition \"%s\" is out of reach -- disabled\n",
part->name);
goto out_register;
}
if (slave->offset + slave->mtd.size > master->size) {
slave->mtd.size = master->size - slave->offset;
- printk(KERN_WARNING"mtd: partition \"%s\" extends beyond the end of device \"%s\" -- size truncated to %#x\n",
+ printk(KERN_WARNING "mtd: partition \"%s\" "
+ "extends beyond the end of device \"%s\""
+ " -- size truncated to %#x\n",
part->name, master->name, slave->mtd.size);
}
if (master->numeraseregions > 1) {
@@ -438,9 +445,8 @@ static struct mtd_part *add_one_partition(struct mtd_info *master,
/* Pick biggest erasesize */
for (; i < max && regions[i].offset < end; i++) {
- if (slave->mtd.erasesize < regions[i].erasesize) {
+ if (slave->mtd.erasesize < regions[i].erasesize)
slave->mtd.erasesize = regions[i].erasesize;
- }
}
BUG_ON(slave->mtd.erasesize == 0);
} else {
@@ -454,13 +460,16 @@ static struct mtd_part *add_one_partition(struct mtd_info *master,
/* FIXME: Let it be writable if it is on a boundary of
* _minor_ erase size though */
slave->mtd.flags &= ~MTD_WRITEABLE;
- printk(KERN_WARNING"mtd: partition \"%s\" doesn't start on an erase block boundary -- force read-only\n",
+ printk(KERN_WARNING "mtd: partition \"%s\""
+ " doesn't start on an erase block boundary"
+ " -- force read-only\n",
part->name);
}
if ((slave->mtd.flags & MTD_WRITEABLE) &&
(slave->mtd.size % slave->mtd.erasesize)) {
slave->mtd.flags &= ~MTD_WRITEABLE;
- printk(KERN_WARNING"mtd: partition \"%s\" doesn't end on an erase block -- force read-only\n",
+ printk(KERN_WARNING "mtd: partition \"%s\""
+ " doesn't end on an erase block -- force read-only\n",
part->name);
}
@@ -504,7 +513,8 @@ int add_mtd_partitions(struct mtd_info *master,
u_int32_t cur_offset = 0;
int i;
- printk(KERN_NOTICE "Creating %d MTD partitions on \"%s\":\n", nbparts, master->name);
+ printk(KERN_NOTICE "Creating %d MTD partitions on \"%s\":\n",
+ nbparts, master->name);
for (i = 0; i < nbparts; i++) {
slave = add_one_partition(master, parts + i, i, cur_offset);
@@ -569,14 +579,16 @@ int parse_mtd_partitions(struct mtd_info *master, const char **types,
parser = get_partition_parser(*types);
#endif
if (!parser) {
- printk(KERN_NOTICE "%s partition parsing not available\n",
- *types);
+ printk(KERN_NOTICE
+ "%s partition parsing not available\n",
+ *types);
continue;
}
ret = (*parser->parse_fn)(master, pparts, origin);
if (ret > 0) {
- printk(KERN_NOTICE "%d %s partitions found on MTD device %s\n",
- ret, parser->name, master->name);
+ printk(KERN_NOTICE
+ "%d %s partitions found on MTD device %s\n",
+ ret, parser->name, master->name);
}
put_partition_parser(parser);
}
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 5/5] [MTD][MTDPART] Handle remaining checkpatch findings
2008-07-18 16:01 [PATCH 5/5] [MTD][MTDPART] Handle remaining checkpatch findings Atsushi Nemoto
@ 2008-07-18 16:23 ` Jörn Engel
2008-07-18 16:57 ` Atsushi Nemoto
0 siblings, 1 reply; 3+ messages in thread
From: Jörn Engel @ 2008-07-18 16:23 UTC (permalink / raw)
To: Atsushi Nemoto; +Cc: linux-mtd, akpm, dwmw2
On Sat, 19 July 2008 01:01:45 +0900, Atsushi Nemoto wrote:
>
> Handle wargnings about long lines and braces. Now mtdpart.c is
> checkpatch-clean.
These bits I left out because I wasn't sure whether they are actually
improvements.
Jörn
--
Admonish your friends privately, but praise them openly.
-- Publilius Syrus
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 5/5] [MTD][MTDPART] Handle remaining checkpatch findings
2008-07-18 16:23 ` Jörn Engel
@ 2008-07-18 16:57 ` Atsushi Nemoto
0 siblings, 0 replies; 3+ messages in thread
From: Atsushi Nemoto @ 2008-07-18 16:57 UTC (permalink / raw)
To: joern; +Cc: linux-mtd, akpm, dwmw2
On Fri, 18 Jul 2008 18:23:19 +0200, Jörn Engel <joern@logfs.org> wrote:
> > Handle wargnings about long lines and braces. Now mtdpart.c is
> > checkpatch-clean.
>
> These bits I left out because I wasn't sure whether they are actually
> improvements.
So I did not fold this into other patch and placed on the last.
You can simply drop it ;)
---
Atsushi Nemoto
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-07-18 16:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-18 16:01 [PATCH 5/5] [MTD][MTDPART] Handle remaining checkpatch findings Atsushi Nemoto
2008-07-18 16:23 ` Jörn Engel
2008-07-18 16:57 ` Atsushi Nemoto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox