aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-05-19 20:09:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-05-19 22:12:14 -0400
commit19d795b677bda354644cfb87a196b087fdc2a965 (patch)
treed61bee3238a6c4951cd3d1afcea22e09ce561f70
parent815613da6a67c196d7458d0e6c278ea88e21933f (diff)
kernel/padata.c: hide unused functions
A recent cleanup removed some exported functions that were not used anywhere, which in turn exposed the fact that some other functions in the same file are only used in some configurations. We now get a warning about them when CONFIG_HOTPLUG_CPU is disabled: kernel/padata.c:670:12: error: '__padata_remove_cpu' defined but not used [-Werror=unused-function] static int __padata_remove_cpu(struct padata_instance *pinst, int cpu) ^~~~~~~~~~~~~~~~~~~ kernel/padata.c:650:12: error: '__padata_add_cpu' defined but not used [-Werror=unused-function] static int __padata_add_cpu(struct padata_instance *pinst, int cpu) This rearranges the code so the __padata_remove_cpu/__padata_add_cpu functions are within the #ifdef that protects the code that calls them. [akpm@linux-foundation.org: coding-style fixes] Fixes: 4ba6d78c671e ("kernel/padata.c: removed unused code") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Richard Cochran <rcochran@linutronix.de> Cc: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--kernel/padata.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/kernel/padata.c b/kernel/padata.c
index 67ddd4acde9d..993278895ccc 100644
--- a/kernel/padata.c
+++ b/kernel/padata.c
@@ -647,6 +647,43 @@ out:
647} 647}
648EXPORT_SYMBOL(padata_set_cpumask); 648EXPORT_SYMBOL(padata_set_cpumask);
649 649
650/**
651 * padata_start - start the parallel processing
652 *
653 * @pinst: padata instance to start
654 */
655int padata_start(struct padata_instance *pinst)
656{
657 int err = 0;
658
659 mutex_lock(&pinst->lock);
660
661 if (pinst->flags & PADATA_INVALID)
662 err = -EINVAL;
663
664 __padata_start(pinst);
665
666 mutex_unlock(&pinst->lock);
667
668 return err;
669}
670EXPORT_SYMBOL(padata_start);
671
672/**
673 * padata_stop - stop the parallel processing
674 *
675 * @pinst: padata instance to stop
676 */
677void padata_stop(struct padata_instance *pinst)
678{
679 mutex_lock(&pinst->lock);
680 __padata_stop(pinst);
681 mutex_unlock(&pinst->lock);
682}
683EXPORT_SYMBOL(padata_stop);
684
685#ifdef CONFIG_HOTPLUG_CPU
686
650static int __padata_add_cpu(struct padata_instance *pinst, int cpu) 687static int __padata_add_cpu(struct padata_instance *pinst, int cpu)
651{ 688{
652 struct parallel_data *pd; 689 struct parallel_data *pd;
@@ -726,43 +763,6 @@ int padata_remove_cpu(struct padata_instance *pinst, int cpu, int mask)
726} 763}
727EXPORT_SYMBOL(padata_remove_cpu); 764EXPORT_SYMBOL(padata_remove_cpu);
728 765
729/**
730 * padata_start - start the parallel processing
731 *
732 * @pinst: padata instance to start
733 */
734int padata_start(struct padata_instance *pinst)
735{
736 int err = 0;
737
738 mutex_lock(&pinst->lock);
739
740 if (pinst->flags & PADATA_INVALID)
741 err =-EINVAL;
742
743 __padata_start(pinst);
744
745 mutex_unlock(&pinst->lock);
746
747 return err;
748}
749EXPORT_SYMBOL(padata_start);
750
751/**
752 * padata_stop - stop the parallel processing
753 *
754 * @pinst: padata instance to stop
755 */
756void padata_stop(struct padata_instance *pinst)
757{
758 mutex_lock(&pinst->lock);
759 __padata_stop(pinst);
760 mutex_unlock(&pinst->lock);
761}
762EXPORT_SYMBOL(padata_stop);
763
764#ifdef CONFIG_HOTPLUG_CPU
765
766static inline int pinst_has_cpu(struct padata_instance *pinst, int cpu) 766static inline int pinst_has_cpu(struct padata_instance *pinst, int cpu)
767{ 767{
768 return cpumask_test_cpu(cpu, pinst->cpumask.pcpu) || 768 return cpumask_test_cpu(cpu, pinst->cpumask.pcpu) ||