aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfsplus
diff options
context:
space:
mode:
authorAnton Salikhmetov <alexo@tuxera.com>2010-12-16 11:08:42 -0500
committerChristoph Hellwig <hch@lst.de>2011-06-30 07:40:58 -0400
commit2b4f9ca8a575ce6d7ddb59d668e2be250bf86a8f (patch)
treeca461cd657ea671d83ad6ef23f22ad8b99a57ad5 /fs/hfsplus
parent032016a56a1e9c83646435b32e4416d499e1f1ce (diff)
hfsplus: assignments inside `if' condition clean-up
Make assignments outside `if' conditions for unicode.c module where the checkpatch.pl script reported this coding style error. Signed-off-by: Anton Salikhmetov <alexo@tuxera.com> Signed-off-by: Christoph Hellwig <hch@tuxera.com>
Diffstat (limited to 'fs/hfsplus')
-rw-r--r--fs/hfsplus/unicode.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/fs/hfsplus/unicode.c b/fs/hfsplus/unicode.c
index a3f0bfcc881e..a32998f29f0b 100644
--- a/fs/hfsplus/unicode.c
+++ b/fs/hfsplus/unicode.c
@@ -142,7 +142,11 @@ int hfsplus_uni2asc(struct super_block *sb,
142 /* search for single decomposed char */ 142 /* search for single decomposed char */
143 if (likely(compose)) 143 if (likely(compose))
144 ce1 = hfsplus_compose_lookup(hfsplus_compose_table, c0); 144 ce1 = hfsplus_compose_lookup(hfsplus_compose_table, c0);
145 if (ce1 && (cc = ce1[0])) { 145 if (ce1)
146 cc = ce1[0];
147 else
148 cc = 0;
149 if (cc) {
146 /* start of a possibly decomposed Hangul char */ 150 /* start of a possibly decomposed Hangul char */
147 if (cc != 0xffff) 151 if (cc != 0xffff)
148 goto done; 152 goto done;
@@ -209,7 +213,8 @@ int hfsplus_uni2asc(struct super_block *sb,
209 i++; 213 i++;
210 ce2 = ce1; 214 ce2 = ce1;
211 } 215 }
212 if ((cc = ce2[0])) { 216 cc = ce2[0];
217 if (cc) {
213 ip += i; 218 ip += i;
214 ustrlen -= i; 219 ustrlen -= i;
215 goto done; 220 goto done;
@@ -301,7 +306,11 @@ int hfsplus_asc2uni(struct super_block *sb, struct hfsplus_unistr *ustr,
301 while (outlen < HFSPLUS_MAX_STRLEN && len > 0) { 306 while (outlen < HFSPLUS_MAX_STRLEN && len > 0) {
302 size = asc2unichar(sb, astr, len, &c); 307 size = asc2unichar(sb, astr, len, &c);
303 308
304 if (decompose && (dstr = decompose_unichar(c, &dsize))) { 309 if (decompose)
310 dstr = decompose_unichar(c, &dsize);
311 else
312 dstr = NULL;
313 if (dstr) {
305 if (outlen + dsize > HFSPLUS_MAX_STRLEN) 314 if (outlen + dsize > HFSPLUS_MAX_STRLEN)
306 break; 315 break;
307 do { 316 do {
@@ -346,15 +355,23 @@ int hfsplus_hash_dentry(const struct dentry *dentry, const struct inode *inode,
346 astr += size; 355 astr += size;
347 len -= size; 356 len -= size;
348 357
349 if (decompose && (dstr = decompose_unichar(c, &dsize))) { 358 if (decompose)
359 dstr = decompose_unichar(c, &dsize);
360 else
361 dstr = NULL;
362 if (dstr) {
350 do { 363 do {
351 c2 = *dstr++; 364 c2 = *dstr++;
352 if (!casefold || (c2 = case_fold(c2))) 365 if (casefold)
366 c2 = case_fold(c2);
367 if (!casefold || c2)
353 hash = partial_name_hash(c2, hash); 368 hash = partial_name_hash(c2, hash);
354 } while (--dsize > 0); 369 } while (--dsize > 0);
355 } else { 370 } else {
356 c2 = c; 371 c2 = c;
357 if (!casefold || (c2 = case_fold(c2))) 372 if (casefold)
373 c2 = case_fold(c2);
374 if (!casefold || c2)
358 hash = partial_name_hash(c2, hash); 375 hash = partial_name_hash(c2, hash);
359 } 376 }
360 } 377 }
@@ -422,12 +439,14 @@ int hfsplus_compare_dentry(const struct dentry *parent,
422 c1 = *dstr1; 439 c1 = *dstr1;
423 c2 = *dstr2; 440 c2 = *dstr2;
424 if (casefold) { 441 if (casefold) {
425 if (!(c1 = case_fold(c1))) { 442 c1 = case_fold(c1);
443 if (!c1) {
426 dstr1++; 444 dstr1++;
427 dsize1--; 445 dsize1--;
428 continue; 446 continue;
429 } 447 }
430 if (!(c2 = case_fold(c2))) { 448 c2 = case_fold(c2);
449 if (!c2) {
431 dstr2++; 450 dstr2++;
432 dsize2--; 451 dsize2--;
433 continue; 452 continue;