From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julia Lawall Date: Sun, 17 Feb 2019 11:48:02 +0000 Subject: Re: [PATCH v6] coccinelle: semantic code search for missing put_device() Message-Id: List-Id: References: <8e7ba7c0-b7fe-a1f0-d28b-0c716ecbcfdb@web.de> <1c152067-0135-79d7-1285-4bb9925054c8@web.de> In-Reply-To: <1c152067-0135-79d7-1285-4bb9925054c8@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Markus Elfring Cc: kernel-janitors@vger.kernel.org, Michal Marek , Wen Yang , Nicolas Palix , LKML , Coccinelle , Cheng Shengyu , Wen Yang 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