Skip to content

Commit f5b3553

Browse files
mchehabJuliaLawall
authored andcommitted
scripts: coccicheck: fix troubles on non-English builds
When LANG is not set to English, the logic which checks the number of CPUs fail, as the messages can be localized, and the logic at: THREADS_PER_CORE=$(lscpu | grep "Thread(s) per core: " | tr -cd "[:digit:]") will not get the number of threads per core. This causes the script to not run properly, as it will produce a warning: $ make coccicheck COCCI=$PWD/scripts/coccinelle/misc/add_namespace.cocci MODE=report drivers/media/ ./scripts/coccicheck: linha 93: [: número excessivo de argumentos Fix it by forcing LANG=C when calling lscpu. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
1 parent aeb300c commit f5b3553

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/coccicheck

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ else
8787
fi
8888

8989
# Use only one thread per core by default if hyperthreading is enabled
90-
THREADS_PER_CORE=$(lscpu | grep "Thread(s) per core: " | tr -cd "[:digit:]")
90+
THREADS_PER_CORE=$(LANG=C lscpu | grep "Thread(s) per core: " | tr -cd "[:digit:]")
9191
if [ -z "$J" ]; then
9292
NPROC=$(getconf _NPROCESSORS_ONLN)
9393
if [ $THREADS_PER_CORE -gt 1 -a $NPROC -gt 4 ] ; then

0 commit comments

Comments
 (0)