diff options
author | Arnd Bergmann <arnd@arndb.de> | 2015-03-10 12:51:55 -0400 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2015-03-11 18:25:56 -0400 |
commit | 7234bea69de200e2060d099685c4c674b556edc0 (patch) | |
tree | cd637f970636988cd42bbc59a231336e07c89f51 /include/linux/mtd | |
parent | d09957fbb4d0b059b3176b510540df69048ad170 (diff) |
mtd: clean up whitespace in linux/mtd/map.h
As the only comments I got for the "mtd: cfi: reduce stack size"
patch were about whitespace changes, it appears necessary to fix
up the rest of the file as well, which contains the exact same
mistakes.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'include/linux/mtd')
-rw-r--r-- | include/linux/mtd/map.h | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index a872157a0700..29975c73a953 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h | |||
@@ -77,7 +77,7 @@ | |||
77 | /* ensure we never evaluate anything shorted than an unsigned long | 77 | /* ensure we never evaluate anything shorted than an unsigned long |
78 | * to zero, and ensure we'll never miss the end of an comparison (bjd) */ | 78 | * to zero, and ensure we'll never miss the end of an comparison (bjd) */ |
79 | 79 | ||
80 | #define map_calc_words(map) ((map_bankwidth(map) + (sizeof(unsigned long)-1))/ sizeof(unsigned long)) | 80 | #define map_calc_words(map) ((map_bankwidth(map) + (sizeof(unsigned long)-1)) / sizeof(unsigned long)) |
81 | 81 | ||
82 | #ifdef CONFIG_MTD_MAP_BANK_WIDTH_8 | 82 | #ifdef CONFIG_MTD_MAP_BANK_WIDTH_8 |
83 | # ifdef map_bankwidth | 83 | # ifdef map_bankwidth |
@@ -181,7 +181,7 @@ static inline int map_bankwidth_supported(int w) | |||
181 | } | 181 | } |
182 | } | 182 | } |
183 | 183 | ||
184 | #define MAX_MAP_LONGS ( ((MAX_MAP_BANKWIDTH*8) + BITS_PER_LONG - 1) / BITS_PER_LONG ) | 184 | #define MAX_MAP_LONGS (((MAX_MAP_BANKWIDTH * 8) + BITS_PER_LONG - 1) / BITS_PER_LONG) |
185 | 185 | ||
186 | typedef union { | 186 | typedef union { |
187 | unsigned long x[MAX_MAP_LONGS]; | 187 | unsigned long x[MAX_MAP_LONGS]; |
@@ -264,20 +264,22 @@ void unregister_mtd_chip_driver(struct mtd_chip_driver *); | |||
264 | struct mtd_info *do_map_probe(const char *name, struct map_info *map); | 264 | struct mtd_info *do_map_probe(const char *name, struct map_info *map); |
265 | void map_destroy(struct mtd_info *mtd); | 265 | void map_destroy(struct mtd_info *mtd); |
266 | 266 | ||
267 | #define ENABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(map, 1); } while(0) | 267 | #define ENABLE_VPP(map) do { if (map->set_vpp) map->set_vpp(map, 1); } while (0) |
268 | #define DISABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(map, 0); } while(0) | 268 | #define DISABLE_VPP(map) do { if (map->set_vpp) map->set_vpp(map, 0); } while (0) |
269 | 269 | ||
270 | #define INVALIDATE_CACHED_RANGE(map, from, size) \ | 270 | #define INVALIDATE_CACHED_RANGE(map, from, size) \ |
271 | do { if(map->inval_cache) map->inval_cache(map, from, size); } while(0) | 271 | do { if (map->inval_cache) map->inval_cache(map, from, size); } while (0) |
272 | 272 | ||
273 | 273 | ||
274 | static inline int map_word_equal(struct map_info *map, map_word val1, map_word val2) | 274 | static inline int map_word_equal(struct map_info *map, map_word val1, map_word val2) |
275 | { | 275 | { |
276 | int i; | 276 | int i; |
277 | for (i=0; i<map_words(map); i++) { | 277 | |
278 | for (i = 0; i < map_words(map); i++) { | ||
278 | if (val1.x[i] != val2.x[i]) | 279 | if (val1.x[i] != val2.x[i]) |
279 | return 0; | 280 | return 0; |
280 | } | 281 | } |
282 | |||
281 | return 1; | 283 | return 1; |
282 | } | 284 | } |
283 | 285 | ||
@@ -286,9 +288,9 @@ static inline map_word map_word_and(struct map_info *map, map_word val1, map_wor | |||
286 | map_word r; | 288 | map_word r; |
287 | int i; | 289 | int i; |
288 | 290 | ||
289 | for (i=0; i<map_words(map); i++) { | 291 | for (i = 0; i < map_words(map); i++) |
290 | r.x[i] = val1.x[i] & val2.x[i]; | 292 | r.x[i] = val1.x[i] & val2.x[i]; |
291 | } | 293 | |
292 | return r; | 294 | return r; |
293 | } | 295 | } |
294 | 296 | ||
@@ -297,9 +299,9 @@ static inline map_word map_word_clr(struct map_info *map, map_word val1, map_wor | |||
297 | map_word r; | 299 | map_word r; |
298 | int i; | 300 | int i; |
299 | 301 | ||
300 | for (i=0; i<map_words(map); i++) { | 302 | for (i = 0; i < map_words(map); i++) |
301 | r.x[i] = val1.x[i] & ~val2.x[i]; | 303 | r.x[i] = val1.x[i] & ~val2.x[i]; |
302 | } | 304 | |
303 | return r; | 305 | return r; |
304 | } | 306 | } |
305 | 307 | ||
@@ -308,9 +310,9 @@ static inline map_word map_word_or(struct map_info *map, map_word val1, map_word | |||
308 | map_word r; | 310 | map_word r; |
309 | int i; | 311 | int i; |
310 | 312 | ||
311 | for (i=0; i<map_words(map); i++) { | 313 | for (i = 0; i < map_words(map); i++) |
312 | r.x[i] = val1.x[i] | val2.x[i]; | 314 | r.x[i] = val1.x[i] | val2.x[i]; |
313 | } | 315 | |
314 | return r; | 316 | return r; |
315 | } | 317 | } |
316 | 318 | ||
@@ -330,10 +332,11 @@ static inline int map_word_bitsset(struct map_info *map, map_word val1, map_word | |||
330 | { | 332 | { |
331 | int i; | 333 | int i; |
332 | 334 | ||
333 | for (i=0; i<map_words(map); i++) { | 335 | for (i = 0; i < map_words(map); i++) { |
334 | if (val1.x[i] & val2.x[i]) | 336 | if (val1.x[i] & val2.x[i]) |
335 | return 1; | 337 | return 1; |
336 | } | 338 | } |
339 | |||
337 | return 0; | 340 | return 0; |
338 | } | 341 | } |
339 | 342 | ||
@@ -365,14 +368,16 @@ static inline map_word map_word_load_partial(struct map_info *map, map_word orig | |||
365 | 368 | ||
366 | if (map_bankwidth_is_large(map)) { | 369 | if (map_bankwidth_is_large(map)) { |
367 | char *dest = (char *)&orig; | 370 | char *dest = (char *)&orig; |
371 | |||
368 | memcpy(dest+start, buf, len); | 372 | memcpy(dest+start, buf, len); |
369 | } else { | 373 | } else { |
370 | for (i=start; i < start+len; i++) { | 374 | for (i = start; i < start+len; i++) { |
371 | int bitpos; | 375 | int bitpos; |
376 | |||
372 | #ifdef __LITTLE_ENDIAN | 377 | #ifdef __LITTLE_ENDIAN |
373 | bitpos = i*8; | 378 | bitpos = i * 8; |
374 | #else /* __BIG_ENDIAN */ | 379 | #else /* __BIG_ENDIAN */ |
375 | bitpos = (map_bankwidth(map)-1-i)*8; | 380 | bitpos = (map_bankwidth(map) - 1 - i) * 8; |
376 | #endif | 381 | #endif |
377 | orig.x[0] &= ~(0xff << bitpos); | 382 | orig.x[0] &= ~(0xff << bitpos); |
378 | orig.x[0] |= (unsigned long)buf[i-start] << bitpos; | 383 | orig.x[0] |= (unsigned long)buf[i-start] << bitpos; |
@@ -394,9 +399,10 @@ static inline map_word map_word_ff(struct map_info *map) | |||
394 | 399 | ||
395 | if (map_bankwidth(map) < MAP_FF_LIMIT) { | 400 | if (map_bankwidth(map) < MAP_FF_LIMIT) { |
396 | int bw = 8 * map_bankwidth(map); | 401 | int bw = 8 * map_bankwidth(map); |
402 | |||
397 | r.x[0] = (1UL << bw) - 1; | 403 | r.x[0] = (1UL << bw) - 1; |
398 | } else { | 404 | } else { |
399 | for (i=0; i<map_words(map); i++) | 405 | for (i = 0; i < map_words(map); i++) |
400 | r.x[i] = ~0UL; | 406 | r.x[i] = ~0UL; |
401 | } | 407 | } |
402 | return r; | 408 | return r; |
@@ -417,7 +423,7 @@ static inline map_word inline_map_read(struct map_info *map, unsigned long ofs) | |||
417 | r.x[0] = __raw_readq(map->virt + ofs); | 423 | r.x[0] = __raw_readq(map->virt + ofs); |
418 | #endif | 424 | #endif |
419 | else if (map_bankwidth_is_large(map)) | 425 | else if (map_bankwidth_is_large(map)) |
420 | memcpy_fromio(r.x, map->virt+ofs, map->bankwidth); | 426 | memcpy_fromio(r.x, map->virt + ofs, map->bankwidth); |
421 | else | 427 | else |
422 | BUG(); | 428 | BUG(); |
423 | 429 | ||