[PATCH 11/13] idiag: remove clone functions from trivial structures

Thomas Haller thaller at redhat.com
Mon Nov 24 08:14:55 PST 2014


A oo_clone() function is only needed for complex sturctures
to deep copy an object.

Signed-off-by: Thomas Haller <thaller at redhat.com>
---
 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 */
 /** @} */
-- 
1.9.3




More information about the libnl mailing list