parser: remove unused code 46/170146/2
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Mon, 12 Feb 2018 11:21:06 +0000 (14:21 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Wed, 14 Feb 2018 10:57:21 +0000 (13:57 +0300)
Change-Id: I6b8125dee4746aeff3fcdee20c1e696c178330af
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
modules/parser/Kbuild
modules/parser/cpu_ctrl.c [deleted file]
modules/parser/cpu_ctrl.h [deleted file]
modules/parser/swap_msg_parser.c

index 7faf7ba8c7add893240cee464d03aed1a3fda327..c49238bb5ca81eec2fd68028ffd90cf18bfba784 100644 (file)
@@ -13,5 +13,4 @@ swap_message_parser-y := swap_msg_parser.o \
                          msg_cmd.o \
                          features.o \
                          us_inst.o \
-                         cpu_ctrl.o \
                          usm_msg.o
diff --git a/modules/parser/cpu_ctrl.c b/modules/parser/cpu_ctrl.c
deleted file mode 100644 (file)
index f5498b9..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/**
- * parser/cpu_ctrl.c
- * @author Vasiliy Ulyanov <v.ulyanov@samsung.com>
- *
- * @section LICENSE
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * @section COPYRIGHT
- *
- * Copyright (C) Samsung Electronics, 2014
- *
- * @section DESCRIPTION
- *
- * CPU controls implementation.
- */
-
-#include <linux/cpumask.h>
-#include <linux/cpu.h>
-#include <ksyms/ksyms.h>
-
-#ifdef CONFIG_SMP
-static void (*swap_cpu_maps_update_begin)(void);
-static void (*swap_cpu_maps_update_done)(void);
-static int (*swap_cpu_down)(unsigned int, int);
-static int (*swap_cpu_up)(unsigned int, int);
-
-/**
- * @brief Disables nonboot CPUs lock.
- *
- * @param mask Pointer to CPU mask struct.
- * @return 0 on success, error code on error.
- */
-int swap_disable_nonboot_cpus_lock(struct cpumask *mask)
-{
-       int boot_cpu, cpu;
-       int ret = 0;
-
-       swap_cpu_maps_update_begin();
-       cpumask_clear(mask);
-
-       boot_cpu = cpumask_first(cpu_online_mask);
-
-       for_each_online_cpu(cpu) {
-               if (cpu == boot_cpu)
-                       continue;
-               ret = swap_cpu_down(cpu, 0);
-               if (ret == 0)
-                       cpumask_set_cpu(cpu, mask);
-               printk(KERN_INFO "===> SWAP CPU[%d] down(%d)\n", cpu, ret);
-       }
-
-       WARN_ON(num_online_cpus() > 1);
-       return ret;
-}
-
-/**
- * @brief Enables nonboot CPUs unlock.
- *
- * @param mask Pointer to CPU mask struct.
- * @return 0 on success, error code on error.
- */
-int swap_enable_nonboot_cpus_unlock(struct cpumask *mask)
-{
-       int cpu, ret = 0;
-
-       if (cpumask_empty(mask))
-               goto out;
-
-       for_each_cpu(cpu, mask) {
-               ret = swap_cpu_up(cpu, 0);
-               printk(KERN_INFO "===> SWAP CPU[%d] up(%d)\n", cpu, ret);
-       }
-
-out:
-       swap_cpu_maps_update_done();
-
-       return ret;
-}
-
-/**
- * @brief Intializes CPU controls.
- *
- * @return 0 on success, error code on error.
- */
-int init_cpu_deps(void)
-{
-       const char *sym = "cpu_maps_update_begin";
-
-       swap_cpu_maps_update_begin = (void *)swap_ksyms(sym);
-       if (!swap_cpu_maps_update_begin)
-               goto not_found;
-
-       sym = "cpu_maps_update_done";
-       swap_cpu_maps_update_done = (void *)swap_ksyms(sym);
-       if (!swap_cpu_maps_update_done)
-               goto not_found;
-
-       sym = "_cpu_up";
-       swap_cpu_up = (void *)swap_ksyms(sym);
-       if (!swap_cpu_up)
-               goto not_found;
-
-       sym = "_cpu_down";
-       swap_cpu_down = (void *)swap_ksyms(sym);
-       if (!swap_cpu_down)
-               goto not_found;
-
-       return 0;
-
-not_found:
-       printk(KERN_INFO "ERROR: symbol %s(...) not found\n", sym);
-       return -ESRCH;
-}
-
-#endif /* CONFIG_SMP */
diff --git a/modules/parser/cpu_ctrl.h b/modules/parser/cpu_ctrl.h
deleted file mode 100644 (file)
index 36d3ed1..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * @file parser/cpu_ctrl.h
- * @author Vasiliy Ulyanov <v.ulyanov@samsung.com>
- *
- * @section LICENSE
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * @section COPYRIGHT
- *
- * Copyright (C) Samsung Electronics, 2014
- *
- * @section DESCRIPTION
- *
- * CPU controls interface.
- */
-
-#ifndef _CPU_CTRL_H_
-#define _CPU_CTRL_H_
-
-struct cpumask;
-
-#ifdef CONFIG_SMP
-int swap_disable_nonboot_cpus_lock(struct cpumask *mask);
-int swap_enable_nonboot_cpus_unlock(struct cpumask *mask);
-
-int init_cpu_deps(void);
-
-#else /* CONFIG_SMP */
-
-static inline int swap_disable_nonboot_cpus_lock(struct cpumask *mask)
-{
-       return 0;
-}
-
-static inline int swap_enable_nonboot_cpus_unlock(struct cpumask *mask)
-{
-       return 0;
-}
-
-static inline int init_cpu_deps(void)
-{
-       return 0;
-}
-
-#endif /* CONFIG_SMP */
-
-#endif /* _CPU_CTRL_H_ */
index 0049e849fdbf3acbf58b11f8ad5c239ef22d7adb..eb1abe8a0fb73267d1e8821fce0c49cb8bd37c30 100644 (file)
@@ -39,7 +39,6 @@
 #include "msg_buf.h"
 #include "msg_cmd.h"
 #include "usm_msg.h"
-#include "cpu_ctrl.h"
 #include "features.h"
 
 #include <driver/driver_to_msg.h>
@@ -171,15 +170,7 @@ static void unreg_msg_handler(void)
 
 static int once(void)
 {
-       int ret;
-
-       ret = once_cmd();
-       if (ret)
-               return ret;
-
-       ret = init_cpu_deps();
-
-       return ret;
+       return once_cmd();
 }
 
 SWAP_LIGHT_INIT_MODULE(once, reg_msg_handler, unreg_msg_handler, NULL, NULL);