sdhci-pltfm: implement platform data passing
[safe/jmp/linux-2.6] / net / sched / em_text.c
index 873840d..7632532 100644 (file)
@@ -9,11 +9,10 @@
  * Authors:    Thomas Graf <tgraf@suug.ch>
  */
 
-#include <linux/config.h>
+#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
-#include <linux/sched.h>
 #include <linux/string.h>
 #include <linux/skbuff.h>
 #include <linux/textsearch.h>
@@ -55,9 +54,6 @@ static int em_text_change(struct tcf_proto *tp, void *data, int len,
        struct ts_config *ts_conf;
        int flags = 0;
 
-       printk("Configuring text: %s from %d:%d to %d:%d len %d\n", conf->algo, conf->from_offset,
-           conf->from_layer, conf->to_offset, conf->to_layer, conf->pattern_len);
-
        if (len < sizeof(*conf) || len < (sizeof(*conf) + conf->pattern_len))
                return -EINVAL;
 
@@ -123,13 +119,16 @@ static int em_text_dump(struct sk_buff *skb, struct tcf_ematch *m)
        conf.pattern_len = textsearch_get_pattern_len(tm->config);
        conf.pad = 0;
 
-       RTA_PUT_NOHDR(skb, sizeof(conf), &conf);
-       RTA_APPEND(skb, conf.pattern_len, textsearch_get_pattern(tm->config));
+       if (nla_put_nohdr(skb, sizeof(conf), &conf) < 0)
+               goto nla_put_failure;
+       if (nla_append(skb, conf.pattern_len,
+                      textsearch_get_pattern(tm->config)) < 0)
+               goto nla_put_failure;
        return 0;
 
-rtattr_failure:
+nla_put_failure:
        return -1;
-}              
+}
 
 static struct tcf_ematch_ops em_text_ops = {
        .kind     = TCF_EM_TEXT,
@@ -146,7 +145,7 @@ static int __init init_em_text(void)
        return tcf_em_register(&em_text_ops);
 }
 
-static void __exit exit_em_text(void) 
+static void __exit exit_em_text(void)
 {
        tcf_em_unregister(&em_text_ops);
 }
@@ -155,3 +154,5 @@ MODULE_LICENSE("GPL");
 
 module_init(init_em_text);
 module_exit(exit_em_text);
+
+MODULE_ALIAS_TCF_EMATCH(TCF_EM_TEXT);