From: Anton Salikhmetov <alexo@tuxera.com>
To: hch@tuxera.com, linux-fsdevel@vger.kernel.org
Subject: [PATCH 5/5] hfsplus: assignments inside `if' condition clean-up
Date: Thu, 16 Dec 2010 18:08:42 +0200 [thread overview]
Message-ID: <1292515722-17884-6-git-send-email-alexo@tuxera.com> (raw)
In-Reply-To: <1292515722-17884-1-git-send-email-alexo@tuxera.com>
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>
---
fs/hfsplus/unicode.c | 35 +++++++++++++++++++++++++++--------
1 files changed, 27 insertions(+), 8 deletions(-)
diff --git a/fs/hfsplus/unicode.c b/fs/hfsplus/unicode.c
index 7dd90a5..225837a 100644
--- a/fs/hfsplus/unicode.c
+++ b/fs/hfsplus/unicode.c
@@ -142,7 +142,11 @@ int hfsplus_uni2asc(struct super_block *sb,
/* search for single decomposed char */
if (likely(compose))
ce1 = hfsplus_compose_lookup(hfsplus_compose_table, c0);
- if (ce1 && (cc = ce1[0])) {
+ if (ce1)
+ cc = ce1[0];
+ else
+ cc = 0;
+ if (cc) {
/* start of a possibly decomposed Hangul char */
if (cc != 0xffff)
goto done;
@@ -209,7 +213,8 @@ int hfsplus_uni2asc(struct super_block *sb,
i++;
ce2 = ce1;
}
- if ((cc = ce2[0])) {
+ cc = ce2[0];
+ if (cc) {
ip += i;
ustrlen -= i;
goto done;
@@ -301,7 +306,11 @@ int hfsplus_asc2uni(struct super_block *sb, struct hfsplus_unistr *ustr,
while (outlen < HFSPLUS_MAX_STRLEN && len > 0) {
size = asc2unichar(sb, astr, len, &c);
- if (decompose && (dstr = decompose_unichar(c, &dsize))) {
+ if (decompose)
+ dstr = decompose_unichar(c, &dsize);
+ else
+ dstr = NULL;
+ if (dstr) {
if (outlen + dsize > HFSPLUS_MAX_STRLEN)
break;
do {
@@ -345,15 +354,23 @@ int hfsplus_hash_dentry(struct dentry *dentry, struct qstr *str)
astr += size;
len -= size;
- if (decompose && (dstr = decompose_unichar(c, &dsize))) {
+ if (decompose)
+ dstr = decompose_unichar(c, &dsize);
+ else
+ dstr = NULL;
+ if (dstr) {
do {
c2 = *dstr++;
- if (!casefold || (c2 = case_fold(c2)))
+ if (casefold)
+ c2 = case_fold(c2);
+ if (!casefold || c2)
hash = partial_name_hash(c2, hash);
} while (--dsize > 0);
} else {
c2 = c;
- if (!casefold || (c2 = case_fold(c2)))
+ if (casefold)
+ c2 = case_fold(c2);
+ if (!casefold || c2)
hash = partial_name_hash(c2, hash);
}
}
@@ -419,12 +436,14 @@ int hfsplus_compare_dentry(struct dentry *dentry,
c1 = *dstr1;
c2 = *dstr2;
if (casefold) {
- if (!(c1 = case_fold(c1))) {
+ c1 = case_fold(c1);
+ if (!c1) {
dstr1++;
dsize1--;
continue;
}
- if (!(c2 = case_fold(c2))) {
+ c2 = case_fold(c2);
+ if (!c2) {
dstr2++;
dsize2--;
continue;
--
1.7.2.3
next prev parent reply other threads:[~2010-12-16 16:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-16 16:08 [PATCH 0/5] hfsplus: clean-up based on checkpatch.pl Anton Salikhmetov
2010-12-16 16:08 ` [PATCH 1/5] hfsplus: over 80 character lines clean-up Anton Salikhmetov
2010-12-16 16:08 ` [PATCH 2/5] hfsplus: C99 comments clean-up Anton Salikhmetov
2010-12-16 16:08 ` [PATCH 3/5] hfsplus: spaces/indentation clean-up Anton Salikhmetov
2010-12-16 16:08 ` [PATCH 4/5] hfsplus: %L-to-%ll, macro correction, and remove unneeded braces Anton Salikhmetov
2010-12-16 16:08 ` Anton Salikhmetov [this message]
2010-12-16 17:09 ` [PATCH 5/5] hfsplus: assignments inside `if' condition clean-up Andreas Dilger
2010-12-16 17:13 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1292515722-17884-6-git-send-email-alexo@tuxera.com \
--to=alexo@tuxera.com \
--cc=hch@tuxera.com \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).