Hi! Thanks for your reply! I will rewrite the codes according to your suggestion.
On 2015/09/08 01:19, Cyril Hrubis wrote: > Hi! >> diff --git >> a/testcases/kernel/hotplug/cpu_hotplug/include/cpuhotplug_hotplug.sh >> b/testcases/kernel/hotplug/cpu_hotplug/include/cpuhotplug_hotplug.sh >> index 6920393..be8bce2 100644 >> --- a/testcases/kernel/hotplug/cpu_hotplug/include/cpuhotplug_hotplug.sh >> +++ b/testcases/kernel/hotplug/cpu_hotplug/include/cpuhotplug_hotplug.sh >> @@ -165,11 +165,11 @@ get_present_cpus() >> >> # get_present_cpus_num() >> # >> -# Prints the number of present CPUs >> +# Gets the number of present CPUs >> # >> get_present_cpus_num() >> { >> - return $(get_present_cpus | wc -w) >> + PRESENT_CPUS_NUM=`get_present_cpus | wc -w` >> } > > Passing the value by global variable is ugly. Why don't we echo the > value here as: > > echo $(get_present_cpus |wc -w), or even just call 'get_presnt_cpus |wc -w' > > and do: > > if [ $(get_present_cpus_num) -lt 2 ]; then > ... > fi > > in the testcases? > ------------------------------------------------------------------------------ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list