Remove dead code 64/195464/1
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 13 Dec 2018 19:49:50 +0000 (22:49 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 13 Dec 2018 19:55:40 +0000 (22:55 +0300)
Fields the copy and the cleanup in probe_iface structure already do not
used. Therefore, remove them from all source code.

Change-Id: Iaa72ddf5bfb999fc07292cf7505ec07320c4380d
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
modules/fbiprobe/fbiprobe.c
modules/preload/preload_probe.c
modules/retprobe/retprobe.c
modules/us_manager/probes/probe_info_new.c
modules/us_manager/probes/register_probes.h

index fc07fba171e7a07a41795729d30d9ca5f7846992..c0ce9233905e79f016d24f8d7b80e997050307cf 100644 (file)
@@ -288,24 +288,6 @@ static int fbi_probe_handler(struct uprobe *p, struct pt_regs *regs)
 }
 
 /* FBI probe interfaces */
-void fbi_probe_cleanup(struct probe_info *probe_i)
-{
-       uint8_t i;
-       struct fbi_info *fbi_i = &(probe_i->fbi_i);
-
-       for (i = 0; i != fbi_i->var_count; i++) {
-               if (fbi_i->vars[i].steps != NULL) {
-                       if (fbi_i->vars[i].steps != NULL)
-                               kfree(fbi_i->vars[i].steps);
-                       fbi_i->vars[i].steps = NULL;
-                       fbi_i->vars[i].steps_count = 0;
-               }
-       }
-
-       kfree(fbi_i->vars);
-       fbi_i->vars = NULL;
-}
-
 void fbi_probe_init(struct sspt_ip *ip)
 {
        ip->uprobe.pre_handler = (uprobe_pre_handler_t)fbi_probe_handler;
@@ -330,56 +312,6 @@ static struct uprobe *fbi_probe_get_uprobe(struct sspt_ip *ip)
        return &ip->uprobe;
 }
 
-int fbi_probe_copy(struct probe_info *dest, const struct probe_info *source)
-{
-       uint8_t steps_count;
-       size_t steps_size;
-       size_t vars_size;
-       struct fbi_var_data *vars;
-       struct fbi_step *steps_source;
-       struct fbi_step *steps_dest = NULL;
-       uint8_t i, n;
-       int ret = 0;
-
-       memcpy(dest, source, sizeof(*source));
-
-       vars_size = source->fbi_i.var_count * sizeof(*source->fbi_i.vars);
-       vars = kmalloc(vars_size, GFP_KERNEL);
-       if (vars == NULL)
-               return -ENOMEM;
-
-       memcpy(vars, source->fbi_i.vars, vars_size);
-
-       for (i = 0; i != source->fbi_i.var_count; i++) {
-               steps_dest = NULL;
-               steps_count = vars[i].steps_count;
-               steps_size = sizeof(*steps_source) * steps_count;
-               steps_source = vars[i].steps;
-
-               if (steps_size != 0 && steps_source != NULL) {
-                       steps_dest = kmalloc(steps_size, GFP_KERNEL);
-                       if (steps_dest == NULL) {
-                               print_err("can not alloc data\n");
-                               n = i;
-                               ret = -ENOMEM;
-                               goto err;
-                       }
-
-                       memcpy(steps_dest, steps_source, steps_size);
-               }
-               vars[i].steps = steps_dest;
-       }
-
-       dest->fbi_i.vars = vars;
-
-       return ret;
-err:
-       for (i = 0; i < n; i++)
-               kfree(vars[i].steps);
-       kfree(vars);
-       return ret;
-}
-
 /* Register */
 static struct probe_iface fbi_probe_iface = {
        .init = fbi_probe_init,
@@ -387,8 +319,6 @@ static struct probe_iface fbi_probe_iface = {
        .reg = fbi_probe_register_probe,
        .unreg = fbi_probe_unregister_probe,
        .get_uprobe = fbi_probe_get_uprobe,
-       .copy = fbi_probe_copy,
-       .cleanup = fbi_probe_cleanup
 };
 
 static int fbiprobe_init(void)
index 3db3fd013db001c480a621f3dce5cc56047caf8c..b5bf76797e028b352bc97bc9cef273c3b68fa327 100644 (file)
 #include "preload.h"
 #include "preload_module.h"
 
-static int preload_info_copy(struct probe_info *dest,
-                             const struct probe_info *source)
-{
-       memcpy(dest, source, sizeof(*source));
-
-       return 0;
-}
-
-static void preload_info_cleanup(struct probe_info *probe_i)
-{
-}
 
 static struct uprobe *preload_get_uprobe(struct sspt_ip *ip)
 {
@@ -69,8 +58,6 @@ static void preload_init(struct sspt_ip *ip)
 static void preload_uninit(struct sspt_ip *ip)
 {
        pm_uprobe_exit(ip);
-
-       preload_info_cleanup(&ip->desc->info);
 }
 
 static struct probe_iface preload_iface = {
@@ -79,22 +66,8 @@ static struct probe_iface preload_iface = {
        .reg = preload_register_probe,
        .unreg = preload_unregister_probe,
        .get_uprobe = preload_get_uprobe,
-       .copy = preload_info_copy,
-       .cleanup = preload_info_cleanup
 };
 
-static int get_caller_info_copy(struct probe_info *dest,
-                               const struct probe_info *source)
-{
-       memcpy(dest, source, sizeof(*source));
-
-       return 0;
-}
-
-static void get_caller_info_cleanup(struct probe_info *probe_i)
-{
-}
-
 static struct uprobe *get_caller_get_uprobe(struct sspt_ip *ip)
 {
        return &ip->uprobe;
@@ -118,8 +91,6 @@ static void get_caller_init(struct sspt_ip *ip)
 static void get_caller_uninit(struct sspt_ip *ip)
 {
        pm_get_caller_exit(ip);
-
-       get_caller_info_cleanup(&ip->desc->info);
 }
 
 static struct probe_iface get_caller_iface = {
@@ -128,8 +99,6 @@ static struct probe_iface get_caller_iface = {
        .reg = get_caller_register_probe,
        .unreg = get_caller_unregister_probe,
        .get_uprobe = get_caller_get_uprobe,
-       .copy = get_caller_info_copy,
-       .cleanup = get_caller_info_cleanup
 };
 
 static void get_call_type_init(struct sspt_ip *ip)
@@ -140,8 +109,6 @@ static void get_call_type_init(struct sspt_ip *ip)
 static void get_call_type_uninit(struct sspt_ip *ip)
 {
        pm_get_call_type_exit(ip);
-
-       get_caller_info_cleanup(&ip->desc->info);
 }
 
 static struct probe_iface get_call_type_iface = {
@@ -150,8 +117,6 @@ static struct probe_iface get_call_type_iface = {
        .reg = get_caller_register_probe,
        .unreg = get_caller_unregister_probe,
        .get_uprobe = get_caller_get_uprobe,
-       .copy = get_caller_info_copy,
-       .cleanup = get_caller_info_cleanup
 };
 
 static void write_msg_init(struct sspt_ip *ip)
@@ -167,8 +132,6 @@ static int write_msg_reg(struct sspt_ip *ip)
 static void write_msg_uninit(struct sspt_ip *ip)
 {
        pm_write_msg_exit(ip);
-
-       get_caller_info_cleanup(&ip->desc->info);
 }
 
 static struct probe_iface write_msg_iface = {
@@ -177,8 +140,6 @@ static struct probe_iface write_msg_iface = {
        .reg = write_msg_reg,
        .unreg = get_caller_unregister_probe,
        .get_uprobe = get_caller_get_uprobe,
-       .copy = get_caller_info_copy,
-       .cleanup = get_caller_info_cleanup
 };
 
 int register_preload_probes(void)
index bbefdc4b1c73fadd6c4164eac03783cffcda620d..990c764082990b949f9bb69ba168c0b4a434bda8 100644 (file)
 #include "rp_msg.h"
 
 
-static int retprobe_copy(struct probe_info *dest,
-                        const struct probe_info *source)
-{
-       size_t len;
-
-       memcpy(dest, source, sizeof(*source));
-
-       len = strlen(source->rp_i.args) + 1;
-       dest->rp_i.args = kmalloc(len, GFP_ATOMIC);
-       if (dest->rp_i.args == NULL)
-               return -ENOMEM;
-       memcpy(dest->rp_i.args, source->rp_i.args, len);
-
-       return 0;
-}
-
-
-static void retprobe_cleanup(struct probe_info *probe_i)
-{
-       kfree(probe_i->rp_i.args);
-}
-
-
-
 static struct uprobe *retprobe_get_uprobe(struct sspt_ip *ip)
 {
        return &ip->retprobe.up;
@@ -122,8 +98,6 @@ static struct probe_iface retprobe_iface = {
        .reg = retprobe_register_probe,
        .unreg = retprobe_unregister_probe,
        .get_uprobe = retprobe_get_uprobe,
-       .copy = retprobe_copy,
-       .cleanup = retprobe_cleanup
 };
 
 static int mod_init(void)
index 303f3321b0cd69baa8cef13b084c7f699abb235c..801acddc9d29dadb5cee2caaa250e14ce76e8516 100644 (file)
@@ -112,15 +112,6 @@ EXPORT_SYMBOL_GPL(pin_unregister);
 /*
  * SWAP_NEW_UP
  */
-static int up_copy(struct probe_info *dst, const struct probe_info *src)
-{
-       return 0;
-}
-
-static void up_cleanup(struct probe_info *probe_i)
-{
-}
-
 static struct uprobe *up_get_uprobe(struct sspt_ip *ip)
 {
        return &ip->uprobe;
@@ -151,8 +142,6 @@ static struct probe_iface up_iface = {
        .reg = up_register_probe,
        .unreg = up_unregister_probe,
        .get_uprobe = up_get_uprobe,
-       .copy = up_copy,
-       .cleanup = up_cleanup
 };
 
 
@@ -162,15 +151,6 @@ static struct probe_iface up_iface = {
 /*
  * SWAP_NEW_URP
  */
-static int urp_copy(struct probe_info *dst, const struct probe_info *src)
-{
-       return 0;
-}
-
-static void urp_cleanup(struct probe_info *probe_i)
-{
-}
-
 static struct uprobe *urp_get_uprobe(struct sspt_ip *ip)
 {
        return &ip->retprobe.up;
@@ -213,8 +193,6 @@ static struct probe_iface urp_iface = {
        .reg = urp_register_probe,
        .unreg = urp_unregister_probe,
        .get_uprobe = urp_get_uprobe,
-       .copy = urp_copy,
-       .cleanup = urp_cleanup
 };
 
 
index f98105664f030bf05dac8937849b1d5081860ffd..f07bd04b5590c0d1ad4139b6b045291fe1dfb73b 100644 (file)
@@ -11,8 +11,6 @@ struct probe_iface {
        int (*reg)(struct sspt_ip *);
        void (*unreg)(struct sspt_ip *, int);
        struct uprobe *(*get_uprobe)(struct sspt_ip *);
-       int (*copy)(struct probe_info *, const struct probe_info *);
-       void (*cleanup)(struct probe_info *);
 };
 
 int swap_register_probe_type(enum probe_t probe_type, struct probe_iface *pi);