Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10942191ybi; Thu, 25 Jul 2019 07:24:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzcFMuVaHlxQ3qS53/RIFaGIRnQtMRoeaSF+gtPDQx05i0sQD+p4fC4WbOGF/EqAZMJTx61 X-Received: by 2002:a63:c23:: with SMTP id b35mr53003161pgl.265.1564064642903; Thu, 25 Jul 2019 07:24:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564064642; cv=none; d=google.com; s=arc-20160816; b=t4grk7izyu5gtsesUVkUmumaF2qohWJDUvlKGevXM6Guf4CAoXUQrtxpF9cbZwCtAO 6/Ux/oPdo40rvsJ/GuGFRia91wSePkaUSRYUG6AFhCbOqtmPd/kUJUqrQ4u/PWs1yrDr Zvk4z8lxaR7qdpEOfd0mMB6HP88GPJ2q2j54/3aJ4eEOPKlI/CM8TQRx76FRq7Ewb+tA oibAkSfrmoryVm3njVpDRSoprrr9Mbvs+PqVQ0za4qjLRr5B2D383/g3p5RghdfNk1i+ fGGbyUt/AVRKFdv/ZkzN844wEEqy+CU9zIHM6r/45pi1M+ZYkrwWUyTsvMAi8awJilsT pDfg== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=QvTxJtpH1A8IOb7Myzad5MrBeEuD2ia/q+5sBft9ME8=; b=sWB77mK2yNG/7uq8HLCOeR6R1/dc6pHuqprKQQ/Tu9LKbUyoZHs+XCLpIJju1VrqaC XhfNGsmjTJ7zfYCnDqg5MI/+9iiVnJaU0oczVQnKkZO1URymLgiajN9WTx2LdYiG4qxt OZVm/crCcYHSl+dGOEruJcxwyrqpkcqiByt+bkamuroJ1E0JroUVjlQo6IvkF76CWY/R a2DezTPSGkxq0vygGXRiERnMowx8M999lABAUiZPC16jz2pF64u5ac73oaHEq/43jUIb YOWcnrDl96ttdPuJX6JR6UTwJQwImTw2cTJ0jYCI/wFBXWyYSg+gtP3/jlGa6gi68LF9 bSNw== 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 bj5si15415722plb.227.2019.07.25.07.23.47; Thu, 25 Jul 2019 07:24:02 -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 S1728840AbfGYNui (ORCPT + 99 others); Thu, 25 Jul 2019 09:50:38 -0400 Received: from smtprelay0111.hostedemail.com ([216.40.44.111]:41359 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726666AbfGYNui (ORCPT ); Thu, 25 Jul 2019 09:50:38 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay08.hostedemail.com (Postfix) with ESMTP id E46BC182CF66A; Thu, 25 Jul 2019 13:50:36 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:599:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3872:3874:4321:5007:6117:6119:7903:7904:10004:10400:10848:11232:11658:11914:12297:12740:12760:12895:13069:13311:13357:13439:14096:14097:14659:14721:21080:21324:21433:21627:21740:30003:30054:30070:30091,0,RBL:23.242.196.136:@perches.com:.lbl8.mailshell.net-62.8.0.180 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: table00_5c89d2adde534 X-Filterd-Recvd-Size: 2562 Received: from XPS-9350.home (cpe-23-242-196-136.socal.res.rr.com [23.242.196.136]) (Authenticated sender: joe@perches.com) by omf05.hostedemail.com (Postfix) with ESMTPA; Thu, 25 Jul 2019 13:50:35 +0000 (UTC) Message-ID: Subject: Re: [Fwd: [PATCH 1/2] string: Add stracpy and stracpy_pad mechanisms] From: Joe Perches To: Julia Lawall Cc: David Laight , cocci , LKML Date: Thu, 25 Jul 2019 06:50:34 -0700 In-Reply-To: References: <7ab8957eaf9b0931a59eff6e2bd8c5169f2f6c41.1563841972.git.joe@perches.com> <66fcdbf607d7d0bea41edb39e5579d63b62b7d84.camel@perches.com> <0f3ba090dfc956f5651e6c7c430abdba94ddcb8b.camel@perches.com> <563222fbfdbb44daa98078db9d404972@AcuMS.aculab.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.30.5-0ubuntu0.18.10.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-07-24 at 20:42 -0500, Julia Lawall wrote: > New version. I check for non-use of the return value of strlcpy and > address some issues that affected the matching of the case where the first > argument involves a pointer dereference. Actually, an isomorphism now > takes care of that case, so it doesn't show up in the semantic patch > explicitly any more. > > julia Nice x 2, thanks again. More comments: @@ identifier f,i2,i1; struct i1 e1; expression e2; local idexpression x; position r.p; @@ ( -x = strlcpy +stracpy (e1.f, e2 - , i2 )@p; ... when != x Just for completeness and correctness, as I at least don't find an existing use: Perhaps this "x =" should also include += and + and the various other operators that are possible or does SmPL grammar already do that? Also, it might be nice to include the trivial conversion with sizeof(e1) and ARRAY_SIZE(e1) so a single script could be run over the kernel. I'll see about adding that and try it myself so an automated conversion should be possible.