diff mbox

block: rbd.c: Remove unused function

Message ID 1420131512-30585-1-git-send-email-rickard_strandqvist@spectrumdigital.se (mailing list archive)
State New, archived
Headers show

Commit Message

Rickard Strandqvist Jan. 1, 2015, 4:58 p.m. UTC
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@spectrumdigital.se>
---
 drivers/block/rbd.c |   30 ------------------------------
 1 file changed, 30 deletions(-)

Comments

Ilya Dryomov Jan. 5, 2015, 9:25 a.m. UTC | #1
On Thu, Jan 1, 2015 at 7:58 PM, Rickard Strandqvist
<rickard_strandqvist@spectrumdigital.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@spectrumdigital.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 ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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