Re: [PATCH] block: rbd.c: Remove unused function

From: Ilya Dryomov
Date: Mon Jan 05 2015 - 04:25:47 EST


On Thu, Jan 1, 2015 at 7:58 PM, Rickard Strandqvist
<rickard_strandqvist@xxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxx>
> ---
> 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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/