From 2ee5cf55f327d41d770ec3a973182be6171f3e51 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 24 Nov 2014 17:14:55 +0100 Subject: [PATCH] idiag: remove clone functions from trivial structures A oo_clone() function is only needed for complex sturctures to deep copy an object. Acked-by: Thomas Graf Signed-off-by: Thomas Haller --- lib/idiag/idiag_meminfo_obj.c | 11 ----------- lib/idiag/idiag_vegasinfo_obj.c | 12 ------------ 2 files changed, 23 deletions(-) diff --git a/lib/idiag/idiag_meminfo_obj.c b/lib/idiag/idiag_meminfo_obj.c index a60f497..7a044f4 100644 --- a/lib/idiag/idiag_meminfo_obj.c +++ b/lib/idiag/idiag_meminfo_obj.c @@ -80,21 +80,10 @@ void idiagnl_meminfo_set_tmem(struct idiagnl_meminfo *minfo, uint32_t tmem) } /** @} */ -static int idiagnl_meminfo_clone(struct nl_object *_dst, struct nl_object *_src) -{ - struct idiagnl_meminfo *dst = (struct idiagnl_meminfo *) _dst; - struct idiagnl_meminfo *src = (struct idiagnl_meminfo *) _src; - - memcpy(dst, src, sizeof(struct idiagnl_meminfo)); - - return 0; -} - /** @cond SKIP */ struct nl_object_ops idiagnl_meminfo_obj_ops = { .oo_name = "idiag/idiag_meminfo", .oo_size = sizeof(struct idiagnl_meminfo), - .oo_clone = idiagnl_meminfo_clone, }; /** @endcond */ /** @} */ diff --git a/lib/idiag/idiag_vegasinfo_obj.c b/lib/idiag/idiag_vegasinfo_obj.c index 5279e83..ffeb357 100644 --- a/lib/idiag/idiag_vegasinfo_obj.c +++ b/lib/idiag/idiag_vegasinfo_obj.c @@ -83,22 +83,10 @@ void idiagnl_vegasinfo_set_minrtt(struct idiagnl_vegasinfo *vinfo, uint32_t } /** @} */ -static int idiagnl_vegasinfo_clone(struct nl_object *_dst, - struct nl_object *_src) -{ - struct idiagnl_vegasinfo *dst = (struct idiagnl_vegasinfo *) _dst; - struct idiagnl_vegasinfo *src = (struct idiagnl_vegasinfo *) _src; - - memcpy(dst, src, sizeof(struct idiagnl_vegasinfo)); - - return 0; -} - /** @cond SKIP */ struct nl_object_ops idiagnl_vegasinfo_obj_ops = { .oo_name = "idiag/idiag_vegasinfo", .oo_size = sizeof(struct idiagnl_vegasinfo), - .oo_clone = idiagnl_vegasinfo_clone, }; /** @endcond */ /** @} */ -- 2.40.0