Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 53E9FC433F5 for ; Sat, 22 Jan 2022 01:27:58 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D4EFB83875; Sat, 22 Jan 2022 02:27:48 +0100 (CET) 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="Wc+/+nhO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 75F1B832E6; Sat, 22 Jan 2022 02:27:46 +0100 (CET) Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) (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 3BEAD830B9 for ; Sat, 22 Jan 2022 02:27:43 +0100 (CET) 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-il1-x136.google.com with SMTP id v17so9075076ilg.4 for ; Fri, 21 Jan 2022 17:27:43 -0800 (PST) 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=Lgee8cadQrrUT1M4xHQJe6uQT+UqK4Drm1FP9TZfuxo=; b=Wc+/+nhOXybo9qvZh071BbJZXOoPnD4AyA6Dr5CLoDH9qVOZKG/EwUbszp5IimFHa6 yIYuVPxFf1g3e7Uh2Ib54hv74LMRTmGAyDegRa21NROgsq4qUcD7ltPemoVapNMLwYH4 9cjApk8+HBz68cJSGuin9MX0dhLGtnuJB1UWs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Lgee8cadQrrUT1M4xHQJe6uQT+UqK4Drm1FP9TZfuxo=; b=xU7OuYqVEfdALg+FcV07shiq9rAfFuURERm90iXM2i2qLPbhQflmYokiDXkEIZu/Rh g6M6zL7gYFqSwpryyAVr12rqkTRM3JZoXBEP8vLkS1yUSKDsYS4a+WlWp/xfakKKqqoT Mk0GJqYpDYIlOS1ZqFGO1e1/CsN0KLxy/Qz5QyI4A//+GlcRPQNtaoqCCa7zGcbaoyTc d7XqDVmj7b5xRxrCDi7OS+wXteOKsKl2IW9LnCvYpX0zGVoscSPH28mu8abHDWFBamf6 l8pDI4EzG6npeipbmF1sPTIHadFKpnUlo4RvQctVg0YakAIiVHHi28JlUuVRGLGQReAk I7kQ== X-Gm-Message-State: AOAM530W3OpLGRVWrpSUxXCyF6E+yIUVXk67h0/sLWaHFRAmJUtixDgd IIZKDFGjn4JIbww4xh3M5G1cj3JOSKiaWg== X-Google-Smtp-Source: ABdhPJxs0/vAjCFOnkb/zznxP9lT8EJKfv3Jv+IU5o5G5rmKL7YIQ3BULJ4CNZ0oNWfHcQ2qdlbaRA== X-Received: by 2002:a05:6e02:1b08:: with SMTP id i8mr3479761ilv.262.1642814861754; Fri, 21 Jan 2022 17:27:41 -0800 (PST) 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 k17sm2153586ioj.1.2022.01.21.17.27.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jan 2022 17:27:41 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Joe Perches , Simon Glass Subject: [PATCH v4 1/4] checkpatch: Support wide strings Date: Fri, 21 Jan 2022 18:27:33 -0700 Message-Id: <20220122012736.2725994-2-sjg@chromium.org> X-Mailer: git-send-email 2.35.0.rc0.227.g00780c9af4-goog In-Reply-To: <20220122012736.2725994-1-sjg@chromium.org> References: <20220122012736.2725994-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 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/ (no changes since v3) 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 cf59e2bb705..c1307f4361c 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -504,7 +504,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]?}; @@ -6242,7 +6242,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) { @@ -6255,7 +6256,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.35.0.rc0.227.g00780c9af4-goog