From nobody Mon Sep 16 19:15:00 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721287300; cv=none; d=zohomail.com; s=zohoarc; b=INajwDREHTB5v1GBn9QkWR6UxhAsc9OXCtFzFwR6+aprmiD4COWmFnUbfpNor+4AW6VKJ2nyxO1/gfjJxSSlvsrd1ixWomT522Hhux1MKfLZCMU2jKXI5Ka+BacfEejPW8NHSTLfcFb20bPIvaNqHAY8WCWL/Bmk7B+bxa8HEPY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721287300; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qAqPrCeOYPNhd542Fw6myKMcE2pXClynTqDJiMXCNIA=; b=U97cDQIDyUqDwWDzLj4KbB0fOeXCIIy49J4mRx6B/NatFNk9efZPIsmP2vkFDNBJZuHZqapqpuDskzS45/e7amCMLYpA81wcUjAntgye0gwRpU3dxohbYeuqKgYO5Idn4xCG3ABgg0p7ZMeWr38Jfs/XFwWjT9Jsgv6fLbTL4jc= 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 1721287300755516.9747649791477; Thu, 18 Jul 2024 00:21:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sULS3-0005nI-P6; Thu, 18 Jul 2024 03:21:19 -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 1sULS1-0005bd-V6 for qemu-devel@nongnu.org; Thu, 18 Jul 2024 03:21:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sULRz-0006Q4-TI for qemu-devel@nongnu.org; Thu, 18 Jul 2024 03:21:17 -0400 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-45-3jJlzwk8NV6yLdcFxeG6Ng-1; Thu, 18 Jul 2024 03:21:06 -0400 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-5a0d4ce5d5bso254659a12.1 for ; Thu, 18 Jul 2024 00:21:05 -0700 (PDT) Received: from localhost.localdomain (host-82-57-51-153.retail.telecomitalia.it. [82.57.51.153]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-59b24a770dbsm8050838a12.4.2024.07.18.00.20.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jul 2024 00:20:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721287271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=qAqPrCeOYPNhd542Fw6myKMcE2pXClynTqDJiMXCNIA=; b=dBZBwgr+qnrG1tPO2RlUPulM2Q0nJjr2xM7QIAEu8n6hTzyWFMPx3+TixozRXeCXFC1ywY 5fvFWsaEs4EoTlCiT1k2OpqiE5mSgrW/cXyjsHrapkyf+WWFSXH8l1cCad7pbvj7tkybfZ h48wFl40HdQOaPjA+kyGLZ6jqhrOO9A= X-MC-Unique: 3jJlzwk8NV6yLdcFxeG6Ng-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721287258; x=1721892058; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qAqPrCeOYPNhd542Fw6myKMcE2pXClynTqDJiMXCNIA=; b=ERC966Zhrn7No+wINSScfVTZsy1AG6ifQLGlRIhll1WXaJt3ZbkuvFxZYAm5ml93fI 2Vjn/viSq927sXo7GInvGWHF93wQ4H0m6xfis3t0x7Tp2sUhNRooi/n8yRA7SiRSuUoS +JI4RXyQM3VWdX5PvTGLRNjC44v6VR5vbzw2CR+k7hCwgi6lVvJrgSvrUQKj142+0jOF v7YCo7NtV8yEv2dBzZOyGBl8EmDI1LHVPt6hgrcI9RcmNVuLm10P7kUJ1bRNuteZEm16 br0CSfGndNcpK/K+6tUa7xuilf7AHxhAJ2zyRPxbD5+kr2VFimzbqs1OrD+KONROAiHB v50w== X-Gm-Message-State: AOJu0Yxr6VKFBeZ0rp7w65dHtdLo5Uka2xNR4NSRlOjr7BA/iUcRDu/+ fAekufGz+Ko1DaiElNe/OIrASb882A2N+wjThzF0IffKkPSi+iG43qdnIWqEKkFHQURnhIo3v2H aIlnsG4C3Esmp7+S/4/jlMUNaiZNEvODkStpOfGQRHMp3xpphNH0/Fmjw5MaTGc/U2EmbnRW7AO dC0eMAlWQiqZtjl9kQjsOmL6ppZkdP5YPb/oeB X-Received: by 2002:a05:6402:2685:b0:586:12f6:c0fe with SMTP id 4fb4d7f45d1cf-5a05b417922mr3097676a12.5.1721287258297; Thu, 18 Jul 2024 00:20:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGt4QFlJ4xUWvokpAzXDVyrJLUe2/6jQtFMkX/gobfXV/iTDfjEUGIQLOPv5GMrcA0Qy0sSFA== X-Received: by 2002:a05:6402:2685:b0:586:12f6:c0fe with SMTP id 4fb4d7f45d1cf-5a05b417922mr3097645a12.5.1721287257570; Thu, 18 Jul 2024 00:20:57 -0700 (PDT) From: Stefano Garzarella To: qemu-devel@nongnu.org Cc: cohuck@redhat.com, berrange@redhat.com, Stefano Garzarella Subject: [PATCH v2] scripts/checkpatch: more checks on files imported from Linux Date: Thu, 18 Jul 2024 09:20:50 +0200 Message-ID: <20240718072050.9503-1-sgarzare@redhat.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 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=170.10.129.124; envelope-from=sgarzare@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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 @redhat.com) X-ZM-MESSAGEID: 1721287302445116600 Content-Type: text/plain; charset="utf-8" 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 --- v2: - added an error when mixing imported files with other changes [Daniel, Cornelia] v1: https://patchew.org/QEMU/20240717093752.50595-1-sgarzare@redhat.com/ --- 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.45.2