aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Cochran <rcochran@linutronix.de>2016-05-19 20:09:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-05-19 22:12:14 -0400
commit815613da6a67c196d7458d0e6c278ea88e21933f (patch)
tree5d1fcca8c5b89e7cdd43b72c3f4d3d63c321de10
parent8f9b1802c20ace68a7d6603e1fd82a44fedb4078 (diff)
kernel/padata.c: removed unused code
By accident I stumbled across code that has never been used. This driver has EXPORT_SYMBOL functions, and the only user of the code is pcrypt.c, but this only uses a subset of the exported symbols. According to 'git log -G', the functions, padata_set_cpumasks, padata_add_cpu, and padata_remove_cpu have never been used since they were first introduced. This patch removes the unused code. On one 64 bit build, with CRYPTO_PCRYPT built in, the text is more than 4k smaller. kbuild_hp> size $KBUILD_OUTPUT/vmlinux text data bss dec hex filename 10566658 4678360 1122304 16367322 f9beda vmlinux 10561984 4678360 1122304 16362648 f9ac98 vmlinux On another config, 32 bit, the saving is about 0.5k bytes. kbuild_hp-x86> size $KBUILD_OUTPUT/vmlinux 6012005 2409513 2785280 11206798 ab008e vmlinux 6011491 2409513 2785280 11206284 aafe8c vmlinux Signed-off-by: Richard Cochran <rcochran@linutronix.de> Cc: Steffen Klassert <steffen.klassert@secunet.com> Cc: Herbert Xu <herbert@gondor.apana.org.au> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/padata.h5
-rw-r--r--kernel/padata.c64
2 files changed, 0 insertions, 69 deletions
diff --git a/include/linux/padata.h b/include/linux/padata.h
index 438694650471..113ee626a4dc 100644
--- a/include/linux/padata.h
+++ b/include/linux/padata.h
@@ -175,11 +175,6 @@ extern int padata_do_parallel(struct padata_instance *pinst,
175extern void padata_do_serial(struct padata_priv *padata); 175extern void padata_do_serial(struct padata_priv *padata);
176extern int padata_set_cpumask(struct padata_instance *pinst, int cpumask_type, 176extern int padata_set_cpumask(struct padata_instance *pinst, int cpumask_type,
177 cpumask_var_t cpumask); 177 cpumask_var_t cpumask);
178extern int padata_set_cpumasks(struct padata_instance *pinst,
179 cpumask_var_t pcpumask,
180 cpumask_var_t cbcpumask);
181extern int padata_add_cpu(struct padata_instance *pinst, int cpu, int mask);
182extern int padata_remove_cpu(struct padata_instance *pinst, int cpu, int mask);
183extern int padata_start(struct padata_instance *pinst); 178extern int padata_start(struct padata_instance *pinst);
184extern void padata_stop(struct padata_instance *pinst); 179extern void padata_stop(struct padata_instance *pinst);
185extern int padata_register_cpumask_notifier(struct padata_instance *pinst, 180extern int padata_register_cpumask_notifier(struct padata_instance *pinst,
diff --git a/kernel/padata.c b/kernel/padata.c
index b38bea9c466a..67ddd4acde9d 100644
--- a/kernel/padata.c
+++ b/kernel/padata.c
@@ -607,33 +607,6 @@ out_replace:
607} 607}
608 608
609/** 609/**
610 * padata_set_cpumasks - Set both parallel and serial cpumasks. The first
611 * one is used by parallel workers and the second one
612 * by the wokers doing serialization.
613 *
614 * @pinst: padata instance
615 * @pcpumask: the cpumask to use for parallel workers
616 * @cbcpumask: the cpumsak to use for serial workers
617 */
618int padata_set_cpumasks(struct padata_instance *pinst, cpumask_var_t pcpumask,
619 cpumask_var_t cbcpumask)
620{
621 int err;
622
623 mutex_lock(&pinst->lock);
624 get_online_cpus();
625
626 err = __padata_set_cpumasks(pinst, pcpumask, cbcpumask);
627
628 put_online_cpus();
629 mutex_unlock(&pinst->lock);
630
631 return err;
632
633}
634EXPORT_SYMBOL(padata_set_cpumasks);
635
636/**
637 * padata_set_cpumask: Sets specified by @cpumask_type cpumask to the value 610 * padata_set_cpumask: Sets specified by @cpumask_type cpumask to the value
638 * equivalent to @cpumask. 611 * equivalent to @cpumask.
639 * 612 *
@@ -694,42 +667,6 @@ static int __padata_add_cpu(struct padata_instance *pinst, int cpu)
694 return 0; 667 return 0;
695} 668}
696 669
697 /**
698 * padata_add_cpu - add a cpu to one or both(parallel and serial)
699 * padata cpumasks.
700 *
701 * @pinst: padata instance
702 * @cpu: cpu to add
703 * @mask: bitmask of flags specifying to which cpumask @cpu shuld be added.
704 * The @mask may be any combination of the following flags:
705 * PADATA_CPU_SERIAL - serial cpumask
706 * PADATA_CPU_PARALLEL - parallel cpumask
707 */
708
709int padata_add_cpu(struct padata_instance *pinst, int cpu, int mask)
710{
711 int err;
712
713 if (!(mask & (PADATA_CPU_SERIAL | PADATA_CPU_PARALLEL)))
714 return -EINVAL;
715
716 mutex_lock(&pinst->lock);
717
718 get_online_cpus();
719 if (mask & PADATA_CPU_SERIAL)
720 cpumask_set_cpu(cpu, pinst->cpumask.cbcpu);
721 if (mask & PADATA_CPU_PARALLEL)
722 cpumask_set_cpu(cpu, pinst->cpumask.pcpu);
723
724 err = __padata_add_cpu(pinst, cpu);
725 put_online_cpus();
726
727 mutex_unlock(&pinst->lock);
728
729 return err;
730}
731EXPORT_SYMBOL(padata_add_cpu);
732
733static int __padata_remove_cpu(struct padata_instance *pinst, int cpu) 670static int __padata_remove_cpu(struct padata_instance *pinst, int cpu)
734{ 671{
735 struct parallel_data *pd = NULL; 672 struct parallel_data *pd = NULL;
@@ -1091,7 +1028,6 @@ err_free_inst:
1091err: 1028err:
1092 return NULL; 1029 return NULL;
1093} 1030}
1094EXPORT_SYMBOL(padata_alloc);
1095 1031
1096/** 1032/**
1097 * padata_free - free a padata instance 1033 * padata_free - free a padata instance