From patchwork Thu Sep 14 09:12:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kurz X-Patchwork-Id: 813752 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xtCVh0KdGz9sPt for ; Thu, 14 Sep 2017 19:13:00 +1000 (AEST) Received: from localhost ([::1]:46509 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsQCg-0006Q9-20 for incoming@patchwork.ozlabs.org; Thu, 14 Sep 2017 05:12:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsQC3-0006Nn-Kd for qemu-devel@nongnu.org; Thu, 14 Sep 2017 05:12:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dsQBy-0004EH-JR for qemu-devel@nongnu.org; Thu, 14 Sep 2017 05:12:19 -0400 Received: from 5.mo2.mail-out.ovh.net ([87.98.181.248]:50156) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dsQBy-0004Cw-DU for qemu-devel@nongnu.org; Thu, 14 Sep 2017 05:12:14 -0400 Received: from player770.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo2.mail-out.ovh.net (Postfix) with ESMTP id D555BABF4E for ; Thu, 14 Sep 2017 11:12:12 +0200 (CEST) Received: from bahia.lan (gar31-1-82-66-74-139.fbx.proxad.net [82.66.74.139]) (Authenticated sender: groug@kaod.org) by player770.ha.ovh.net (Postfix) with ESMTPA id 784883C006E; Thu, 14 Sep 2017 11:12:08 +0200 (CEST) From: Greg Kurz To: qemu-devel@nongnu.org Date: Thu, 14 Sep 2017 11:12:07 +0200 Message-ID: <150538015789.8149.10902725348939486674.stgit@bahia.lan> User-Agent: StGit/0.17.1-46-g6855-dirty MIME-Version: 1.0 X-Ovh-Tracer-Id: 5182235797136579022 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeelledrgeeigddugecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 87.98.181.248 Subject: [Qemu-devel] [PATCH] checkpatch: add hwaddr to @typeList 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 , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The script doesn't know about all possible types and learn them as it parses the code. If it reaches a line with a type cast but the type isn't known yet, it is misinterpreted as an identifier. For example the following line: foo = (hwaddr) -1; results in the following false-positive to be reported: ERROR: spaces required around that '-' (ctx:VxV) Let's add this standard QEMU type to the list of pre-known types. Signed-off-by: Greg Kurz --- checkpatch doesn't have an official maintainer, Cc'ing David in case he agrees to carry this patch through his ppc tree, along with: https://lists.nongnu.org/archive/html/qemu-devel/2017-09/msg03686.html scripts/checkpatch.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index fa478074b88d..def5bc1cc0e1 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -213,6 +213,7 @@ our @typeList = ( qr{${Ident}_handler}, qr{${Ident}_handler_fn}, qr{target_(?:u)?long}, + qr{hwaddr}, ); # This can be modified by sub possible. Since it can be empty, be careful