From patchwork Tue Jun 10 08:52:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 357798 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 5E6BB1400A8 for ; Tue, 10 Jun 2014 18:53:27 +1000 (EST) Received: from localhost ([::1]:37659 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuHo5-0004Fy-5C for incoming@patchwork.ozlabs.org; Tue, 10 Jun 2014 04:53:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36381) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuHnQ-0003U5-Mc for qemu-devel@nongnu.org; Tue, 10 Jun 2014 04:52:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WuHnM-0008Lu-F7 for qemu-devel@nongnu.org; Tue, 10 Jun 2014 04:52:44 -0400 Received: from mail-wi0-x22e.google.com ([2a00:1450:400c:c05::22e]:54588) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuHnM-0008Lh-8b for qemu-devel@nongnu.org; Tue, 10 Jun 2014 04:52:40 -0400 Received: by mail-wi0-f174.google.com with SMTP id r20so5663026wiv.7 for ; Tue, 10 Jun 2014 01:52:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=OK/0/NN7bPzNq308bqbTEtqVelTlCTLmxcIDgIEkews=; b=aaLhZko3idc5nspnGeM2WVGcTFa0fasHYtogqLQKHuRYPES4wzOSbi3r9ZTCIWmsRT i0MyW28Z3aTuvU8gaMk3tK3SE8rJTNZ7K2NcNJxZZFriQPi4mPLEZt1omqKCnW97em3F C0j8BjaYqpCI2k4ZTKeTUUM44zKqmMFFvkDS63HwhA45TUWpQBxjjPRyCMqCsTCVQKI2 R+o/AFoaGMXTKVW/5ZoECdVK1CfEVkvXYLi4mppsq7EP1P0uNfzf66I/hT5hff0zoEa5 i3kxDgvt9E7RfxGFojFeZIDN+QhAIIAvV+QnEMh1RTBCppt0KsTT//f3ZCTXVXsfv8RB W1+A== X-Received: by 10.180.211.146 with SMTP id nc18mr37987239wic.53.1402390357469; Tue, 10 Jun 2014 01:52:37 -0700 (PDT) Received: from playground.station (net-37-117-132-7.cust.vodafonedsl.it. [37.117.132.7]) by mx.google.com with ESMTPSA id i6sm19447452wiy.17.2014.06.10.01.52.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Jun 2014 01:52:36 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 10 Jun 2014 10:52:32 +0200 Message-Id: <1402390352-7319-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22e Cc: Alexey Kardashevskiy , Peter Maydell , Markus Armbruster , Stefan Weil Subject: [Qemu-devel] [PATCH] checkpatch.pl: adjust typedef definition to QEMU coding style X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Most QEMU typedefs are camelcase, starting with one uppercase letter and containing at least one lowercase letter. There are a few all-uppercase types, add the most common too. This fixes recognition of types in lines such as static __attribute__((unused)) inline void tcg_out8(TCGContext *s, uint8_t v) (Example provided by Peter Maydell). Reported-by: Alexey Kardashevskiy Cc: Peter Maydell Cc: Stefan Weil Cc: Markus Armbruster Signed-off-by: Paolo Bonzini --- scripts/checkpatch.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 9d46e5a..053e432 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -206,9 +206,13 @@ our $UTF8 = qr { | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 }x; +# There are still some false positives, but this catches most +# common cases. our $typeTypedefs = qr{(?x: - (?:__)?(?:u|s|be|le)(?:8|16|32|64)| - atomic_t + [A-Z][A-Z\d_]*[a-z][A-Za-z\d_]* # camelcase + | [A-Z][A-Z\d_]*AIOCB # all uppercase + | [A-Z][A-Z\d_]*CPU # all uppercase + | QEMUBH # all uppercase )}; our $logFunctions = qr{(?x: