diff options
author | Joe Perches <joe@perches.com> | 2011-06-13 12:21:26 -0400 |
---|---|---|
committer | David S. Miller <davem@conan.davemloft.net> | 2011-06-16 23:19:27 -0400 |
commit | ea110733874d5176cb56dcf612a629ffac09dbf0 (patch) | |
tree | d079bb9990ecf7dadc326b62605fb4de1f6fad4f /net/key/af_key.c | |
parent | 3c8def9776c3d4636291432522ea312f7a44be95 (diff) |
net: Remove casts of void *
Unnecessary casts of void * clutter the code.
These are the remainder casts after several specific
patches to remove netdev_priv and dev_priv.
Done via coccinelle script:
$ cat cast_void_pointer.cocci
@@
type T;
T *pt;
void *pv;
@@
- pt = (T *)pv;
+ pt = pv;
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: David S. Miller <davem@conan.davemloft.net>
Diffstat (limited to 'net/key/af_key.c')
-rw-r--r-- | net/key/af_key.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/net/key/af_key.c b/net/key/af_key.c index 8f92cf8116ea..1e733e9073d0 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -621,7 +621,7 @@ static struct xfrm_state *pfkey_xfrm_state_lookup(struct net *net, const struct | |||
621 | unsigned short family; | 621 | unsigned short family; |
622 | xfrm_address_t *xaddr; | 622 | xfrm_address_t *xaddr; |
623 | 623 | ||
624 | sa = (const struct sadb_sa *) ext_hdrs[SADB_EXT_SA-1]; | 624 | sa = ext_hdrs[SADB_EXT_SA - 1]; |
625 | if (sa == NULL) | 625 | if (sa == NULL) |
626 | return NULL; | 626 | return NULL; |
627 | 627 | ||
@@ -630,7 +630,7 @@ static struct xfrm_state *pfkey_xfrm_state_lookup(struct net *net, const struct | |||
630 | return NULL; | 630 | return NULL; |
631 | 631 | ||
632 | /* sadb_address_len should be checked by caller */ | 632 | /* sadb_address_len should be checked by caller */ |
633 | addr = (const struct sadb_address *) ext_hdrs[SADB_EXT_ADDRESS_DST-1]; | 633 | addr = ext_hdrs[SADB_EXT_ADDRESS_DST - 1]; |
634 | if (addr == NULL) | 634 | if (addr == NULL) |
635 | return NULL; | 635 | return NULL; |
636 | 636 | ||
@@ -1039,7 +1039,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net, | |||
1039 | int err; | 1039 | int err; |
1040 | 1040 | ||
1041 | 1041 | ||
1042 | sa = (const struct sadb_sa *) ext_hdrs[SADB_EXT_SA-1]; | 1042 | sa = ext_hdrs[SADB_EXT_SA - 1]; |
1043 | if (!sa || | 1043 | if (!sa || |
1044 | !present_and_same_family(ext_hdrs[SADB_EXT_ADDRESS_SRC-1], | 1044 | !present_and_same_family(ext_hdrs[SADB_EXT_ADDRESS_SRC-1], |
1045 | ext_hdrs[SADB_EXT_ADDRESS_DST-1])) | 1045 | ext_hdrs[SADB_EXT_ADDRESS_DST-1])) |
@@ -1078,7 +1078,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net, | |||
1078 | sa->sadb_sa_encrypt > SADB_X_CALG_MAX) || | 1078 | sa->sadb_sa_encrypt > SADB_X_CALG_MAX) || |
1079 | sa->sadb_sa_encrypt > SADB_EALG_MAX) | 1079 | sa->sadb_sa_encrypt > SADB_EALG_MAX) |
1080 | return ERR_PTR(-EINVAL); | 1080 | return ERR_PTR(-EINVAL); |
1081 | key = (const struct sadb_key*) ext_hdrs[SADB_EXT_KEY_AUTH-1]; | 1081 | key = ext_hdrs[SADB_EXT_KEY_AUTH - 1]; |
1082 | if (key != NULL && | 1082 | if (key != NULL && |
1083 | sa->sadb_sa_auth != SADB_X_AALG_NULL && | 1083 | sa->sadb_sa_auth != SADB_X_AALG_NULL && |
1084 | ((key->sadb_key_bits+7) / 8 == 0 || | 1084 | ((key->sadb_key_bits+7) / 8 == 0 || |
@@ -1105,14 +1105,14 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net, | |||
1105 | if (sa->sadb_sa_flags & SADB_SAFLAGS_NOPMTUDISC) | 1105 | if (sa->sadb_sa_flags & SADB_SAFLAGS_NOPMTUDISC) |
1106 | x->props.flags |= XFRM_STATE_NOPMTUDISC; | 1106 | x->props.flags |= XFRM_STATE_NOPMTUDISC; |
1107 | 1107 | ||
1108 | lifetime = (const struct sadb_lifetime*) ext_hdrs[SADB_EXT_LIFETIME_HARD-1]; | 1108 | lifetime = ext_hdrs[SADB_EXT_LIFETIME_HARD - 1]; |
1109 | if (lifetime != NULL) { | 1109 | if (lifetime != NULL) { |
1110 | x->lft.hard_packet_limit = _KEY2X(lifetime->sadb_lifetime_allocations); | 1110 | x->lft.hard_packet_limit = _KEY2X(lifetime->sadb_lifetime_allocations); |
1111 | x->lft.hard_byte_limit = _KEY2X(lifetime->sadb_lifetime_bytes); | 1111 | x->lft.hard_byte_limit = _KEY2X(lifetime->sadb_lifetime_bytes); |
1112 | x->lft.hard_add_expires_seconds = lifetime->sadb_lifetime_addtime; | 1112 | x->lft.hard_add_expires_seconds = lifetime->sadb_lifetime_addtime; |
1113 | x->lft.hard_use_expires_seconds = lifetime->sadb_lifetime_usetime; | 1113 | x->lft.hard_use_expires_seconds = lifetime->sadb_lifetime_usetime; |
1114 | } | 1114 | } |
1115 | lifetime = (const struct sadb_lifetime*) ext_hdrs[SADB_EXT_LIFETIME_SOFT-1]; | 1115 | lifetime = ext_hdrs[SADB_EXT_LIFETIME_SOFT - 1]; |
1116 | if (lifetime != NULL) { | 1116 | if (lifetime != NULL) { |
1117 | x->lft.soft_packet_limit = _KEY2X(lifetime->sadb_lifetime_allocations); | 1117 | x->lft.soft_packet_limit = _KEY2X(lifetime->sadb_lifetime_allocations); |
1118 | x->lft.soft_byte_limit = _KEY2X(lifetime->sadb_lifetime_bytes); | 1118 | x->lft.soft_byte_limit = _KEY2X(lifetime->sadb_lifetime_bytes); |
@@ -1120,7 +1120,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net, | |||
1120 | x->lft.soft_use_expires_seconds = lifetime->sadb_lifetime_usetime; | 1120 | x->lft.soft_use_expires_seconds = lifetime->sadb_lifetime_usetime; |
1121 | } | 1121 | } |
1122 | 1122 | ||
1123 | sec_ctx = (const struct sadb_x_sec_ctx *) ext_hdrs[SADB_X_EXT_SEC_CTX-1]; | 1123 | sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1]; |
1124 | if (sec_ctx != NULL) { | 1124 | if (sec_ctx != NULL) { |
1125 | struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); | 1125 | struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); |
1126 | 1126 | ||
@@ -1134,7 +1134,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net, | |||
1134 | goto out; | 1134 | goto out; |
1135 | } | 1135 | } |
1136 | 1136 | ||
1137 | key = (const struct sadb_key*) ext_hdrs[SADB_EXT_KEY_AUTH-1]; | 1137 | key = ext_hdrs[SADB_EXT_KEY_AUTH - 1]; |
1138 | if (sa->sadb_sa_auth) { | 1138 | if (sa->sadb_sa_auth) { |
1139 | int keysize = 0; | 1139 | int keysize = 0; |
1140 | struct xfrm_algo_desc *a = xfrm_aalg_get_byid(sa->sadb_sa_auth); | 1140 | struct xfrm_algo_desc *a = xfrm_aalg_get_byid(sa->sadb_sa_auth); |
@@ -2219,7 +2219,7 @@ static int pfkey_spdadd(struct sock *sk, struct sk_buff *skb, const struct sadb_ | |||
2219 | if (xp->selector.dport) | 2219 | if (xp->selector.dport) |
2220 | xp->selector.dport_mask = htons(0xffff); | 2220 | xp->selector.dport_mask = htons(0xffff); |
2221 | 2221 | ||
2222 | sec_ctx = (struct sadb_x_sec_ctx *) ext_hdrs[SADB_X_EXT_SEC_CTX-1]; | 2222 | sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1]; |
2223 | if (sec_ctx != NULL) { | 2223 | if (sec_ctx != NULL) { |
2224 | struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); | 2224 | struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); |
2225 | 2225 | ||
@@ -2323,7 +2323,7 @@ static int pfkey_spddelete(struct sock *sk, struct sk_buff *skb, const struct sa | |||
2323 | if (sel.dport) | 2323 | if (sel.dport) |
2324 | sel.dport_mask = htons(0xffff); | 2324 | sel.dport_mask = htons(0xffff); |
2325 | 2325 | ||
2326 | sec_ctx = (struct sadb_x_sec_ctx *) ext_hdrs[SADB_X_EXT_SEC_CTX-1]; | 2326 | sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1]; |
2327 | if (sec_ctx != NULL) { | 2327 | if (sec_ctx != NULL) { |
2328 | struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); | 2328 | struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); |
2329 | 2329 | ||