Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1601607yba; Fri, 17 May 2019 01:59:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+fyJD6APLAhTmxQfnTQdmuhWMoylsYFguM8vVa/7cOp5Hp7Gxe0Wf8T2pR16HS5xrmKSj X-Received: by 2002:a63:7413:: with SMTP id p19mr53406389pgc.259.1558083568391; Fri, 17 May 2019 01:59:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558083568; cv=none; d=google.com; s=arc-20160816; b=ey+GK2gmM0swzsWpvHnwgg3sBHIOxZrnGN9jf1Ryh+9LMhynW5yszcbBhgZzAlmNEf SdMNsZM9BOln/66RjYZhSYqZ3v2tsDAe6hcy/Hyx+vp0ZoH+fm/bKxnCgf47oLZMoP8W XJH94thd5dyarXlWMclolRj1nrw0VrAWzBpYuRKeGBextxKovzcgfq7BXptQ5Igw7Y1m T5SWtAWletvhcW/jH4kgKTGufzYIFbLy5LypxNdQQcj/qVBSXHKFPSuR4+ObI/QKsbWo 5sYNWgLZqEhvFVAaQl1lOLosEHh+KN98Mu/B8yWRiLOKMiOuqJzWADhTJyULhEZ4t/Bw Q7JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-id:mime-version:user-agent :references:message-id:in-reply-to:subject:cc:to:from:date; bh=J16Spete8n4+soXzwv9WU7x8yelXrmcOhUfkMFnXzJQ=; b=NABbRcCUQASJfm+NqQrIwUg3+yxvEbVMboTuSrhT28PpDT8hLnWpSctGTzVhbVFT3r W8mT5/Azf4uZfpa10yhTq2qd5H8/nn3qc/IEv89PowjdKVtZXEZ6TeP1zQTkHE6Zr8nL T2SS15E7s5fX6UPyETyYRodXbiVOt4CqdZRAJzF5ZhzK0MdLZhEpmlggY2oNXtrwAmC3 zIQ9sJSRBZ5BIO63bmZutEzPy5XcFWo776LU5+WFv1wrIW7NQB+gaR8Q/7TmXNcklc8P lq4+CPKpMkkoDgAhGmWwFRGpBxbBBpYU9XlRfgrZPK+gg4D9uoQm/eVAF76ScGPdG9XR E2cg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m189si8592277pfm.17.2019.05.17.01.59.13; Fri, 17 May 2019 01:59:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728165AbfEQHOt (ORCPT + 99 others); Fri, 17 May 2019 03:14:49 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:59393 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727871AbfEQHOs (ORCPT ); Fri, 17 May 2019 03:14:48 -0400 X-IronPort-AV: E=Sophos;i="5.60,479,1549926000"; d="scan'208";a="383575452" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 May 2019 09:14:46 +0200 Date: Fri, 17 May 2019 09:14:45 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: wen.yang99@zte.com.cn cc: Markus.Elfring@web.de, cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org, Gilles Muller , yamada.masahiro@socionext.com, michal.lkml@markovi.net, nicolas.palix@imag.fr Subject: Re: Coccinelle: semantic patch for missing of_node_put In-Reply-To: <201905171432571474636@zte.com.cn> Message-ID: References: 201905090947015772925@zte.com.cn,141163ed-a78b-6d89-e6cd-3442adda7073@web.de <201905171432571474636@zte.com.cn> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; CHARSET=US-ASCII Content-ID: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A semantic patch has no access to comments. The only thing I can see to do is to use python to interact with some external tools. For example, you could write some code to collect the comments in a file and the lines on which they occur, and then get the comment that most closely precedes the start of the function. julia