aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/cmdlinepart.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2005-11-07 06:15:26 -0500
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-11-07 07:37:38 -0500
commit97894cda5773e59bd13e87b72077751099419a9f (patch)
tree9a039ab8c122ae9a4f64d285e2da0efd1356789e /drivers/mtd/cmdlinepart.c
parentb95f9609c761a14d1e7be1a89f2a66399b5ae343 (diff)
[MTD] core: Clean up trailing white spaces
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/mtd/cmdlinepart.c')
-rw-r--r--drivers/mtd/cmdlinepart.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c
index ef24837019d3..6b8bb2e4dcfd 100644
--- a/drivers/mtd/cmdlinepart.c
+++ b/drivers/mtd/cmdlinepart.c
@@ -1,24 +1,24 @@
1/* 1/*
2 * $Id: cmdlinepart.c,v 1.18 2005/06/07 15:04:26 joern Exp $ 2 * $Id: cmdlinepart.c,v 1.19 2005/11/07 11:14:19 gleixner Exp $
3 * 3 *
4 * Read flash partition table from command line 4 * Read flash partition table from command line
5 * 5 *
6 * Copyright 2002 SYSGO Real-Time Solutions GmbH 6 * Copyright 2002 SYSGO Real-Time Solutions GmbH
7 * 7 *
8 * The format for the command line is as follows: 8 * The format for the command line is as follows:
9 * 9 *
10 * mtdparts=<mtddef>[;<mtddef] 10 * mtdparts=<mtddef>[;<mtddef]
11 * <mtddef> := <mtd-id>:<partdef>[,<partdef>] 11 * <mtddef> := <mtd-id>:<partdef>[,<partdef>]
12 * <partdef> := <size>[@offset][<name>][ro] 12 * <partdef> := <size>[@offset][<name>][ro]
13 * <mtd-id> := unique name used in mapping driver/device (mtd->name) 13 * <mtd-id> := unique name used in mapping driver/device (mtd->name)
14 * <size> := standard linux memsize OR "-" to denote all remaining space 14 * <size> := standard linux memsize OR "-" to denote all remaining space
15 * <name> := '(' NAME ')' 15 * <name> := '(' NAME ')'
16 * 16 *
17 * Examples: 17 * Examples:
18 * 18 *
19 * 1 NOR Flash, with 1 single writable partition: 19 * 1 NOR Flash, with 1 single writable partition:
20 * edb7312-nor:- 20 * edb7312-nor:-
21 * 21 *
22 * 1 NOR Flash with 2 partitions, 1 NAND with one 22 * 1 NOR Flash with 2 partitions, 1 NAND with one
23 * edb7312-nor:256k(ARMboot)ro,-(root);edb7312-nand:-(home) 23 * edb7312-nor:256k(ARMboot)ro,-(root);edb7312-nand:-(home)
24 */ 24 */
@@ -60,17 +60,17 @@ static int cmdline_parsed = 0;
60 60
61/* 61/*
62 * Parse one partition definition for an MTD. Since there can be many 62 * Parse one partition definition for an MTD. Since there can be many
63 * comma separated partition definitions, this function calls itself 63 * comma separated partition definitions, this function calls itself
64 * recursively until no more partition definitions are found. Nice side 64 * recursively until no more partition definitions are found. Nice side
65 * effect: the memory to keep the mtd_partition structs and the names 65 * effect: the memory to keep the mtd_partition structs and the names
66 * is allocated upon the last definition being found. At that point the 66 * is allocated upon the last definition being found. At that point the
67 * syntax has been verified ok. 67 * syntax has been verified ok.
68 */ 68 */
69static struct mtd_partition * newpart(char *s, 69static struct mtd_partition * newpart(char *s,
70 char **retptr, 70 char **retptr,
71 int *num_parts, 71 int *num_parts,
72 int this_part, 72 int this_part,
73 unsigned char **extra_mem_ptr, 73 unsigned char **extra_mem_ptr,
74 int extra_mem_size) 74 int extra_mem_size)
75{ 75{
76 struct mtd_partition *parts; 76 struct mtd_partition *parts;
@@ -102,7 +102,7 @@ static struct mtd_partition * newpart(char *s,
102 mask_flags = 0; /* this is going to be a regular partition */ 102 mask_flags = 0; /* this is going to be a regular partition */
103 delim = 0; 103 delim = 0;
104 /* check for offset */ 104 /* check for offset */
105 if (*s == '@') 105 if (*s == '@')
106 { 106 {
107 s++; 107 s++;
108 offset = memparse(s, &s); 108 offset = memparse(s, &s);
@@ -112,7 +112,7 @@ static struct mtd_partition * newpart(char *s,
112 { 112 {
113 delim = ')'; 113 delim = ')';
114 } 114 }
115 115
116 if (delim) 116 if (delim)
117 { 117 {
118 char *p; 118 char *p;
@@ -131,12 +131,12 @@ static struct mtd_partition * newpart(char *s,
131 name = NULL; 131 name = NULL;
132 name_len = 13; /* Partition_000 */ 132 name_len = 13; /* Partition_000 */
133 } 133 }
134 134
135 /* record name length for memory allocation later */ 135 /* record name length for memory allocation later */
136 extra_mem_size += name_len + 1; 136 extra_mem_size += name_len + 1;
137 137
138 /* test for options */ 138 /* test for options */
139 if (strncmp(s, "ro", 2) == 0) 139 if (strncmp(s, "ro", 2) == 0)
140 { 140 {
141 mask_flags |= MTD_WRITEABLE; 141 mask_flags |= MTD_WRITEABLE;
142 s += 2; 142 s += 2;
@@ -151,7 +151,7 @@ static struct mtd_partition * newpart(char *s,
151 return NULL; 151 return NULL;
152 } 152 }
153 /* more partitions follow, parse them */ 153 /* more partitions follow, parse them */
154 if ((parts = newpart(s + 1, &s, num_parts, 154 if ((parts = newpart(s + 1, &s, num_parts,
155 this_part + 1, &extra_mem, extra_mem_size)) == 0) 155 this_part + 1, &extra_mem, extra_mem_size)) == 0)
156 return NULL; 156 return NULL;
157 } 157 }
@@ -187,7 +187,7 @@ static struct mtd_partition * newpart(char *s,
187 extra_mem += name_len + 1; 187 extra_mem += name_len + 1;
188 188
189 dbg(("partition %d: name <%s>, offset %x, size %x, mask flags %x\n", 189 dbg(("partition %d: name <%s>, offset %x, size %x, mask flags %x\n",
190 this_part, 190 this_part,
191 parts[this_part].name, 191 parts[this_part].name,
192 parts[this_part].offset, 192 parts[this_part].offset,
193 parts[this_part].size, 193 parts[this_part].size,
@@ -204,8 +204,8 @@ static struct mtd_partition * newpart(char *s,
204 return parts; 204 return parts;
205} 205}
206 206
207/* 207/*
208 * Parse the command line. 208 * Parse the command line.
209 */ 209 */
210static int mtdpart_setup_real(char *s) 210static int mtdpart_setup_real(char *s)
211{ 211{
@@ -230,7 +230,7 @@ static int mtdpart_setup_real(char *s)
230 230
231 dbg(("parsing <%s>\n", p+1)); 231 dbg(("parsing <%s>\n", p+1));
232 232
233 /* 233 /*
234 * parse one mtd. have it reserve memory for the 234 * parse one mtd. have it reserve memory for the
235 * struct cmdline_mtd_partition and the mtd-id string. 235 * struct cmdline_mtd_partition and the mtd-id string.
236 */ 236 */
@@ -239,7 +239,7 @@ static int mtdpart_setup_real(char *s)
239 &num_parts, /* out: number of parts */ 239 &num_parts, /* out: number of parts */
240 0, /* first partition */ 240 0, /* first partition */
241 (unsigned char**)&this_mtd, /* out: extra mem */ 241 (unsigned char**)&this_mtd, /* out: extra mem */
242 mtd_id_len + 1 + sizeof(*this_mtd) + 242 mtd_id_len + 1 + sizeof(*this_mtd) +
243 sizeof(void*)-1 /*alignment*/); 243 sizeof(void*)-1 /*alignment*/);
244 if(!parts) 244 if(!parts)
245 { 245 {
@@ -254,21 +254,21 @@ static int mtdpart_setup_real(char *s)
254 } 254 }
255 255
256 /* align this_mtd */ 256 /* align this_mtd */
257 this_mtd = (struct cmdline_mtd_partition *) 257 this_mtd = (struct cmdline_mtd_partition *)
258 ALIGN((unsigned long)this_mtd, sizeof(void*)); 258 ALIGN((unsigned long)this_mtd, sizeof(void*));
259 /* enter results */ 259 /* enter results */
260 this_mtd->parts = parts; 260 this_mtd->parts = parts;
261 this_mtd->num_parts = num_parts; 261 this_mtd->num_parts = num_parts;
262 this_mtd->mtd_id = (char*)(this_mtd + 1); 262 this_mtd->mtd_id = (char*)(this_mtd + 1);
263 strlcpy(this_mtd->mtd_id, mtd_id, mtd_id_len + 1); 263 strlcpy(this_mtd->mtd_id, mtd_id, mtd_id_len + 1);
264 264
265 /* link into chain */ 265 /* link into chain */
266 this_mtd->next = partitions; 266 this_mtd->next = partitions;
267 partitions = this_mtd; 267 partitions = this_mtd;
268 268
269 dbg(("mtdid=<%s> num_parts=<%d>\n", 269 dbg(("mtdid=<%s> num_parts=<%d>\n",
270 this_mtd->mtd_id, this_mtd->num_parts)); 270 this_mtd->mtd_id, this_mtd->num_parts));
271 271
272 272
273 /* EOS - we're done */ 273 /* EOS - we're done */
274 if (*s == 0) 274 if (*s == 0)
@@ -292,7 +292,7 @@ static int mtdpart_setup_real(char *s)
292 * information. It returns partitions for the requested mtd device, or 292 * information. It returns partitions for the requested mtd device, or
293 * the first one in the chain if a NULL mtd_id is passed in. 293 * the first one in the chain if a NULL mtd_id is passed in.
294 */ 294 */
295static int parse_cmdline_partitions(struct mtd_info *master, 295static int parse_cmdline_partitions(struct mtd_info *master,
296 struct mtd_partition **pparts, 296 struct mtd_partition **pparts,
297 unsigned long origin) 297 unsigned long origin)
298{ 298{
@@ -322,7 +322,7 @@ static int parse_cmdline_partitions(struct mtd_info *master,
322 part->parts[i].size = master->size - offset; 322 part->parts[i].size = master->size - offset;
323 if (offset + part->parts[i].size > master->size) 323 if (offset + part->parts[i].size > master->size)
324 { 324 {
325 printk(KERN_WARNING ERRP 325 printk(KERN_WARNING ERRP
326 "%s: partitioning exceeds flash size, truncating\n", 326 "%s: partitioning exceeds flash size, truncating\n",
327 part->mtd_id); 327 part->mtd_id);
328 part->parts[i].size = master->size - offset; 328 part->parts[i].size = master->size - offset;
@@ -338,8 +338,8 @@ static int parse_cmdline_partitions(struct mtd_info *master,
338} 338}
339 339
340 340
341/* 341/*
342 * This is the handler for our kernel parameter, called from 342 * This is the handler for our kernel parameter, called from
343 * main.c::checksetup(). Note that we can not yet kmalloc() anything, 343 * main.c::checksetup(). Note that we can not yet kmalloc() anything,
344 * so we only save the commandline for later processing. 344 * so we only save the commandline for later processing.
345 * 345 *