>> @@ -3682,7 +3678,7 @@ static int __btrfs_balance(struct btrfs_fs_info
>> *fs_info)
>> counting = false;
>> goto again;
>> }
>> -error:
>> +free_path:
>> btrfs_free_path(path);
>> if (enospc_errors) {
>> btrfs_info(fs_info, "%d enospc errors
From: Markus Elfring
Date: Sun, 5 Nov 2017 22:03:22 +0100
* Adjust jump targets so that a call of the function "mutex_unlock"
can be better reused for error cases at the end of this function.
* Replace three calls by goto statements.
This issue was detected by using the Coccinelle software.
From: Markus Elfring
Date: Mon, 21 Aug 2017 15:45:23 +0200
Add a jump target so that a bit of exception handling can be better reused
at the end of this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
v2:
Do you find this refactoring accep
> Don't needed, and you did miss several similar places (L573 & L895) in
> that file with explicit initialisation.
Would you like to adjust any remaining places in such source files?
Regards,
Markus
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message
> That's will work,
Thanks for your acknowledgement.
> but that's don't improve anything.
Do you like a small source code reduction here?
Regards,
Markus
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordo
From: Markus Elfring
Date: Mon, 21 Aug 2017 14:15:23 +0200
Add jump targets so that a bit of exception handling can be better reused
at the end of this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
fs/btrfs/file.c | 62 ++
From: Markus Elfring
Date: Mon, 21 Aug 2017 13:34:29 +0200
Add a jump target so that a bit of exception handling can be better reused
in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
fs/btrfs/send.c | 8
1 file changed, 4 i
From: Markus Elfring
Date: Mon, 21 Aug 2017 13:10:15 +0200
Add a jump target so that a bit of exception handling can be better reused
at the end of this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
fs/btrfs/root-tree.c | 27 +++-
From: Markus Elfring
Date: Mon, 21 Aug 2017 10:03:00 +0200
Add a jump target so that a bit of exception handling can be better reused
at the end of this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
fs/btrfs/extent-tree.c | 69 ++
From: Markus Elfring
Date: Mon, 21 Aug 2017 09:36:48 +0200
Add a jump target so that a bit of exception handling can be better reused
in this function.
Signed-off-by: Markus Elfring
---
fs/btrfs/ctree.c | 14 ++
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/fs/btrfs
From: Markus Elfring
Date: Mon, 21 Aug 2017 14:30:12 +0200
A few update suggestions were taken into account
from static source code analysis.
Markus Elfring (5):
Use common error handling code in tree_mod_log_eb_copy()
Use common error handling code in __btrfs_free_extent()
Use common erro
From: Markus Elfring
Date: Sun, 20 Aug 2017 22:02:54 +0200
The variable "tm_list" will eventually be set to an appropriate pointer
a bit later. Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring
---
fs/btrfs/ctree.c | 2 +-
1 file changed, 1 insertion(+), 1 d
From: Markus Elfring
Date: Sun, 20 Aug 2017 21:55:56 +0200
Replace the specification of data types by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
This issue was detected b
From: Markus Elfring
Date: Sun, 20 Aug 2017 21:36:31 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The script “checkpatch.pl” pointed information out like the following.
Comparison to NULL could be written …
Thus fix the affected source code pla
From: Markus Elfring
Date: Sun, 20 Aug 2017 21:10:17 +0200
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
---
fs/btrfs/check-integrity.c | 4 +---
1 file changed, 1 insertion(+), 3
From: Markus Elfring
Date: Sun, 20 Aug 2017 22:11:33 +0200
Some update suggestions were taken into account
from static source code analysis.
Markus Elfring (4):
Delete an error message for a failed memory allocation in
btrfsic_process_superblock()
Adjust 32 checks for null pointers
Improv
> Recent commits to kernel/git/torvalds/linux.git have made the following
> functions able to tolerate NULL arguments:
>
> kmem_cache_destroy (commit 3942d29918522)
> mempool_destroy (commit 4e3ca3e033d1)
> dma_pool_destroy (commit 44d7175da6ea)
How do you think about to extend an other SmPL scrip
>> https://lkml.org/lkml/2014/10/31/606
>> http://article.gmane.org/gmane.linux.kernel/1818924
>> https://systeme.lip6.fr/pipermail/cocci/2014-October/001321.html
>
> Oh, I see you already made the exact same change.
Would you like to add any tags to my update suggestion?
Regards,
Markus
--
To u
> kfree checks whether the pointer it is passed is NULL. The two foregoing
> checks are therefore unnecessary.
>
> This issue was detected using Coccinelle.
Would you like to integrate my update suggestion "btrfs: Deletion of
unnecessary checks before six function calls"?
https://lkml.org/lkml/20
The following functions test whether their argument is NULL and then
return immediately.
* btrfs_free_path()
* free_extent_buffer()
* free_extent_map()
* free_extent_state()
* iput()
* kfree()
Thus the test around the call is not needed.
This issue was detected by using the Coccinelle software.
20 matches
Mail list logo