From patchwork Wed Jul 12 13:38:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 787263 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3x70xZ1r15z9s2s for ; Thu, 13 Jul 2017 00:01:54 +1000 (AEST) Received: from localhost ([::1]:53368 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVID9-0004Uh-Io for incoming@patchwork.ozlabs.org; Wed, 12 Jul 2017 10:01:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVHyR-0006mC-A3 for qemu-devel@nongnu.org; Wed, 12 Jul 2017 09:46:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVHyL-0003PW-D5 for qemu-devel@nongnu.org; Wed, 12 Jul 2017 09:46:39 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:56165) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVHyL-0003Nw-4I; Wed, 12 Jul 2017 09:46:33 -0400 Received: from tsrv.tls.msk.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 280CD40F66; Wed, 12 Jul 2017 16:46:31 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.tls.msk.ru (Postfix) with SMTP id 582A5AD0; Wed, 12 Jul 2017 16:38:14 +0300 (MSK) Received: (nullmailer pid 29057 invoked by uid 1000); Wed, 12 Jul 2017 13:38:12 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Wed, 12 Jul 2017 16:38:09 +0300 Message-Id: <10cb4ec41734243b2798bd1d53919827eaccd673.1499866676.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 13/13] qobject: Update coccinelle script to catch Q{INC, DEC}REF 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: qemu-trivial@nongnu.org, Michael Tokarev Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Eric Blake A recent patch submission was about to use qobject_decref(QOBJECT(E)), even though we already have QDECREF(E) for that purpose. While our tree is currently free from the longhand form, we might as well update our coccinelle script to catch any future relapses. Signed-off-by: Eric Blake Signed-off-by: Michael Tokarev --- scripts/coccinelle/qobject.cocci | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/coccinelle/qobject.cocci b/scripts/coccinelle/qobject.cocci index c3253deb1b..c518caf7b1 100644 --- a/scripts/coccinelle/qobject.cocci +++ b/scripts/coccinelle/qobject.cocci @@ -3,6 +3,12 @@ expression Obj, Key, E; @@ ( +- qobject_incref(QOBJECT(E)); ++ QINCREF(E); +| +- qobject_decref(QOBJECT(E)); ++ QDECREF(E); +| - qdict_put_obj(Obj, Key, QOBJECT(E)); + qdict_put(Obj, Key, E); |