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=-19.4 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 DDD65C4338F for ; Mon, 2 Aug 2021 01:10:08 +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 6558F60D07 for ; Mon, 2 Aug 2021 01:10:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6558F60D07 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 71B1483378; Mon, 2 Aug 2021 03:09:24 +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="LhnI5Cai"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8BF318337D; Mon, 2 Aug 2021 03:06:27 +0200 (CEST) Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) (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 D9B1983398 for ; Mon, 2 Aug 2021 02:56:20 +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-oi1-x22a.google.com with SMTP id 21so22191173oin.8 for ; Sun, 01 Aug 2021 17:56:20 -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=anfzJ68nXqWdSkmNqWfGg9HTtC+5j3RjFQXet5jNEsQ=; b=LhnI5CaiIuMErqF+GPDFWqRJ5lIX9W05kbJW/Ae3vOrQHjcZH8i54tYR+NfbaJtpCZ wNSfXEeGNxX5Ol1D1c3XfHlrOfPSFS9zPWTpY1HkclfutHhCT5V7Tgl/Bvvzrmorp1eG oX5a++/Kqkp1zSlPeVRbJ6NwIDYvrXF5ypACk= 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=anfzJ68nXqWdSkmNqWfGg9HTtC+5j3RjFQXet5jNEsQ=; b=VSxCkoXJECoOMzrNNzWeevip+LQSmetpagWQjjnURKuyRXmamuKqaCOOC+rH3PD6Kn CFdOQBfthL/c1XqiGeHUTcAifWnkjdaLPO7KALbjeWrTy8Ad7637SytC0lSskZflIMee 0t6KGIKg1B2VE6HWKovfpkW083VRjl16hy8gGATe2Th4XxQc9xJIOFbTlcvreParDHPE 9vUD3APUni/mqA4SDhiMRTIeMRcT5Q9be5GXmrfMS3bFkQ94Yioc3OJCWPwWoUJWyuhk vwQ4owGmAu8V8ZZ6NjwYY1qU7qn9QlX6aWVTcMUPxLP+hQyPmVffsN2F63A5QbS1isAj nymg== X-Gm-Message-State: AOAM533HuhX0kWHZPoC5prlPpgtSdkAIZ1tYTyEPgT3Q0Eor+tkPBmdf 4C1eE/toW+xWb1kosC4HxK/D9WARX45TMiYd X-Google-Smtp-Source: ABdhPJysD9jVmHLL5+4FJ8Y3ycTHyx3PcQkyyftG9rLz96/mHvsl3R39jfrNeHdkBXpLSeU1l+LgaA== X-Received: by 2002:a05:6808:d2:: with SMTP id t18mr8730033oic.45.1627865779044; Sun, 01 Aug 2021 17:56:19 -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 j125sm1488743oif.53.2021.08.01.17.56.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Aug 2021 17:56:18 -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 v3 1/5] checkpatch: Support wide strings Date: Sun, 1 Aug 2021 18:56:09 -0600 Message-Id: <20210802005613.2267669-2-sjg@chromium.org> X-Mailer: git-send-email 2.32.0.554.ge1b32706d8-goog In-Reply-To: <20210802005613.2267669-1-sjg@chromium.org> References: <20210802005613.2267669-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'. I sent this upstream: https://lore.kernel.org/patchwork/patch/1470668/ Changes in v3: - Mention the link to the new upstream patch 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.554.ge1b32706d8-goog