lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <abb91fb3-f50a-6235-eac6-a94093c54cc8@gmx.com>
Date:   Wed, 14 Jun 2023 15:09:44 +0800
From:   Qu Wenruo <quwenruo.btrfs@....com>
To:     baomingtong001@...suo.com, clm@...com, josef@...icpanda.com,
        dsterba@...e.com
Cc:     linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] btrfs: remove unneeded variable from unpin_extent_cache()



On 2023/6/14 14:59, baomingtong001@...suo.com wrote:
> fix the following coccicheck warning:
>
> fs/btrfs/extent_map.c:298:5-8: Unneeded variable: "ret". Return "0".
>
> Signed-off-by: Mingtong Bao <baomingtong001@...suo.com>

You can take it one step further by making the function return void.

Thanks,
Qu
> ---
>   fs/btrfs/extent_map.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
> index 0cdb3e86f29b..f3e9aaeb9956 100644
> --- a/fs/btrfs/extent_map.c
> +++ b/fs/btrfs/extent_map.c
> @@ -295,7 +295,6 @@ static void try_merge_map(struct extent_map_tree
> *tree, struct extent_map *em)
>   int unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len,
>                  u64 gen)
>   {
> -    int ret = 0;
>       struct extent_map *em;
>       bool prealloc = false;
>
> @@ -327,7 +326,7 @@ int unpin_extent_cache(struct extent_map_tree *tree,
> u64 start, u64 len,
>       free_extent_map(em);
>   out:
>       write_unlock(&tree->lock);
> -    return ret;
> +    return 0;
>
>   }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ