diff mbox

btrfs-progs: trivial code style fix in root-tree.c

Message ID 502CF2F0.7020601@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wang Sheng-Hui Aug. 16, 2012, 1:17 p.m. UTC
Add code indent to the bad styled statements.

Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
---
 root-tree.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

Comments

Arne Jansen Aug. 16, 2012, 1:23 p.m. UTC | #1
On 16.08.2012 15:17, Wang Sheng-Hui wrote:
> Add code indent to the bad styled statements.
> 
> Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
> ---
>  root-tree.c |   10 ++++------
>  1 files changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/root-tree.c b/root-tree.c
> index 782472c..39cfef6 100644
> --- a/root-tree.c
> +++ b/root-tree.c
> @@ -182,12 +182,10 @@ int btrfs_del_root(struct btrfs_trans_handle *trans, struct btrfs_root *root,
>  	if (ret < 0)
>  		goto out;
>  	if (ret) {
> -btrfs_print_leaf(root, path->nodes[0]);
> -printk("failed to del %llu %u %llu\n",
> -	(unsigned long long)key->objectid,
> -	key->type,
> -	(unsigned long long)key->offset);
> -

I guess Alexander intentionally put in the bad indentation
to remind him to remove this code before submitting the
patch :)

> +		btrfs_print_leaf(root, path->nodes[0]);
> +		printk("failed to del %llu %u %llu\n",
> +			(unsigned long long)key->objectid, key->type,
> +			(unsigned long long)key->offset);
>  	}
>  	BUG_ON(ret != 0);
>  	leaf = path->nodes[0];

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Wang Sheng-Hui Aug. 16, 2012, 1:26 p.m. UTC | #2
On 2012?08?16? 21:23, Arne Jansen wrote:
> On 16.08.2012 15:17, Wang Sheng-Hui wrote:
>> Add code indent to the bad styled statements.
>>
>> Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
>> ---
>>  root-tree.c |   10 ++++------
>>  1 files changed, 4 insertions(+), 6 deletions(-)
>>
>> diff --git a/root-tree.c b/root-tree.c
>> index 782472c..39cfef6 100644
>> --- a/root-tree.c
>> +++ b/root-tree.c
>> @@ -182,12 +182,10 @@ int btrfs_del_root(struct btrfs_trans_handle *trans, struct btrfs_root *root,
>>  	if (ret < 0)
>>  		goto out;
>>  	if (ret) {
>> -btrfs_print_leaf(root, path->nodes[0]);
>> -printk("failed to del %llu %u %llu\n",
>> -	(unsigned long long)key->objectid,
>> -	key->type,
>> -	(unsigned long long)key->offset);
>> -
> 
> I guess Alexander intentionally put in the bad indentation
> to remind him to remove this code before submitting the
> patch :)
> 
>> +		btrfs_print_leaf(root, path->nodes[0]);
>> +		printk("failed to del %llu %u %llu\n",
>> +			(unsigned long long)key->objectid, key->type,
>> +			(unsigned long long)key->offset);
>>  	}

When I saw the BUG_ON, I wonder do we still need the above branch statement.
It looks just to be helpful for debug - give out some info, right? 

>>  	BUG_ON(ret != 0);
>>  	leaf = path->nodes[0];
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arne Jansen Aug. 16, 2012, 1:30 p.m. UTC | #3
On 16.08.2012 15:26, Wang Sheng-Hui wrote:
> On 2012?08?16? 21:23, Arne Jansen wrote:
>> On 16.08.2012 15:17, Wang Sheng-Hui wrote:
>>> Add code indent to the bad styled statements.
>>>
>>> Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
>>> ---
>>>  root-tree.c |   10 ++++------
>>>  1 files changed, 4 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/root-tree.c b/root-tree.c
>>> index 782472c..39cfef6 100644
>>> --- a/root-tree.c
>>> +++ b/root-tree.c
>>> @@ -182,12 +182,10 @@ int btrfs_del_root(struct btrfs_trans_handle *trans, struct btrfs_root *root,
>>>  	if (ret < 0)
>>>  		goto out;
>>>  	if (ret) {
>>> -btrfs_print_leaf(root, path->nodes[0]);
>>> -printk("failed to del %llu %u %llu\n",
>>> -	(unsigned long long)key->objectid,
>>> -	key->type,
>>> -	(unsigned long long)key->offset);
>>> -
>>
>> I guess Alexander intentionally put in the bad indentation
>> to remind him to remove this code before submitting the
>> patch :)
>>
>>> +		btrfs_print_leaf(root, path->nodes[0]);
>>> +		printk("failed to del %llu %u %llu\n",
>>> +			(unsigned long long)key->objectid, key->type,
>>> +			(unsigned long long)key->offset);
>>>  	}
> 
> When I saw the BUG_ON, I wonder do we still need the above branch statement.
> It looks just to be helpful for debug - give out some info, right? 

Yes. So either we delete it completely or we move the BUG_ON
into the block as a BUG_ON(1) and add a "Btrfs: "-prefix to the
printk.
On the other hand, I just saw this is progs, so I think it can
just be deleted.

> 
>>>  	BUG_ON(ret != 0);
>>>  	leaf = path->nodes[0];
>>
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/root-tree.c b/root-tree.c
index 782472c..39cfef6 100644
--- a/root-tree.c
+++ b/root-tree.c
@@ -182,12 +182,10 @@  int btrfs_del_root(struct btrfs_trans_handle *trans, struct btrfs_root *root,
 	if (ret < 0)
 		goto out;
 	if (ret) {
-btrfs_print_leaf(root, path->nodes[0]);
-printk("failed to del %llu %u %llu\n",
-	(unsigned long long)key->objectid,
-	key->type,
-	(unsigned long long)key->offset);
-
+		btrfs_print_leaf(root, path->nodes[0]);
+		printk("failed to del %llu %u %llu\n",
+			(unsigned long long)key->objectid, key->type,
+			(unsigned long long)key->offset);
 	}
 	BUG_ON(ret != 0);
 	leaf = path->nodes[0];