Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10944360ybi; Thu, 25 Jul 2019 07:25:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyi3uXMhdBNiSrfMQDNplEmzk+ZFYfWVdi9xDBiBJfiTTDa3AxmseHdw5tkNaZ3x+sgc3iu X-Received: by 2002:a63:1:: with SMTP id 1mr22037017pga.162.1564064754435; Thu, 25 Jul 2019 07:25:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564064754; cv=none; d=google.com; s=arc-20160816; b=XCx3EoKUOQT7OeQ7xX5c1V/ZhAE/pVKiDxL77WvIQj1GVd1xCnD+LiqUvWxCpFVooq 1ksjLEEM1rBJwxTlEIjO7b8D8aou+eYEyN4ZlOB3QhtpZKif6wDl/gXZOVkh6Q1/+o+b 2s8nWHbjy9x9Uu8Ndsecuapovk8M8Dd7jU5YfCovOmYdK1x/f4A4HYqScQRGFSbHj/tt hrVOhTdVaHL3Wzzex8iIiGh4a+seA/xdENdvrCLeor+zcuEK6P9LiL96KB5WzcEoOBgi FzSTNZL70qtcCpS9J9sdnufxJvdWyYxfnUrTHkEvSr/BfRh3nHomchPRjdU4CKOBx6ME MVYg== 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=jXK4mMaDyB+q/XSDGUwNnoaM1QanqHpMJniKX42/8/o=; b=YUfdUbNhY/dwUcR5QPaUd7YxtPkEBMI5vM3ea5gyhPwwIh/T/LQEf9CsQJCDHwncX/ BGQkMhJF3dPfCt5sU+Dgmb9gAQYc1fd0+MTAZHFAsNsKv4GaJd+AXYLBIAat9+7cy6WT LV+1oOwIgTXUhnrBb9INkvCCyIr2koriIVrhp+GnQp0DxbIU7i8PuK3FTno1phSo0I03 gINtACLL3C+K/U/Ny0PDZ8HBuXcCsXo0zS/6PsAE+2LFPmsX2hEY6pzVmFblKYYSQ/7a L5za8QGmmtcL6DEI8hWVRbQZ9uo3bW5PRnvQ0iWBVS2shruqbXLu3QbZmVTQDcMLUDI1 Tkjw== 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 x9si19080790pfi.211.2019.07.25.07.25.39; Thu, 25 Jul 2019 07:25:54 -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 S2404487AbfGYN7F (ORCPT + 99 others); Thu, 25 Jul 2019 09:59:05 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:55024 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404488AbfGYN7C (ORCPT ); Thu, 25 Jul 2019 09:59:02 -0400 X-IronPort-AV: E=Sophos;i="5.64,306,1559512800"; d="scan'208";a="393304252" Received: from c-73-22-29-55.hsd1.il.comcast.net (HELO hadrien) ([73.22.29.55]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jul 2019 15:59:00 +0200 Date: Thu, 25 Jul 2019 08:58:58 -0500 (CDT) From: Julia Lawall X-X-Sender: jll@hadrien To: Joe Perches cc: David Laight , cocci , LKML Subject: Re: [Fwd: [PATCH 1/2] string: Add stracpy and stracpy_pad mechanisms] In-Reply-To: Message-ID: References: <7ab8957eaf9b0931a59eff6e2bd8c5169f2f6c41.1563841972.git.joe@perches.com> <66fcdbf607d7d0bea41edb39e5579d63b62b7d84.camel@perches.com> <0f3ba090dfc956f5651e6c7c430abdba94ddcb8b.camel@perches.com> <563222fbfdbb44daa98078db9d404972@AcuMS.aculab.com> 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 Thu, 25 Jul 2019, Joe Perches wrote: > 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. Not quite nice due to the ignoring of rule 2 noticed by Markus. There is actually currently no guarantee that the size is right. I'm testing a new version. > > 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? I could do this. One might though think that if someone went to the trouble of computing +=, these would be cases that we don't want to change? Still, it's not problem to add all assignment operators. > 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. Sure, I'll do that when all this is working. I didn't want those results to drown out these ones. thanks, julia > > I'll see about adding that and try it myself > so an automated conversion should be possible. > > >