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=-20.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT 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 33A8FC636CA for ; Sun, 18 Jul 2021 20:14:58 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 685EA61166 for ; Sun, 18 Jul 2021 20:14:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 685EA61166 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AD4C980563; Sun, 18 Jul 2021 22:14:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="fYuNrN+9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 98243805E7; Sun, 18 Jul 2021 22:14:44 +0200 (CEST) Received: from mail-oo1-xc2f.google.com (mail-oo1-xc2f.google.com [IPv6:2607:f8b0:4864:20::c2f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 755258039D for ; Sun, 18 Jul 2021 22:14:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-oo1-xc2f.google.com with SMTP id a17-20020a4ad5d10000b0290263c143bcb2so2497204oot.7 for ; Sun, 18 Jul 2021 13:14:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PaFrJzxMDXFBUHux2xvLxK9zJcEcfeNZibvMsDxOW8o=; b=fYuNrN+9SaBBLzimvVZYUJnqwOxemXOKE7uLd/WPBIUsiKJVOk3OUumZYxS8TT/d2C dajMLbAIhpCBD6l10GzlN0vG7ZdVeqDIYSSbSlBjtDh17VvLyHIu3XAJMFfY2kifA7Mj MT9NtLrqB5wEg9R82fv5U/hK1SDocctqbHJMk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PaFrJzxMDXFBUHux2xvLxK9zJcEcfeNZibvMsDxOW8o=; b=QnO0P3be4e4331ZjnCdHM6rqZ+nlVUnG3joPxGt4E7QC9EEeC/xKx0w5Wm3IUNeoTf qm1Kas6YBs0dx3A+wlSTNBHIS30XAwC6zbdNzO6/k7tyGZWrbvZYWmGlSkG0jNhy1kCD jU/YWJ1GZDVZBO/lXrAuWLLDUY61Ki5tVhdPqgGpazg9o3vaMTXVWbgRV6cnxy7fg1tu XKfbcAIjoYyYzdxVB+O6aEQW+21vzb/6cZUF1ylCywbFJletKK9vd79nXfrqF1bhRFGc jrseZ3HrSv/ZeXp2FoxrcOwLKbZkhtcULTYYD+uiN8hzBWcMJn7Bn8iM1MBvkAB7sFnA hDOA== X-Gm-Message-State: AOAM531UJ/4EnEwzy0PsetutCahgt6e8msnCb9a1zymoC4GgRxVpKud8 MTLy9S/fpeRK4In/r/5jCT7NinbdfyRmj98g X-Google-Smtp-Source: ABdhPJzjbwAfnubIduaVI/9l9dnnMNCH1gwYPoixCfVxXT59/T2RDDttmQgyz8fDCUBcwixEPPjcVA== X-Received: by 2002:a4a:b5c4:: with SMTP id u4mr15516926ooo.18.1626639279463; Sun, 18 Jul 2021 13:14:39 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id k13sm3170598otl.50.2021.07.18.13.14.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Jul 2021 13:14:39 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Joe Perches , Simon Glass , Alper Nebi Yasak , Evan Benn , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Sean Anderson , Wasim Khan Subject: [PATCH v2 1/5] checkpatch: Support wide strings Date: Sun, 18 Jul 2021 14:14:22 -0600 Message-Id: <20210718201426.759240-2-sjg@chromium.org> X-Mailer: git-send-email 2.32.0.402.g57bb445576-goog In-Reply-To: <20210718201426.759240-1-sjg@chromium.org> References: <20210718201426.759240-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean From: Joe Perches Allow prefixing typical strings with L for wide strings and u for unicode strings. Signed-off-by: Joe Perches Signed-off-by: Simon Glass --- This was found on LKML: https://lore.kernel.org/lkml/1508280192.6530.31.camel@perches.com/T/ It likely wasn't applied because it did not show up in patchwork correctly, due to the patch being inline: https://lore.kernel.org/patchwork/patch/842121/ In any case, it needed rebasing and updating to support 'u'. Heinrich, perhaps you can send this upstream since you have the context? Changes in v2: - Add new patch to reduce checkpatch unicode-string spam scripts/checkpatch.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 08a827535aa..b244682c7c9 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -411,7 +411,7 @@ our $Binary = qr{(?i)0b[01]+$Int_type?}; our $Hex = qr{(?i)0x[0-9a-f]+$Int_type?}; our $Int = qr{[0-9]+$Int_type?}; our $Octal = qr{0[0-7]+$Int_type?}; -our $String = qr{"[X\t]*"}; +our $String = qr{(?:\b[Lu])?"[X\t]*"}; our $Float_hex = qr{(?i)0x[0-9a-f]+p-?[0-9]+[fl]?}; our $Float_dec = qr{(?i)(?:[0-9]+\.[0-9]*|[0-9]*\.[0-9]+)(?:e-?[0-9]+)?[fl]?}; our $Float_int = qr{(?i)[0-9]+e-?[0-9]+[fl]?}; @@ -5673,7 +5673,8 @@ sub process { } # concatenated string without spaces between elements - if ($line =~ /$String[A-Za-z0-9_]/ || $line =~ /[A-Za-z0-9_]$String/) { + if ($line =~ /$String[A-Z_]/ || + ($line =~ /([A-Za-z0-9_]+)$String/ && $1 !~ /^[Lu]$/)) { if (CHK("CONCATENATED_STRING", "Concatenated strings should use spaces between elements\n" . $herecurr) && $fix) { @@ -5686,7 +5687,7 @@ sub process { } # uncoalesced string fragments - if ($line =~ /$String\s*"/) { + if ($line =~ /$String\s*[Lu]?"/) { if (WARN("STRING_FRAGMENTS", "Consecutive strings are generally better as a single string\n" . $herecurr) && $fix) { -- 2.32.0.402.g57bb445576-goog