Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A29F30B515 for ; Fri, 28 Nov 2025 10:26:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764325614; cv=none; b=toOFQmcRV8IYfTVNdj4HHtZzvaTu08N2Qj3QQMHBHzVxi2vV4Z/GrIEqw2307mQMFOoVrta+AyWFNZzpPaEckzOtGKo0/Hzc3ApkJm2f5oFHx2SKO/GYKgPLWQdJkHaEgxHU4zF0qa3Il8ssFXaF+gh96emDyLsddyyI2u7lKmg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764325614; c=relaxed/simple; bh=UCnnxMHjgnr6D48lTpRu1DT52kyGg12ZGduDOX6amrE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=soxLB2uUFQ8ZoOUQfRQTtz4BtIbV2P5vMDx/1FPSuJFAoZ4/8ShwgBU+/WqLv3dfwwYcYWV06vUicwIRl71aoB53/xdyNuvW1ytoLHxirhlnJbgZBbfmHgErBIp/TBUcxHrDiduvi3VBakS+cmt7Y6eoB2e3VbHrMUwrBCLWtK8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=zB+hQKm/; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="zB+hQKm/" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id D99944E41946; Fri, 28 Nov 2025 10:26:48 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 9EB6060706; Fri, 28 Nov 2025 10:26:48 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 46366103C8F6F; Fri, 28 Nov 2025 11:26:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1764325608; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding; bh=a7IKnfhAijzhQUKvB9pxVnnG4oI6F4ee1ek8ZV9lCnI=; b=zB+hQKm/SQ0h55E04/qqi8s8HqNzkHk78w1fOaDyfaIGdz5SeC9/4cYdZqAuwCO8yOaMpg Qa6opXySUZk3wUysflb/kh2huKoCWlXmMAuGfLHIRSwgavxKH4kx620mKkj3CHSbbdfBtj qAh6i/NMidEQBei3aZdwXYtaVWTP6LR3rPzF7a20Y+7rrZqy+qm8lhm84OAGfMuyI1Wrmw ukeAw5NhUUkcu4/1rCCos+3nRDDkEPp8tTntDUI/VlzlL9/70FBW7O3AqC6MYFsKUXgZoJ YIWRMk3KEg3a4fZ716bo/zIiN9CMpCjQCniE728hVnB2fcCUvt1jV1aPAX88hA== From: Kory Maincent To: linux-kernel@vger.kernel.org Cc: Kory Maincent , =?UTF-8?q?J=C3=A9r=C3=A9mie=20Dautheribes?= , Louis Chauvet , thomas.petazzoni@bootlin.com, Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn Subject: [PATCH] checkpatch: Add support for long UTF-8 name Date: Fri, 28 Nov 2025 11:26:22 +0100 Message-ID: <20251128102623.645512-1-kory.maincent@bootlin.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 In case we have a long utf-8 name the second line will contain UTF-8 code. Here is an example: From: =?UTF-8?q?K=C3=B6ry=20Maincent=20=28bla=20blou=20prout=20test=20?= =?UTF-8?q?=29?= Date: Fri, 28 Nov 2025 10:57:00 +0100 Subject: [PATCH] checkpatch: Add support for long UTF-8 name On this rare case checkpatch is returning an error due to UTF-8 code in the name as it only decodes the From once the line is fully concatenated. WARNING: From:/Signed-off-by: email name mismatch: 'From: "Köry Maincent (bla blou prout test test=?UTF-8?q?=29?=" ' != 'Signed-off-by: Köry Maincent (bla blou prout test test) ' Decode each line instead to be sure we don't have UTF-8 code in the email name check. Reported-by: Jérémie Dautheribes Co-developed-by: Louis Chauvet Signed-off-by: Louis Chauvet Signed-off-by: Kory Maincent --- scripts/checkpatch.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 92669904eecc7..98cc7f6fb8b5f 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2979,11 +2979,13 @@ sub process { # Check the patch for a From: if (decode("MIME-Header", $line) =~ /^From:\s*(.*)/) { $author = $1; + $author = encode("utf8", $author) if ($line =~ /=\?utf-8\?/i); my $curline = $linenr; while(defined($rawlines[$curline]) && ($rawlines[$curline++] =~ /^[ \t]\s*(.*)/)) { - $author .= $1; + my $tmp = $1; + $tmp = encode("utf8", decode("MIME-Header", $tmp)) if ($tmp =~ /=\?utf-8\?/i); + $author .= $tmp; } - $author = encode("utf8", $author) if ($line =~ /=\?utf-8\?/i); $author =~ s/"//g; $author = reformat_email($author); } -- 2.43.0