diff mbox

net: ceph: armor.c: Remove unused function

Message ID 1419115000-12178-1-git-send-email-rickard_strandqvist@spectrumdigital.se
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Rickard Strandqvist Dec. 20, 2014, 10:36 p.m. UTC
Remove the function ceph_armor() 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>
---
 net/ceph/armor.c  |   39 ---------------------------------------
 net/ceph/crypto.h |    1 -
 2 files changed, 40 deletions(-)

Comments

Ilya Dryomov Dec. 21, 2014, 11:19 a.m. UTC | #1
On Sun, Dec 21, 2014 at 1:36 AM, Rickard Strandqvist
<rickard_strandqvist@spectrumdigital.se> wrote:
> Remove the function ceph_armor() that is not used anywhere.
>
> This was partially found by using a static code analysis program called cppcheck.

It's ceph_unarmor()'s counterpart - so same as for "[PATCH] net: ceph:
crypto.c: Remove some unused functions".

Thanks,

                Ilya
--
To unsubscribe from this list: send the line "unsubscribe netdev" 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/net/ceph/armor.c b/net/ceph/armor.c
index 1fc1ee1..05e0d2b 100644
--- a/net/ceph/armor.c
+++ b/net/ceph/armor.c
@@ -1,7 +1,6 @@ 
 
 #include <linux/errno.h>
 
-int ceph_armor(char *dst, const char *src, const char *end);
 int ceph_unarmor(char *dst, const char *src, const char *end);
 
 /*
@@ -33,44 +32,6 @@  static int decode_bits(char c)
 	return -EINVAL;
 }
 
-int ceph_armor(char *dst, const char *src, const char *end)
-{
-	int olen = 0;
-	int line = 0;
-
-	while (src < end) {
-		unsigned char a, b, c;
-
-		a = *src++;
-		*dst++ = encode_bits(a >> 2);
-		if (src < end) {
-			b = *src++;
-			*dst++ = encode_bits(((a & 3) << 4) | (b >> 4));
-			if (src < end) {
-				c = *src++;
-				*dst++ = encode_bits(((b & 15) << 2) |
-						     (c >> 6));
-				*dst++ = encode_bits(c & 63);
-			} else {
-				*dst++ = encode_bits((b & 15) << 2);
-				*dst++ = '=';
-			}
-		} else {
-			*dst++ = encode_bits(((a & 3) << 4));
-			*dst++ = '=';
-			*dst++ = '=';
-		}
-		olen += 4;
-		line += 4;
-		if (line == 64) {
-			line = 0;
-			*(dst++) = '\n';
-			olen++;
-		}
-	}
-	return olen;
-}
-
 int ceph_unarmor(char *dst, const char *src, const char *end)
 {
 	int olen = 0;
diff --git a/net/ceph/crypto.h b/net/ceph/crypto.h
index d149822..5cbc7b1 100644
--- a/net/ceph/crypto.h
+++ b/net/ceph/crypto.h
@@ -45,7 +45,6 @@  int ceph_crypto_init(void);
 void ceph_crypto_shutdown(void);
 
 /* armor.c */
-int ceph_armor(char *dst, const char *src, const char *end);
 int ceph_unarmor(char *dst, const char *src, const char *end);
 
 #endif