lkml.org 
[lkml]   [2015]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] btrfs: remove unneeded NULL initializer for struct fs_path
On Sat, Sep 26, 2015 at 12:05:19PM +0000, Alexandru Moise wrote:
> fs_path_alloc() either returns an alloc'ed struct fs_path
> or NULL, no need to initialize the pointer to NULL.
>
> Signed-off-by: Alexandru Moise <00moses.alexander00@gmail.com>
> ---
> fs/btrfs/send.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
> index aa72bfd..0019c90 100644
> --- a/fs/btrfs/send.c
> +++ b/fs/btrfs/send.c
> @@ -2230,7 +2230,7 @@ static int get_cur_path(struct send_ctx *sctx, u64 ino, u64 gen,
> struct fs_path *dest)
> {
> int ret = 0;
> - struct fs_path *name = NULL;
> + struct fs_path *name;

I'd rather see all such instances fixed in one patch. Quick grep
revealed a few more. OTOH this kind of extra initialization is harmless
and sometimes help readability, it's clear that he value is zeroed.


\
 
 \ /
  Last update: 2015-09-29 15:01    [W:0.040 / U:0.648 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site