From nobody Sun Nov 24 12:55:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1723580699; cv=none; d=zohomail.com; s=zohoarc; b=VUjI3Ohq5JgDUknyJuw6NOQ45guOr9UHsrd5685j92ID13KSamg2F3MOZAWt3Iyxt8+e9A2cnPqJDDkMHB1leOUR6LKOtD5PByXu5iyUGLzjdwhx/BLdGnkvBBH7O/udHkJQ6KJL5hO+msOyT9X3blGvd0qNOyZWDQmOY7QRNMU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723580699; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1AVh2j6pk/5XaCd8FbE/7mpmYiPG8pggbKweEGs0KY8=; b=PC0I18pa4McgqhfX5/UiTlx+LiZF6ixdGftflWmaLNYGxhPCivLnJYXPj7Bpqn+dZAojurqg1HJV51kBEZl77pItySNimVaDhoz+YVNuHB15hhdVOg20qtRGMAyOtqJtqs7v8uOxjmSt8akkTle8iLpx7HzfNDb1yCIEUEgcJ0k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1723580699949487.1973990496032; Tue, 13 Aug 2024 13:24:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sdy3i-0005EO-6S; Tue, 13 Aug 2024 16:23:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sdy3c-0004zN-2I for qemu-devel@nongnu.org; Tue, 13 Aug 2024 16:23:52 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sdy3N-0006Be-5a for qemu-devel@nongnu.org; Tue, 13 Aug 2024 16:23:51 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4281ca54fd3so44492315e9.2 for ; Tue, 13 Aug 2024 13:23:36 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429d0642979sm98513095e9.20.2024.08.13.13.23.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 13:23:34 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id E95A25F9CF; Tue, 13 Aug 2024 21:23:29 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723580615; x=1724185415; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1AVh2j6pk/5XaCd8FbE/7mpmYiPG8pggbKweEGs0KY8=; b=swYFf/2BZxSSNajIQqL04N5uSZn50Dyk1MS2o4kLoWDMT654RGTbVmJEV3WBaZExLp AgFBB+E5tcLSAs8oqOIMNI0xpX9a4Wm0bXOWStaJSgjwo8mzA8x6wS+0rOO+vaXIiuxm jqQaFejdK+I5lyrHtiiKVPLnUpq35D9Y0aUUqxY6t8E7Sx+GwNGpY7E2D41ELrqWAZWC dknDBtSgn0wXBcN2g/z75vbqj2/Ct4vESxy/zYO+siHaB8zRkQPYpiWu67jDvBE5FiG/ SI6wZCmFGqn0I05ILZ1mlAbUijVccIOwCOZ/U9LAx2qCLmwR0zsPBGhRed5XJXdmzuxf IYNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723580615; x=1724185415; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1AVh2j6pk/5XaCd8FbE/7mpmYiPG8pggbKweEGs0KY8=; b=EzzNMulmTlK3msD6iF9DKFyyeI5V9L/yMeJ9v5KByJp4nfcihtHfwRJsnh/kl88JGe 2/HDKBGsT8goDnxfwAoB4YZKNEJ1ffNmyF4C/No/S4JOx3v8p4mdingCVM1O/6qWQP6b /0w3lQpNZWygEMOMqZlpG10q5X8X3emVaYgpzWuNf1Bn71NsgNGhuwH+iFA2qjSjQ0hu pneL0xTq+OWPBdTxpNHKGTptMx1sAc7kQRasPuxtSXwMor27YJZ/fAYKDllxVEs31qw0 3Xl0vUiZKIHLVrSddh0FLPYbNIZBGXboO71vO9X58uaAsxUV4ETPun3w/jwqrDbClBDO o3Kg== X-Gm-Message-State: AOJu0Ywft02QD+mBUPMWe8oUI+i6jnePwqkmyswUGMq49WWljebLBVDi NksjXHHEg+hM+TF4ULrhinMH5VL0KggBQFLiMshy8NzJbNVtsRgNOjoU4pQI/A8= X-Google-Smtp-Source: AGHT+IGdwxx3Yarp7KGAlSqIsgRmbEoqUx0ZN2t2rvjV2uSlSTWCBlXOqUAML9ogR29JYA305V8rYA== X-Received: by 2002:a5d:64c9:0:b0:367:9107:9e11 with SMTP id ffacd0b85a97d-37177830523mr605930f8f.62.1723580615118; Tue, 13 Aug 2024 13:23:35 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , Michael Roth , Palmer Dabbelt , Mahmoud Mandour , Pavel Dovgalyuk , Yoshinori Sato , Weiwei Li , Eduardo Habkost , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Markus Armbruster , David Hildenbrand , Beraldo Leal , Liu Zhiwei , Eric Auger , Song Gao , =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-arm@nongnu.org, Peter Xu , Jiri Pirko , Eric Blake , Fabiano Rosas , qemu-s390x@nongnu.org, Peter Maydell , "Michael S. Tsirkin" , Daniel Henrique Barboza , John Snow , Alexandre Iooss , Konstantin Kostiuk , Pierrick Bouvier , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Thomas Huth , Paolo Bonzini , Richard Henderson , Jason Wang , Bin Meng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Stefano Garzarella , Cornelia Huck , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PATCH v2 06/21] scripts/checkpatch: more checks on files imported from Linux Date: Tue, 13 Aug 2024 21:23:14 +0100 Message-Id: <20240813202329.1237572-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240813202329.1237572-1-alex.bennee@linaro.org> References: <20240813202329.1237572-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1723580700675116600 From: Stefano Garzarella If a file imported from Linux is touched, emit a warning and suggest using scripts/update-linux-headers.sh. Also check that updating imported files from Linux are not mixed with other changes, in which case emit an error. Signed-off-by: Stefano Garzarella Reviewed-by: Cornelia Huck Reviewed-by: Daniel P. Berrang=C3=A9 Message-Id: <20240718072050.9503-1-sgarzare@redhat.com> Signed-off-by: Alex Benn=C3=A9e Message-Id: <20240807114059.2339021-7-alex.bennee@linaro.org> --- scripts/checkpatch.pl | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index ff373a7083..65b6f46f90 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1374,6 +1374,9 @@ sub process { my $in_header_lines =3D $file ? 0 : 1; my $in_commit_log =3D 0; #Scanning lines before patch my $reported_maintainer_file =3D 0; + my $reported_mixing_imported_file =3D 0; + my $in_imported_file =3D 0; + my $in_no_imported_file =3D 0; my $non_utf8_charset =3D 0; =20 our @report =3D (); @@ -1673,6 +1676,27 @@ sub process { # ignore non-hunk lines and lines being removed next if (!$hunk_line || $line =3D~ /^-/); =20 +# Check that updating imported files from Linux are not mixed with other c= hanges + if ($realfile =3D~ /^(linux-headers|include\/standard-headers)\//) { + if (!$in_imported_file) { + WARN("added, moved or deleted file(s) " . + "imported from Linux, are you using " . + "scripts/update-linux-headers.sh?\n" . + $herecurr); + } + $in_imported_file =3D 1; + } else { + $in_no_imported_file =3D 1; + } + + if (!$reported_mixing_imported_file && + $in_imported_file && $in_no_imported_file) { + ERROR("headers imported from Linux should be self-" . + "contained in a patch with no other changes\n" . + $herecurr); + $reported_mixing_imported_file =3D 1; + } + # ignore files that are being periodically imported from Linux next if ($realfile =3D~ /^(linux-headers|include\/standard-headers)\//); =20 --=20 2.39.2