diff options
| author | Bojan Prtvar <prtvar.b@gmail.com> | 2015-02-22 05:46:35 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2015-02-22 15:59:54 -0500 |
| commit | 059a2440fd3cf4ec57735db2c0a90401cde84fca (patch) | |
| tree | ae1cc62a03192b53b6d4c1eb14b50d534b385797 /net/core | |
| parent | d340c862e760815bca2f2a4d8fd91dff4646a955 (diff) | |
net: Remove state argument from skb_find_text()
Although it is clear that textsearch state is intentionally passed to
skb_find_text() as uninitialized argument, it was never used by the
callers. Therefore, we can simplify skb_find_text() by making it
local variable.
Signed-off-by: Bojan Prtvar <prtvar.b@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
| -rw-r--r-- | net/core/skbuff.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 88c613eab142..374e43bc6b80 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
| @@ -2865,7 +2865,6 @@ static void skb_ts_finish(struct ts_config *conf, struct ts_state *state) | |||
| 2865 | * @from: search offset | 2865 | * @from: search offset |
| 2866 | * @to: search limit | 2866 | * @to: search limit |
| 2867 | * @config: textsearch configuration | 2867 | * @config: textsearch configuration |
| 2868 | * @state: uninitialized textsearch state variable | ||
| 2869 | * | 2868 | * |
| 2870 | * Finds a pattern in the skb data according to the specified | 2869 | * Finds a pattern in the skb data according to the specified |
| 2871 | * textsearch configuration. Use textsearch_next() to retrieve | 2870 | * textsearch configuration. Use textsearch_next() to retrieve |
| @@ -2873,17 +2872,17 @@ static void skb_ts_finish(struct ts_config *conf, struct ts_state *state) | |||
| 2873 | * to the first occurrence or UINT_MAX if no match was found. | 2872 | * to the first occurrence or UINT_MAX if no match was found. |
| 2874 | */ | 2873 | */ |
| 2875 | unsigned int skb_find_text(struct sk_buff *skb, unsigned int from, | 2874 | unsigned int skb_find_text(struct sk_buff *skb, unsigned int from, |
| 2876 | unsigned int to, struct ts_config *config, | 2875 | unsigned int to, struct ts_config *config) |
| 2877 | struct ts_state *state) | ||
| 2878 | { | 2876 | { |
| 2877 | struct ts_state state; | ||
| 2879 | unsigned int ret; | 2878 | unsigned int ret; |
| 2880 | 2879 | ||
| 2881 | config->get_next_block = skb_ts_get_next_block; | 2880 | config->get_next_block = skb_ts_get_next_block; |
| 2882 | config->finish = skb_ts_finish; | 2881 | config->finish = skb_ts_finish; |
| 2883 | 2882 | ||
| 2884 | skb_prepare_seq_read(skb, from, to, TS_SKB_CB(state)); | 2883 | skb_prepare_seq_read(skb, from, to, TS_SKB_CB(&state)); |
| 2885 | 2884 | ||
| 2886 | ret = textsearch_find(config, state); | 2885 | ret = textsearch_find(config, &state); |
| 2887 | return (ret <= to - from ? ret : UINT_MAX); | 2886 | return (ret <= to - from ? ret : UINT_MAX); |
| 2888 | } | 2887 | } |
| 2889 | EXPORT_SYMBOL(skb_find_text); | 2888 | EXPORT_SYMBOL(skb_find_text); |
