diff options
author | Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> | 2015-01-01 11:58:32 -0500 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2015-02-19 05:31:38 -0500 |
commit | 3a25cf43e00842ce51f7ce48ea5e38e516b574a8 (patch) | |
tree | 47a9c0f84a06ec8c15b590e323058038a82b0b73 | |
parent | 03f4fcb02884859b584c709652bb48f8125ceb45 (diff) |
rbd: nuke copy_token()
It's been largely superseded by dup_token() and unused for over
2 years, identified by cppcheck.
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
[idryomov@redhat.com: changelog]
Signed-off-by: Ilya Dryomov <idryomov@redhat.com>
-rw-r--r-- | drivers/block/rbd.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 8a86b62466f7..ef070d7c5e3c 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -4771,36 +4771,6 @@ static inline size_t next_token(const char **buf) | |||
4771 | } | 4771 | } |
4772 | 4772 | ||
4773 | /* | 4773 | /* |
4774 | * Finds the next token in *buf, and if the provided token buffer is | ||
4775 | * big enough, copies the found token into it. The result, if | ||
4776 | * copied, is guaranteed to be terminated with '\0'. Note that *buf | ||
4777 | * must be terminated with '\0' on entry. | ||
4778 | * | ||
4779 | * Returns the length of the token found (not including the '\0'). | ||
4780 | * Return value will be 0 if no token is found, and it will be >= | ||
4781 | * token_size if the token would not fit. | ||
4782 | * | ||
4783 | * The *buf pointer will be updated to point beyond the end of the | ||
4784 | * found token. Note that this occurs even if the token buffer is | ||
4785 | * too small to hold it. | ||
4786 | */ | ||
4787 | static inline size_t copy_token(const char **buf, | ||
4788 | char *token, | ||
4789 | size_t token_size) | ||
4790 | { | ||
4791 | size_t len; | ||
4792 | |||
4793 | len = next_token(buf); | ||
4794 | if (len < token_size) { | ||
4795 | memcpy(token, *buf, len); | ||
4796 | *(token + len) = '\0'; | ||
4797 | } | ||
4798 | *buf += len; | ||
4799 | |||
4800 | return len; | ||
4801 | } | ||
4802 | |||
4803 | /* | ||
4804 | * Finds the next token in *buf, dynamically allocates a buffer big | 4774 | * Finds the next token in *buf, dynamically allocates a buffer big |
4805 | * enough to hold a copy of it, and copies the token into the new | 4775 | * enough to hold a copy of it, and copies the token into the new |
4806 | * buffer. The copy is guaranteed to be terminated with '\0'. Note | 4776 | * buffer. The copy is guaranteed to be terminated with '\0'. Note |