Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1442774imj; Sun, 17 Feb 2019 06:04:37 -0800 (PST) X-Google-Smtp-Source: AHgI3IYI3H9osBigd7sVgMk7EJkm12TwfMMpSRk/7vSmutaQwsAw/7O5M25h8yxdKdFfJdlaUsrH X-Received: by 2002:a62:ca48:: with SMTP id n69mr19310515pfg.162.1550412277812; Sun, 17 Feb 2019 06:04:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550412277; cv=none; d=google.com; s=arc-20160816; b=wcjLSsITAuY8NzI+6+PXObWW/ibqVqJ6rcocc/mU4GxMC9U1BEuWc7G8T2kJELwiJM CU4CrFaT4r3eU5Z0zXeGGH0n1P3vVRdjU0SifhI8BgR5uLaIMh4WbqV6li3T8QAYr3q+ af6lD53W7aE1MUJ726WMjzbLyxyFZcyIQ70rn1IvmGy/7QLMje404OJ6JSSMEnlV94OP qyxM19AkkC6oTQf5fO6EIiE3cAlWBVvpLtJDsPuldFuVUzXeFSbYtQ+2Z9pmKfa8x9ju lgzgvVMtVtih/eQiBdj1m6bS4T6d+NRsgCUs0ACy+YwYAjc2lTdv02HhpZkpBCimVfze NkCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=QvpSRc53fcvlwLiTFQIxYLyGkTR/Eh2LD+K2gyuoSiI=; b=vwL3OP1LSPdbUlXKUaIpztDJFG2cN2yUNObtaKj9S5grb6egJyRcc4Xm4gOVZ22LQ2 /Xr/X+sQ9UJi1DRFSRZApmvHR7vV1yF4YYo9H47y6nOeY96dKtXvknxZAQUQJDwycb54 A/dFZ6VIO6unc6LAaXcriRRteYUGUj6k0nmMH8jKHKKzTg0l6/CHJawF7Vj4YK16vrQk 0FrBYfhad0k49BMPfxVKccG56q1Bdu2a3Wyavh7t5lxhb8L8z/WT1X0ibCRkibiV8cn7 E/YtQugt1hMyszWulB16UvlBO9CkV+IzPsgriTpH2KnNszn/h6lKMjwTQq1UGP71e2fT IO6A== 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 x18si9498649plr.76.2019.02.17.06.04.21; Sun, 17 Feb 2019 06:04:37 -0800 (PST) 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 S1728592AbfBQLsE (ORCPT + 99 others); Sun, 17 Feb 2019 06:48:04 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:21655 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725795AbfBQLsE (ORCPT ); Sun, 17 Feb 2019 06:48:04 -0500 X-IronPort-AV: E=Sophos;i="5.58,380,1544482800"; d="scan'208";a="369731760" Received: from abo-58-107-68.mrs.modulonet.fr (HELO hadrien) ([85.68.107.58]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Feb 2019 12:48:02 +0100 Date: Sun, 17 Feb 2019 12:48:02 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Markus Elfring cc: Wen Yang , Gilles Muller , Nicolas Palix , Michal Marek , Masahiro Yamada , Wen Yang , Cheng Shengyu , kernel-janitors@vger.kernel.org, LKML , Coccinelle Subject: Re: [PATCH v6] coccinelle: semantic code search for missing put_device() In-Reply-To: <1c152067-0135-79d7-1285-4bb9925054c8@web.de> Message-ID: References: <8e7ba7c0-b7fe-a1f0-d28b-0c716ecbcfdb@web.de> <1c152067-0135-79d7-1285-4bb9925054c8@web.de> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 17 Feb 2019, Markus Elfring wrote: > >>> +@search exists@ > >>> +local idexpression id; > >>> +expression x,e,e1; > >>> +position p1,p2; > >>> +type T,T1,T2; > >>> +@@ > >>> + > >>> +id = of_find_device_by_node@p1(x) > >>> +... when != e = id > >> > >> I suggest to increase your software development attention also for > >> another implementation detail. > >> Source code analysis triggers challenges for safe data flow handling. > >> the semantic patch language supports search specifications for > >> the exclusion of specific assignments. > >> > >> Does this SmPL code contain a questionable order for the source > >> and target metavariables? > >> Can the following variant be more appropriate? > >> > >> + ... when != id = e > > > > This is possible, but I think unlikely. > > Would you dare to interpret my update suggestion (reordering of two identifiers) > as a required SmPL script correction? I didn't suggest to reorder anything. Both are needed. And, no I don't consider it to be a required suggestion. In practice, reassigning such a variable is very unlikely. julia