Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1586707pxk; Tue, 1 Sep 2020 02:30:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyz5IcWWebxtSEIfbI0NoRkwUZmku9N+gaF3UkJOBWQEHgZIraFCDcmoNoQK6KtJJ/+X3uF X-Received: by 2002:a17:906:3bca:: with SMTP id v10mr651607ejf.57.1598952617818; Tue, 01 Sep 2020 02:30:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598952617; cv=none; d=google.com; s=arc-20160816; b=qLf8Tw3QuBAGCZKYs3nW9pwqCaQ02GuWDRkq0Lqt8HUVPueETUGyK8cGiXKpAaPlyg NbdHjNXeLHcKxUrImtZFMEz1SDzltAnqP+Q8IP1paXTY0/JwZGo2/jBoYsqxzqctVe7L l19wG2QaI/BGNlWNfaGkruA5syU2216YMR71CvnwO8mm2ioNVx27116HJ6hWQdWbQuru CPmzOjFyFCitdQlPm3Dmc0Zm3Ssr4G0Zbr7peM9I3lsv36oWqKSbR/CHhaTSTTxeRk6+ 6+LIdICFRPRGqARGYN4kYexHLKUEtG068PeOgonGX5rHdNF5TrCjy/VtuTQYImcXZH0h 4sgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=bxHj9IkP2gtxX/i6bFF2tG+AqOJbAH96n0YTP0cULME=; b=H/iYirlqkRSmpWDlJPUjXKQPI+jsorpLLuBcJ/UybbYoWykAVHAGl5/iW1B21416xo cnu8X5d6AN8nAtAAHgaTH6MH3skM+tiD+groMCBPZOWZtDEPLKPlQzYTU5ilyG94OUqY 4Wrr4CIQJOSvNCqAFVk/z1PRXMklA2wprAAK+3TvvegmU1mhIunfde2tl981lDke7/ls +wgprAo8CpUXyH+HqiToXrMe+PWjsHOhBE26GMRZyx+3cUZaGvCJa44n0qrBHy/XISyQ TKosDH2IAm8vsVf0Y2zn4Xjv/onJZoIRnlp0aQU534eSlE/urDn8v6qdK4KPui+WlodO Qllg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c15si246086eds.227.2020.09.01.02.29.55; Tue, 01 Sep 2020 02:30:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726771AbgIAJ1y (ORCPT + 99 others); Tue, 1 Sep 2020 05:27:54 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:45483 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726686AbgIAJ1t (ORCPT ); Tue, 1 Sep 2020 05:27:49 -0400 Received: by mail-lj1-f196.google.com with SMTP id c2so637710ljj.12 for ; Tue, 01 Sep 2020 02:27:46 -0700 (PDT) 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:mime-version :content-transfer-encoding; bh=bxHj9IkP2gtxX/i6bFF2tG+AqOJbAH96n0YTP0cULME=; b=Cv0H7/+k/if0+aIbTp+289k5Wf2HlUZBjSkxItzbUpYHTs0RU4sYGr0kMwV8e7VbTV mMX0LfPD0DmA9fp3Iqjc076VwsKg7WCIl4h2LaCOfRzCz+6qsXbDtcOgf7w2lG5rh1FB Oa/V8VOpJ73cx9US9xJ3UekpU+mD459AWrDp2mAsDG3A/BIwtjiazQKQDEwkUVrcHyOM zegCyN56hkPqBCsNLODm+mTsK9XUbfLu9eRUfXeEFjY7k02/2uHIjP7WV/nfrTWpqFBH FF5j0RMorExuIA+tsHKxtiOHQtTIN/o0PxROwg/lwHwhYckcHbRxMwAp/Sb+NScGIaUs HhBA== X-Gm-Message-State: AOAM533iu0dciJUtDIP00+lYKOH1O8abSGus5BjKYtZEZf77cfEu3rzq SSLEv+b2lQX7Oov+eOJMhZE= X-Received: by 2002:a2e:96cb:: with SMTP id d11mr98310ljj.239.1598952465687; Tue, 01 Sep 2020 02:27:45 -0700 (PDT) Received: from localhost.localdomain (broadband-37-110-38-130.ip.moscow.rt.ru. [37.110.38.130]) by smtp.googlemail.com with ESMTPSA id t4sm152816ljh.122.2020.09.01.02.27.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2020 02:27:44 -0700 (PDT) From: Denis Efremov To: Julia Lawall Cc: Denis Efremov , cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org Subject: [PATCH] coccinelle: api: kobj_to_dev: don't warn about kobj_to_dev() Date: Tue, 1 Sep 2020 12:27:29 +0300 Message-Id: <20200901092729.427515-1-efremov@linux.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Exclude kobj_to_dev() definition from warnings. Signed-off-by: Denis Efremov --- No changes in performance. This patch can be squashed to the original patch with kobj_to_dev.cocci script. scripts/coccinelle/api/kobj_to_dev.cocci | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/coccinelle/api/kobj_to_dev.cocci b/scripts/coccinelle/api/kobj_to_dev.cocci index cd5d31c6fe76..d0b3b9647c19 100644 --- a/scripts/coccinelle/api/kobj_to_dev.cocci +++ b/scripts/coccinelle/api/kobj_to_dev.cocci @@ -15,10 +15,18 @@ virtual org virtual patch +@initialize:python@ +@@ +filter = frozenset(['kobj_to_dev']) + +def relevant(p): + return not (filter & {el.current_element for el in p}) + + @r depends on !patch@ expression ptr; symbol kobj; -position p; +position p : script:python() { relevant(p) }; @@ * container_of(ptr, struct device, kobj)@p @@ -26,9 +34,10 @@ position p; @depends on patch@ expression ptr; +position p : script:python() { relevant(p) }; @@ -- container_of(ptr, struct device, kobj) +- container_of(ptr, struct device, kobj)@p + kobj_to_dev(ptr) -- 2.26.2