From nobody Tue Nov 18 04:25:28 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1608067689; cv=none; d=zohomail.com; s=zohoarc; b=WDrr47HkXf0jmSeRbNDX7Y/mMFzb4QxWTzGCgLFG8ULVgZRMYm6ocFVWnuAoJ/2VWyACAo9U2hC9UD8ZyoNUyTZO3KMhtjQjCJongc4ZlMu5bcUNIOg6lfXxNXVCaGbRWhmHI7/En1/PJGCAGpsrQ7Da4VNcMZl0DqU9hjcT23U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608067689; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=c7bNvnyceo3xPeeAF05QCJAT5Wp/7viHuY0BxuSz7YY=; b=KdlAufZ8R5RkeNQYf8TF46fOJT5lI6heYYURTodj2e1OctqvjIbVB0mdRGW6UHPyx0uy2f7I6qtgaUNcr3UASN6sJhTw38eAD3kDJR8yTCEhnrL6H1k7b31bwECh/X2Keq8VEc545cPJ9438crlv5fNhCNMqL1ypjtZB2OwJtxY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160806768991823.39656641804254; Tue, 15 Dec 2020 13:28:09 -0800 (PST) Received: from localhost ([::1]:35004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kpCZh-0003tQ-Ub for importer@patchew.org; Tue, 15 Dec 2020 10:49:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpCRv-0003QK-RQ for qemu-devel@nongnu.org; Tue, 15 Dec 2020 10:41:15 -0500 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:35503) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kpCRu-0004u6-4B for qemu-devel@nongnu.org; Tue, 15 Dec 2020 10:41:15 -0500 Received: by mail-wr1-x442.google.com with SMTP id r3so20333820wrt.2 for ; Tue, 15 Dec 2020 07:41:13 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id 34sm38259978wrh.78.2020.12.15.07.41.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Dec 2020 07:41:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=c7bNvnyceo3xPeeAF05QCJAT5Wp/7viHuY0BxuSz7YY=; b=GsOZbuTXB1qrpE+nmi18kBVQ8inhJBEAa62A/ZPgLSDvzDiLcldjr9nlaAptOnaTcS s0SXHXIKARUCKZ8IcUMPBAbGPPtzpKKidK9UpcP734u3TT5GwhYd0DpK4ANCy356d5IF BDnvigtcasWhwRRdHFLHoi1lLadhhSAuGuWZHGR0q4/7W76EXpC2OGBsetxl3462sGjZ pMfD5d/1Bnv7lminVv1Zf3VPIGswIBvb1zxKSuoAqSIUHTFTXzDwiSrFkZHEdAr6EfiE 5rR+kkiJkTpTXcJcfExIKmB3yS6cyPRaVN8KXnGH8kvFTZaRnmnY/vM5kZgsAcqLYrDx LXSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=c7bNvnyceo3xPeeAF05QCJAT5Wp/7viHuY0BxuSz7YY=; b=h9zO+FfNim4RUb23+4+9DrpZ+CNbxfEWsNXPqM6uJhzvOIYBZoGLTHS1nQtqmHF8Fn VLnabWYfVABKA5xsLsfx2dewykt6CRlFKS4cVZTMJ7vPVHlMyUH1LImyimSvtSBFJimZ Sy1umepwUz6awBp1gbdUXm7rhR8lCDRhxIJLtzySqY+gMRYVlTu4n9Mb+YdV5PZPxXZY ehZSzBtFbWJY1q55o4o4u1N85///oAaOR4dJUV6f9DmgA/62mgWvHM3vM7VBRraaiEuW RSq4MQC97OAX55XT/ZTxcG0JzrQYzyTPViqbA3aCYQFn2EL58RxKOqOM+6JXtOMlPjUp fs5w== X-Gm-Message-State: AOAM531//TlqZ+CP/OH/2chtWQNtCm6FjBSnBnDveRkLpkNLFWMGrMtm adw3QamZS6+GgEhPGo5Oz/781jqPF5zxdQ== X-Google-Smtp-Source: ABdhPJzyN88F+tAwjLFOcCstFIwcODWq9AUcuSLCl9vYMKha7cQPKiUXKNXXrhl+TixpZUHKZX7dog== X-Received: by 2002:adf:f58a:: with SMTP id f10mr22427204wro.338.1608046872544; Tue, 15 Dec 2020 07:41:12 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH v2 2/4] scripts/coccinelle: New script to remove unnecessary timer_del() calls Date: Tue, 15 Dec 2020 15:41:05 +0000 Message-Id: <20201215154107.3255-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201215154107.3255-1-peter.maydell@linaro.org> References: <20201215154107.3255-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::442; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x442.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" Now that timer_free() implicitly calls timer_del(), sequences timer_del(mytimer); timer_free(mytimer); can be simplified to just timer_free(mytimer); Add a Coccinelle script to do this transformation. Signed-off-by: Peter Maydell Acked-by: Paolo Bonzini Reviewed-by: Richard Henderson --- scripts/coccinelle/timer-del-timer-free.cocci | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 scripts/coccinelle/timer-del-timer-free.cocci diff --git a/scripts/coccinelle/timer-del-timer-free.cocci b/scripts/coccin= elle/timer-del-timer-free.cocci new file mode 100644 index 00000000000..c3cfd428039 --- /dev/null +++ b/scripts/coccinelle/timer-del-timer-free.cocci @@ -0,0 +1,18 @@ +// Remove superfluous timer_del() calls +// +// Copyright Linaro Limited 2020 +// This work is licensed under the terms of the GNU GPLv2 or later. +// +// spatch --macro-file scripts/cocci-macro-file.h \ +// --sp-file scripts/coccinelle/timer-del-timer-free.cocci \ +// --in-place --dir . +// +// The timer_free() function now implicitly calls timer_del() +// for you, so calls to timer_del() immediately before the +// timer_free() of the same timer can be deleted. + +@@ +expression T; +@@ +-timer_del(T); + timer_free(T); --=20 2.20.1