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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 5 Jan 2015 12:25:39 +0300
From:	Ilya Dryomov <ilya.dryomov@...tank.com>
To:	Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc:	Yehuda Sadeh <yehuda@...tank.com>, Sage Weil <sage@...tank.com>,
	Alex Elder <elder@...nel.org>,
	Ceph Development <ceph-devel@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] block: rbd.c: Remove unused function

On Thu, Jan 1, 2015 at 7:58 PM, Rickard Strandqvist
<rickard_strandqvist@...ctrumdigital.se> wrote:
> Remove the function copy_token() that is not used anywhere.
>
> This was partially found by using a static code analysis program called cppcheck.
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
> ---
>  drivers/block/rbd.c |   30 ------------------------------
>  1 file changed, 30 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index 27b71a0..922f1ab 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -4776,36 +4776,6 @@ static inline size_t next_token(const char **buf)
>  }
>
>  /*
> - * Finds the next token in *buf, and if the provided token buffer is
> - * big enough, copies the found token into it.  The result, if
> - * copied, is guaranteed to be terminated with '\0'.  Note that *buf
> - * must be terminated with '\0' on entry.
> - *
> - * Returns the length of the token found (not including the '\0').
> - * Return value will be 0 if no token is found, and it will be >=
> - * token_size if the token would not fit.
> - *
> - * The *buf pointer will be updated to point beyond the end of the
> - * found token.  Note that this occurs even if the token buffer is
> - * too small to hold it.
> - */
> -static inline size_t copy_token(const char **buf,
> -                               char *token,
> -                               size_t token_size)
> -{
> -        size_t len;
> -
> -       len = next_token(buf);
> -       if (len < token_size) {
> -               memcpy(token, *buf, len);
> -               *(token + len) = '\0';
> -       }
> -       *buf += len;
> -
> -        return len;
> -}
> -
> -/*
>   * Finds the next token in *buf, dynamically allocates a buffer big
>   * enough to hold a copy of it, and copies the token into the new
>   * buffer.  The copy is guaranteed to be terminated with '\0'.  Note

Applied with an amended changelog.

Thanks,

                Ilya
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ