From: hujianyang <hujianyang@huawei.com>
To: <dedekind1@gmail.com>
Cc: linux-mtd <linux-mtd@lists.infradead.org>
Subject: Re: [PATCH 4/4] UBIFS: Remove useless statements
Date: Mon, 7 Jul 2014 16:07:42 +0800 [thread overview]
Message-ID: <53BA554E.1030804@huawei.com> (raw)
In-Reply-To: <1404218279.6841.43.camel@sauron.fi.intel.com>
On 2014/7/1 20:37, Artem Bityutskiy wrote:
> On Wed, 2014-06-11 at 10:42 +0800, hujianyang wrote:
>> diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c
>> index 0e045e7..f68e088 100644
>> --- a/fs/ubifs/journal.c
>> +++ b/fs/ubifs/journal.c
>> @@ -389,6 +389,9 @@ out:
>> ubifs_dump_budg(c, &c->bi);
>> ubifs_dump_lprops(c);
>> cmt_retries = dbg_check_lprops(c);
>> + if (cmt_retries)
>> + ubifs_err("fail to check lprops, error %d",
>> + cmt_retries);
>> up_write(&c->commit_sem);
>
> The general approach we took in UBIFS is that the function prints about
> its own problems itself. We tend to avoid not make calling function
> print an error message for the called function.
>
> Please, add an error message to 'dbg_check_lprops()' instead.
I think error messages in 'dbg_check_lprops' is good enough.
>
> I've dropped this change. The other ones look OK, so I applied them.
>
> Thanks!
>
I add the return value check because a value-never-read warn. We set
this cmt_retries and never read it. But it is really no nead check it
as you said.
I think this is better.
- cmt_retries = dbg_check_lprops(c);
+ dbg_check_lprops(c);
There is not need to change this by a separate patch. Just leave it
behind.
next prev parent reply other threads:[~2014-07-07 8:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-11 2:37 [PATCH 0/4] UBIFS: Fix code issues detected by Fortify hujianyang
2014-06-11 2:38 ` [PATCH 1/4] UBIFS: Add missing error handling in create_default_filesystem() hujianyang
2014-06-11 2:40 ` [PATCH 2/4] UBIFS: Add missing error handling in dump_lpt_leb() hujianyang
2014-06-11 2:41 ` [PATCH 3/4] UBIFS: Add missing break in dbg_chk_pnode() hujianyang
2014-06-11 2:42 ` [PATCH 4/4] UBIFS: Remove useless statements hujianyang
2014-07-01 12:37 ` Artem Bityutskiy
2014-07-07 8:07 ` hujianyang [this message]
2014-07-01 1:19 ` [PATCH 0/4] UBIFS: Fix code issues detected by Fortify hujianyang
2014-07-01 12:38 ` Artem Bityutskiy
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=53BA554E.1030804@huawei.com \
--to=hujianyang@huawei.com \
--cc=dedekind1@gmail.com \
--cc=linux-mtd@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.