[PATCH 4/4] UBIFS: Remove useless statements

hujianyang hujianyang at huawei.com
Mon Jul 7 01:07:42 PDT 2014


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.




More information about the linux-mtd mailing list