Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1645993imm; Fri, 27 Jul 2018 23:26:57 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe4w4r6mol3WlY7uO26ZUR6llDgV8sEo5A1gnf7UXqVIrG3j2qyYMaZMTiJA+r4fO3bLck3 X-Received: by 2002:a63:9e0a:: with SMTP id s10-v6mr8689437pgd.326.1532759217365; Fri, 27 Jul 2018 23:26:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532759217; cv=none; d=google.com; s=arc-20160816; b=QxYn3pFpKkdPYRiByOyFAQv3u87qWw/mA734dWtJWFbZHYC+9mKhYpAhHgja3R3fd9 cMugcS5EU35MmxFjHkkwbnA4h1venFTJWZer/pQFu5KzWu2LW2MTzrKJt5+1IdT5knbY yoYhEotppAmw2fVnYcXySaZ9EIQ0a4x2Ke95yo9IYpo3SJLjPyF8+avQcHUDJSnRoh3Q LkfbWZimqKe6U4bNvOEYLGSUgVrOdvAvxaDs43ghQnO7mo4COsY72ywMc1914ZXK4eNN CU9ADsDkMyf6cZKG87DevVZwUNwtaOUIoSMum1Y14IFjKK0ivHbE+2qASVQ1UHrnOiqy MCaw== 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 :arc-authentication-results; bh=4uxeiZI3BfxJJwpSchQ7SY+M3kiTSRFcScdFYCHqDLw=; b=onQ2of1ZlF/aIRdmBxBa9L0OVCD4ZKrY5OczQ6lHNVQor9SUrmJPuZdZJqTXfoOAWM Qnra36C0wkDhYJjP0HKRdcdBCX+DICvuc1tknOnH6p0Ux3znXNuxGQIRh8wo/mohHOsI i9HcefFzDXn0OmzFXvWDrHoqenHbv239yukA0dawK/PHdirvEBkx91VjqyDTBQGBYjql utifAuhMEPMZFd1O+IIVN3IYpYXwfgCdQmXb11o996Um7cKDFHaEBkD+L7Xr2tB+Ym7q wzcI9UgeEQOx6538VNAfUQjvAPyDYNNkUV+c1S+dK91w1wz1almGxLDABUc33qGkhvnX HG4Q== 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 184-v6si5790427pgj.421.2018.07.27.23.26.43; Fri, 27 Jul 2018 23:26:57 -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 S1726646AbeG1HvB (ORCPT + 99 others); Sat, 28 Jul 2018 03:51:01 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:36075 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726000AbeG1HvB (ORCPT ); Sat, 28 Jul 2018 03:51:01 -0400 X-IronPort-AV: E=Sophos;i="5.51,412,1526335200"; d="scan'208";a="340565730" Received: from abo-214-111-68.mrs.modulonet.fr (HELO [192.168.0.15]) ([85.68.111.214]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jul 2018 08:25:41 +0200 Date: Sat, 28 Jul 2018 08:25:41 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Joe Perches cc: David Laight , 'Andrew Morton' , Andy Whitcroft , LKML Subject: Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack In-Reply-To: <1a75fda0861a0b2bce208fbf9b53785bf0e76fa2.camel@perches.com> Message-ID: References: <1236369d28b2f1f5389ff652c4eb89e699e6481e.camel@perches.com> <20180726122533.104f6eea950853ef50ebc680@linux-foundation.org> <20180726122807.fad0566951e36d930edb6874@linux-foundation.org> <9d7441a14897426f8ed5befe8da0cad3@AcuMS.aculab.com> <0a6d2ecfacf3786228de664c8e01f6de10314c1b.camel@perches.com> <9f0377fa74bd4964912ba5a4fc76526d@AcuMS.aculab.com> <1a75fda0861a0b2bce208fbf9b53785bf0e76fa2.camel@perches.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) 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 Fri, 27 Jul 2018, Joe Perches wrote: > On Fri, 2018-07-27 at 10:21 +0000, David Laight wrote: > > From: Joe Perches Sent: 27 July 2018 11:09 > > > On Fri, 2018-07-27 at 10:04 +0000, David Laight wrote: > > > > From: Andrew Morton Sent: 26 July 2018 20:28 > > > > > On Thu, 26 Jul 2018 12:25:33 -0700 Andrew Morton wrote: > > > > > > > > > > > I'll give it a spin, see how noisy it is. > > > > > > > > > > Actually, I would prefer if the message, changelog and title > > > > > used the term "passed by value". It's a more familiar term > > > > > and it is possible for a passed-by-value aggregate to in fact > > > > > be passed in registers. > > > > > > > > You need to detect (and ignore) 'small' structures. > > > > > > checkpatch is stupid and basically can't do that > > > as it has no context other than the current line. > > > > > > It would need a list of specific struct types to > > > ignore. Care to create and send that list to me? > > > > Does it even have the type? > > Yes, kinda. But only on the line being matched. > > i.e.: [struct or union] [type] [name] > > > If it has the prototype it could ignore aggregates that > > are marked 'const'. > > checkpatch has no visibility of any prototype. > > It might make sense for this sort of check to be > added to coccinelle or maybe as a compiler warning > when the struct is larger than some size. > > Original thread for Julia: > https://lore.kernel.org/patchwork/patch/967890/ Coccinelle doesn't directly know the size of the structure, but it can count the number of fields. Maybe a case with an update in the function body or at least 3 fields is worth reporting on? julia