Permalink
Browse files

MFC r256470:

Update krping to the latest upstream code.  Move all the FreeBSD
specific parts to krping_dev.c, which leaves the other files as
close to their upstream versions as possible.

Approved by:	re (glebius)
  • Loading branch information...
1 parent 82b4688 commit 71c5e06cccd7a1b993d32b76a3f872129a5c7c8f np committed Oct 21, 2013
Showing with 1,173 additions and 708 deletions.
  1. +9 −8 sys/contrib/rdma/krping/getopt.c
  2. +1,057 −532 sys/contrib/rdma/krping/krping.c
  3. +12 −124 sys/contrib/rdma/krping/krping.h
  4. +95 −44 sys/contrib/rdma/krping/krping_dev.c
@@ -5,9 +5,10 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/ctype.h>
-#include <sys/param.h>
-#include <sys/libkern.h>
+#include <sys/types.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+
#include "getopt.h"
/**
@@ -49,29 +50,29 @@ int krping_getopt(const char *caller, char **options,
if (opts->has_arg & OPT_NOPARAM) {
return opts->val;
}
- printf("%s: the %s option requires "
+ printk(KERN_INFO "%s: the %s option requires "
"an argument\n", caller, token);
return -EINVAL;
}
if (opts->has_arg & OPT_INT) {
char* v;
- *value = strtoul(val, &v, 0);
+ *value = simple_strtoul(val, &v, 0);
if (!*v) {
return opts->val;
}
- printf("%s: invalid numeric value "
+ printk(KERN_INFO "%s: invalid numeric value "
"in %s=%s\n", caller, token, val);
return -EDOM;
}
if (opts->has_arg & OPT_STRING) {
return opts->val;
}
- printf("%s: unexpected argument %s to the "
+ printk(KERN_INFO "%s: unexpected argument %s to the "
"%s option\n", caller, val, token);
return -EINVAL;
}
}
- printf("%s: Unrecognized option %s\n", caller, token);
+ printk(KERN_INFO "%s: Unrecognized option %s\n", caller, token);
return -EOPNOTSUPP;
}
Oops, something went wrong.

0 comments on commit 71c5e06

Please sign in to comment.