From nobody Sun May 5 15:20:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1489747077727341.098106160512; Fri, 17 Mar 2017 03:37:57 -0700 (PDT) Received: from localhost ([::1]:48120 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1copGe-00064t-Gv for importer@patchew.org; Fri, 17 Mar 2017 06:37:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1copFx-00063d-N1 for qemu-devel@nongnu.org; Fri, 17 Mar 2017 06:37:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1copFt-0003vf-M4 for qemu-devel@nongnu.org; Fri, 17 Mar 2017 06:37:13 -0400 Received: from 5.mo69.mail-out.ovh.net ([46.105.43.105]:45160) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1copFt-0003uc-G3 for qemu-devel@nongnu.org; Fri, 17 Mar 2017 06:37:09 -0400 Received: from player738.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo69.mail-out.ovh.net (Postfix) with ESMTP id 0FE551DE2E for ; Fri, 17 Mar 2017 11:37:06 +0100 (CET) Received: from [192.168.66.23] (gar31-1-82-66-74-139.fbx.proxad.net [82.66.74.139]) (Authenticated sender: groug@kaod.org) by player738.ha.ovh.net (Postfix) with ESMTPA id 69B53116C; Fri, 17 Mar 2017 11:37:00 +0100 (CET) From: Greg Kurz To: qemu-devel@nongnu.org Date: Fri, 17 Mar 2017 11:36:59 +0100 Message-ID: <148974701986.29545.5414999102981738774.stgit@bahia> User-Agent: StGit/0.17.1-20-gc0b1b-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 13568501255063902670 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeelhedriedvgddukecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.43.105 Subject: [Qemu-devel] [PATCH] checkpatch: allow longer lines for logging functions 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: Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Commit f1e155bbf863a removed a bunch of stuff that really don't make sense outside the linux kernel. An exception though is logging functions: it is convenient to be able to grep error messages in the code. For this to work, error strings mustn't be broken down on multiple lines, and therefore are likely to overcome the 90 characters limit, and make checkpatch unhappy. This patch reverts the change for logging functions and adapts it to QEMU. Signed-off-by: Greg Kurz --- scripts/checkpatch.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index f0845429342a..cc2796238170 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -192,6 +192,11 @@ our $typeTypedefs =3D qr{(?x: | QEMUBH # all uppercase )}; =20 +our $logFunctions =3D qr{(?x: + error_report| + error_printf +)}; + our @typeList =3D ( qr{void}, qr{(?:unsigned\s+)?char}, @@ -1341,7 +1346,8 @@ sub process { =20 #90 column limit if ($line =3D~ /^\+/ && - !($line =3D~ /^\+\s*"[^"]*"\s*(?:\s*|,|\)\s*;)\s*$/) && + !($line =3D~ /^\+\s*$logFunctions\s*\(\s*(?:([^"]*))?"[X\t]*"\s*(?:,= |\)\s*;)\s*$/ || + $line =3D~ /^\+\s*"[^"]*"\s*(?:\s*|,|\)\s*;)\s*$/) && $length > 80) { if ($length > 90) {