Commit 3e72b2fe5b31791f976350b023b7a37ef59c02c1

Authored by Patrick McHardy
Committed by David S. Miller
1 parent 73654d61e5

[NETFILTER]: x_tables: remove some unnecessary casts

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 6 changed files with 6 additions and 9 deletions Side-by-side Diff

net/ipv4/netfilter/ipt_hashlimit.c
... ... @@ -561,7 +561,7 @@
561 561 hashlimit_destroy(const struct xt_match *match, void *matchinfo,
562 562 unsigned int matchsize)
563 563 {
564   - struct ipt_hashlimit_info *r = (struct ipt_hashlimit_info *) matchinfo;
  564 + struct ipt_hashlimit_info *r = matchinfo;
565 565  
566 566 htable_put(r->hinfo);
567 567 }
net/netfilter/xt_connmark.c
... ... @@ -58,7 +58,7 @@
58 58 unsigned int matchsize,
59 59 unsigned int hook_mask)
60 60 {
61   - struct xt_connmark_info *cm = (struct xt_connmark_info *)matchinfo;
  61 + struct xt_connmark_info *cm = matchinfo;
62 62  
63 63 if (cm->mark > 0xffffffff || cm->mask > 0xffffffff) {
64 64 printk(KERN_WARNING "connmark: only support 32bit mark\n");
net/netfilter/xt_dccp.c
... ... @@ -101,8 +101,7 @@
101 101 unsigned int protoff,
102 102 int *hotdrop)
103 103 {
104   - const struct xt_dccp_info *info =
105   - (const struct xt_dccp_info *)matchinfo;
  104 + const struct xt_dccp_info *info = matchinfo;
106 105 struct dccp_hdr _dh, *dh;
107 106  
108 107 if (offset)
net/netfilter/xt_mark.c
... ... @@ -42,7 +42,7 @@
42 42 unsigned int matchsize,
43 43 unsigned int hook_mask)
44 44 {
45   - struct xt_mark_info *minfo = (struct xt_mark_info *) matchinfo;
  45 + const struct xt_mark_info *minfo = matchinfo;
46 46  
47 47 if (minfo->mark > 0xffffffff || minfo->mask > 0xffffffff) {
48 48 printk(KERN_WARNING "mark: only supports 32bit mark\n");
net/netfilter/xt_sctp.c
... ... @@ -129,10 +129,8 @@
129 129 unsigned int protoff,
130 130 int *hotdrop)
131 131 {
132   - const struct xt_sctp_info *info;
  132 + const struct xt_sctp_info *info = matchinfo;
133 133 sctp_sctphdr_t _sh, *sh;
134   -
135   - info = (const struct xt_sctp_info *)matchinfo;
136 134  
137 135 if (offset) {
138 136 duprintf("Dropping non-first fragment.. FIXME\n");
net/netfilter/xt_string.c
... ... @@ -30,8 +30,8 @@
30 30 unsigned int protoff,
31 31 int *hotdrop)
32 32 {
  33 + const struct xt_string_info *conf = matchinfo;
33 34 struct ts_state state;
34   - struct xt_string_info *conf = (struct xt_string_info *) matchinfo;
35 35  
36 36 memset(&state, 0, sizeof(struct ts_state));
37 37