From nobody Mon Feb 9 11:30:45 2026 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1585666856; cv=none; d=zohomail.com; s=zohoarc; b=Z75ist/z3MQx6jYOSxUPcimwNEQT3ZOWZ008vt3llKtc++Vt9M3+4LVAnytFNbDD9w4bNpo+oawcaWGtAInrqgC+mAyWKsuVeRIIS3FE6vOCgKyAWka4pP/yHjlI8VfLhNUH30r/IO5/74oxgiFKfwooGoOHxjipiaeI7sgJErk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585666856; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=RvegJ88q70bON/LohdWsxFm4RI480T8ytw4ZvouggGw=; b=k5tRzCs2GC5A3Uyl+zq9HAXtvTsrPz/xiLllcdlrY696g7R/z+9FXjqbYNFWYhrsNLwUGDu04qRlLdsv3d7VZam54Sma1R+M7oGq0Wv5EGoWGQobNxQVGazoLODbaBSGOjp2gjIbUdI1+ve6IhU1GW1m9qQPKSvurkUuPf6XY1I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585666856621939.1637375685691; Tue, 31 Mar 2020 08:00:56 -0700 (PDT) Received: from localhost ([::1]:39634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJINq-0004yR-7J for importer@patchew.org; Tue, 31 Mar 2020 11:00:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56366) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJIKE-00083F-3X for qemu-devel@nongnu.org; Tue, 31 Mar 2020 10:57:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJIKC-00052E-MG for qemu-devel@nongnu.org; Tue, 31 Mar 2020 10:57:10 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:42389 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jJIKC-00051p-I2 for qemu-devel@nongnu.org; Tue, 31 Mar 2020 10:57:08 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-258-KPSvr1VPNiapxXDe5XLS6g-1; Tue, 31 Mar 2020 10:57:04 -0400 Received: by mail-wm1-f71.google.com with SMTP id s15so802347wmc.0 for ; Tue, 31 Mar 2020 07:57:04 -0700 (PDT) Received: from redhat.com (bzq-79-176-51-222.red.bezeqint.net. [79.176.51.222]) by smtp.gmail.com with ESMTPSA id m19sm4097428wml.48.2020.03.31.07.57.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Mar 2020 07:57:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585666628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RvegJ88q70bON/LohdWsxFm4RI480T8ytw4ZvouggGw=; b=Ad9uoukPAoLmk7MnuICsihEVEMlraos5garenEH+Tkq9HNtD1aovpc2NbKCm7nqwX+Ua50 cOt+dazakpNbt/7f3/RsNgYTnfIBnCNKSILLMgNyAGtS2OinAJ9F1Cjpoe9n3cd/NKoC77 bD3/z+wpRyQJ+bqDKRg8/qZD8juIA3A= X-MC-Unique: KPSvr1VPNiapxXDe5XLS6g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=muzU+wYjkhlwqhSb/6Hfi5D5d8nln1GaBm49ftTglK8=; b=Vb7blaUKHo9WGc8tBF2C7p7IANfpLB176tk+w9WsDC2SaJFufZQNhqygHNIytkcBDh tTcnguTtcmKiKJlC1ia+xATJzgKq9SPv/djyQC+sZQaiy8DKYfBS7vbXsf2Rs9xLXdFm Omk9IKDSJDPlr4+xUNOnxyK4/44uC5aPj1KA0HjNg8kQRBADXl17otlb2AkuNIwEQ71X brCC0rsmECIDBKRtASRW1XmaztuYoIQEbWZjZA1SFXk9+JjaSS7ytrWldbgKckaG8436 nrKRj0HzqtU4CqfF2NvswS81VGxEc2gPgaPq9cZOTlkCzO2gzvNRRRXlpjt4KlWV6cJU MZYQ== X-Gm-Message-State: ANhLgQ1SpgJgK/h/43AsjkmrbcqcURV0i7/gQoDZmaS5BxBM2nzOTF5r 2WpNGguYN+xgB7UfJAB1kKIuXEWAmwYF5fQ+YI3x/46FX2bZmuzJC9agXUn775fjkVU6OT2M6Xq jgw6gjEtxoL/K/vA= X-Received: by 2002:adf:9f42:: with SMTP id f2mr21461372wrg.246.1585666623072; Tue, 31 Mar 2020 07:57:03 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvPl9ghByRiQrYQlg+cUEurP8Q5uxhGbJthzEUJ6/1t/7ec8uGatW0BhCHJxXLgUfSG2fT96w== X-Received: by 2002:adf:9f42:: with SMTP id f2mr21461346wrg.246.1585666622808; Tue, 31 Mar 2020 07:57:02 -0700 (PDT) Date: Tue, 31 Mar 2020 10:57:00 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 01/10] checkpatch: enforce process for expected files Message-ID: <20200331145631.135630-2-mst@redhat.com> References: <20200331145631.135630-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200331145631.135630-1-mst@redhat.com> X-Mailer: git-send-email 2.24.1.751.gd10ce2899c X-Mutt-Fcc: =sent X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Richard Henderson , Stefan Hajnoczi , Igor Mammedov , Paolo Bonzini , Alex =?utf-8?Q?Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" If the process documented in tests/qtest/bios-tables-test.c is followed, then same patch never touches both expected files and code. Teach checkpatch to enforce this rule. Tested-by: Igor Mammedov Reviewed-by: Stefan Hajnoczi Signed-off-by: Michael S. Tsirkin --- scripts/checkpatch.pl | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index b27e4ff5e9..e658e6546f 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -35,6 +35,8 @@ my $summary_file =3D 0; my $root; my %debug; my $help =3D 0; +my $acpi_testexpected; +my $acpi_nontestexpected; =20 sub help { my ($exitcode) =3D @_; @@ -1256,6 +1258,27 @@ sub WARN { } } =20 +# According to tests/qtest/bios-tables-test.c: do not +# change expected file in the same commit with adding test +sub checkfilename { + my ($name) =3D @_; + if ($name =3D~ m#^tests/data/acpi/# and + # make exception for a shell script that rebuilds the files + not $name =3D~ m#^\.sh$# or + $name =3D~ m#^tests/qtest/bios-tables-test-allowed-diff.h$#) { + $acpi_testexpected =3D $name; + } else { + $acpi_nontestexpected =3D $name; + } + if (defined $acpi_testexpected and defined $acpi_nontestexpected) { + ERROR("Do not add expected files together with tests, " . + "follow instructions in " . + "tests/qtest/bios-tables-test.c: both " . + $acpi_testexpected . " and " . + $acpi_nontestexpected . " found\n"); + } +} + sub process { my $filename =3D shift; =20 @@ -1431,9 +1454,11 @@ sub process { if ($line =3D~ /^diff --git.*?(\S+)$/) { $realfile =3D $1; $realfile =3D~ s@^([^/]*)/@@ if (!$file); + checkfilename($realfile); } elsif ($line =3D~ /^\+\+\+\s+(\S+)/) { $realfile =3D $1; $realfile =3D~ s@^([^/]*)/@@ if (!$file); + checkfilename($realfile); =20 $p1_prefix =3D $1; if (!$file && $tree && $p1_prefix ne '' && --=20 MST