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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 18 Aug 2020 08:50:34 -0700
From:   Yonghong Song <yhs@...com>
To:     Xu Wang <vulab@...as.ac.cn>, <ast@...nel.org>,
        <daniel@...earbox.net>, <kafai@...com>, <songliubraving@...com>,
        <andriin@...com>, <john.fastabend@...il.com>,
        <kpsingh@...omium.org>, <netdev@...r.kernel.org>,
        <bpf@...r.kernel.org>
CC:     <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] libbpf: simplify the return expression of
 build_map_pin_path()



On 8/18/20 1:20 AM, Xu Wang wrote:
> Simplify the return expression.
> 
> Signed-off-by: Xu Wang <vulab@...as.ac.cn>
> ---
>   tools/lib/bpf/libbpf.c | 6 +-----
>   1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> index 5055e1531e43..b423fdaae0b6 100644
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@ -1935,11 +1935,7 @@ static int build_map_pin_path(struct bpf_map *map, const char *path)
>   	else if (len >= PATH_MAX)
>   		return -ENAMETOOLONG;
>   
> -	err = bpf_map__set_pin_path(map, buf);
> -	if (err)
> -		return err;
> -
> -	return 0;
> +	return bpf_map__set_pin_path(map, buf);

After the above, the variable `err` will not be used any more, which
may incur an unused variable warning. Could you remove it?

>   }
>   
>   
> 

Powered by blists - more mailing lists