diff options
author | Andreas Gruenbacher <agruen@linbit.com> | 2011-05-03 08:56:09 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-08 10:55:38 -0500 |
commit | b966b5dd8e17e6c105ca55533fd412de5d5b429e (patch) | |
tree | 5597a93a0753ccd2476f4ba9ff31de5eeb09d83c /include/linux/genl_magic_func.h | |
parent | d8cd289dbe69ce9b8115d6f200ceff657e5dafa0 (diff) |
drbd: Generate the drbd_set_*_defaults() functions from drbd_genl.h
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'include/linux/genl_magic_func.h')
-rw-r--r-- | include/linux/genl_magic_func.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/genl_magic_func.h b/include/linux/genl_magic_func.h index e458282a3728..e908f1c50355 100644 --- a/include/linux/genl_magic_func.h +++ b/include/linux/genl_magic_func.h | |||
@@ -427,6 +427,32 @@ static inline int s_name ## _to_unpriv_skb(struct sk_buff *skb, \ | |||
427 | 427 | ||
428 | #include GENL_MAGIC_INCLUDE_FILE | 428 | #include GENL_MAGIC_INCLUDE_FILE |
429 | 429 | ||
430 | |||
431 | /* Functions for initializing structs to default values. */ | ||
432 | |||
433 | #undef __field | ||
434 | #define __field(attr_nr, attr_flag, name, nla_type, type, __get, __put) | ||
435 | #undef __array | ||
436 | #define __array(attr_nr, attr_flag, name, nla_type, type, maxlen, __get, __put) | ||
437 | #undef __u32_field_def | ||
438 | #define __u32_field_def(attr_nr, attr_flag, name, default) \ | ||
439 | x->name = default; | ||
440 | #undef __flg_field_def | ||
441 | #define __flg_field_def(attr_nr, attr_flag, name, default) \ | ||
442 | x->name = default; | ||
443 | #undef __str_field_def | ||
444 | #define __str_field_def(attr_nr, attr_flag, name, maxlen) \ | ||
445 | memset(x->name, 0, sizeof(x->name)); \ | ||
446 | x->name ## _len = 0; | ||
447 | #undef GENL_struct | ||
448 | #define GENL_struct(tag_name, tag_number, s_name, s_fields) \ | ||
449 | static void set_ ## s_name ## _defaults(struct s_name *x) __attribute__((unused)); \ | ||
450 | static void set_ ## s_name ## _defaults(struct s_name *x) { \ | ||
451 | s_fields \ | ||
452 | } | ||
453 | |||
454 | #include GENL_MAGIC_INCLUDE_FILE | ||
455 | |||
430 | #endif /* __KERNEL__ */ | 456 | #endif /* __KERNEL__ */ |
431 | 457 | ||
432 | /* }}}1 */ | 458 | /* }}}1 */ |