From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA968C433B4 for ; Tue, 18 May 2021 09:09:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C83246135D for ; Tue, 18 May 2021 09:09:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242567AbhERJK4 (ORCPT ); Tue, 18 May 2021 05:10:56 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:44968 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240960AbhERJKz (ORCPT ); Tue, 18 May 2021 05:10:55 -0400 IronPort-HdrOrdr: =?us-ascii?q?A9a23=3AgRcJdau78I1GjhvwJj1IVqpy7skDY9V00zEX?= =?us-ascii?q?/kB9WHVpmwKj9/xG/c536faaslgssR0b8uxofZPgfZqjz/RICPgqUYtKNTOO0F?= =?us-ascii?q?dAbrsSj7cKqAeOJ8SRzJ8/6U4ZSdkaNOHN?= X-IronPort-AV: E=Sophos;i="5.82,309,1613430000"; d="scan'208";a="508676330" Received: from 173.121.68.85.rev.sfr.net (HELO hadrien) ([85.68.121.173]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 May 2021 11:09:36 +0200 Date: Tue, 18 May 2021 11:09:36 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Mauro Carvalho Chehab cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Gilles Muller , Michal Marek , Nicolas Palix , cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org Subject: Re: [PATCH] scripts: coccicheck: fix troubles on non-English builds In-Reply-To: <1d3320d81fd7db23beaaea78888c389ab5f85ab8.1621328716.git.mchehab+huawei@kernel.org> Message-ID: References: <1d3320d81fd7db23beaaea78888c389ab5f85ab8.1621328716.git.mchehab+huawei@kernel.org> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-397356270-1621328977=:6885" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-397356270-1621328977=:6885 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Tue, 18 May 2021, Mauro Carvalho Chehab wrote: > 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 Applied, thanks. julia > --- > scripts/coccicheck | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/coccicheck b/scripts/coccicheck > index 65fee63aeadb..caba0bff6da7 100755 > --- a/scripts/coccicheck > +++ b/scripts/coccicheck > @@ -87,7 +87,7 @@ else > fi > > # Use only one thread per core by default if hyperthreading is enabled > - THREADS_PER_CORE=$(lscpu | grep "Thread(s) per core: " | tr -cd "[:digit:]") > + THREADS_PER_CORE=$(LANG=C lscpu | grep "Thread(s) per core: " | tr -cd "[:digit:]") > if [ -z "$J" ]; then > NPROC=$(getconf _NPROCESSORS_ONLN) > if [ $THREADS_PER_CORE -gt 1 -a $NPROC -gt 4 ] ; then > -- > 2.31.1 > > --8323329-397356270-1621328977=:6885--