From nobody Tue Oct 28 21:11:13 2025 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513362091040572.939081139419; Fri, 15 Dec 2017 10:21:31 -0800 (PST) Received: from localhost ([::1]:48036 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePubi-0004aA-DX for importer@patchew.org; Fri, 15 Dec 2017 13:21:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePuYw-0002js-NW for qemu-devel@nongnu.org; Fri, 15 Dec 2017 13:18:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePuYr-0005Vw-NA for qemu-devel@nongnu.org; Fri, 15 Dec 2017 13:18:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51366) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ePuYr-0005VU-H4 for qemu-devel@nongnu.org; Fri, 15 Dec 2017 13:18:17 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7B2C74E334 for ; Fri, 15 Dec 2017 18:18:16 +0000 (UTC) Received: from localhost (unknown [10.36.112.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1891E7C3E8; Fri, 15 Dec 2017 18:18:12 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Fri, 15 Dec 2017 19:18:10 +0100 Message-Id: <20171215181810.4122-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 15 Dec 2017 18:18:16 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] checkpatch: warn when using volatile with a comment X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, famz@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , lersek@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Instead of an error, lower to a warning message, assuming the comment gives some justification. Discussed in: '[Qemu-devel] [PATCH] dump-guest-memory.py: fix "You can't do that without = a process to debug"' Suggested-by: Fam Zheng Signed-off-by: Marc-Andr=C3=A9 Lureau --- scripts/checkpatch.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 34df753571..f5a523af10 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2476,7 +2476,12 @@ sub process { # no volatiles please my $asm_volatile =3D qr{\b(__asm__|asm)\s+(__volatile__|volatile)\b}; if ($line =3D~ /\bvolatile\b/ && $line !~ /$asm_volatile/) { - ERROR("Use of volatile is usually wrong: see Documentation/volatile-con= sidered-harmful.txt\n" . $herecurr); + my $msg =3D "Use of volatile is usually wrong: see Documentation/volati= le-considered-harmful.txt\n" . $herecurr; + if (ctx_has_comment($first_line, $linenr)) { + WARN($msg); + } else { + ERROR($msg); + } } =20 # warn about #if 0 --=20 2.15.1.355.g36791d7216