Skip to content

Commit 19d795b

Browse files
arndbtorvalds
authored andcommitted
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: 4ba6d78 ("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>
1 parent 815613d commit 19d795b

1 file changed

Lines changed: 37 additions & 37 deletions

File tree

‎kernel/padata.c‎

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,43 @@ int padata_set_cpumask(struct padata_instance *pinst, int cpumask_type,
647647
}
648648
EXPORT_SYMBOL(padata_set_cpumask);
649649

650+
/**
651+
* padata_start - start the parallel processing
652+
*
653+
* @pinst: padata instance to start
654+
*/
655+
int 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+
}
670+
EXPORT_SYMBOL(padata_start);
671+
672+
/**
673+
* padata_stop - stop the parallel processing
674+
*
675+
* @pinst: padata instance to stop
676+
*/
677+
void padata_stop(struct padata_instance *pinst)
678+
{
679+
mutex_lock(&pinst->lock);
680+
__padata_stop(pinst);
681+
mutex_unlock(&pinst->lock);
682+
}
683+
EXPORT_SYMBOL(padata_stop);
684+
685+
#ifdef CONFIG_HOTPLUG_CPU
686+
650687
static int __padata_add_cpu(struct padata_instance *pinst, int cpu)
651688
{
652689
struct parallel_data *pd;
@@ -726,43 +763,6 @@ int padata_remove_cpu(struct padata_instance *pinst, int cpu, int mask)
726763
}
727764
EXPORT_SYMBOL(padata_remove_cpu);
728765

729-
/**
730-
* padata_start - start the parallel processing
731-
*
732-
* @pinst: padata instance to start
733-
*/
734-
int 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-
}
749-
EXPORT_SYMBOL(padata_start);
750-
751-
/**
752-
* padata_stop - stop the parallel processing
753-
*
754-
* @pinst: padata instance to stop
755-
*/
756-
void padata_stop(struct padata_instance *pinst)
757-
{
758-
mutex_lock(&pinst->lock);
759-
__padata_stop(pinst);
760-
mutex_unlock(&pinst->lock);
761-
}
762-
EXPORT_SYMBOL(padata_stop);
763-
764-
#ifdef CONFIG_HOTPLUG_CPU
765-
766766
static inline int pinst_has_cpu(struct padata_instance *pinst, int cpu)
767767
{
768768
return cpumask_test_cpu(cpu, pinst->cpumask.pcpu) ||

0 commit comments

Comments
 (0)