Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp642968imm; Fri, 27 Jul 2018 03:38:00 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe2fG3Q1EfPX+rP1RyFZy0UtTcYpZYijhRzuWng4dI277zKTNZ+spPh0gSNYj8UNWhUFenc X-Received: by 2002:a62:c699:: with SMTP id x25-v6mr6225091pfk.16.1532687880367; Fri, 27 Jul 2018 03:38:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532687880; cv=none; d=google.com; s=arc-20160816; b=lLMpVBxi6aTm8dclOPYw+Uy++maQYxc0xRuux9EeY/JMva9LRS7JMFW6vnKf4bPpR+ FlcoZwkMkKUbOHUtVL55yicaI+y3vUvzR3VskKBnWWk1YWlOZzy43PH24W4nMcV3/6Z5 adbdLBO6FL4ShCgMcO7k9Ac/3/u70afCK36nKsqg5tFx4WuoUbnefh1/N9D/rIwxfW2t qj/buKxSCcywSkawOFL/Y6S+FdK6uwsbLUJ+Pm6tEcMacoFGKxar6aZBQPwnctqX6n7j 4DRp+wPs75U5PyDBzRHJWol2ouKosawVxAVfrxZ6aOuRZvCGF3Wns9UhuQxH3y5tpQPz s6+w== 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 :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=BFizT1a4ApasQ1XZGhFSYr2xnJCQhRAcL7d0xiOfVyk=; b=C1VYmuG/PyagEWEIN/wSfc3el2j1futupoqoyRWCCBdRFy+W8GRTwZT1xtz1+o+8a8 VLBGrOOcQ+gDjAYXkLjHfdJWDCRiQKuj7s8/IiC+u0xunFsksZNJmH7W5nz9clFMsW0S i9EgiWO7yN+tsFsj8PB5+z2Zdwu9JyZpQTk2GOqUbY+fRKo/jpgbyaSpQD50abGeC5ZW Zd0yhatLrMpPFAB6PUM+oQfwr9EGWd5WPXtIXta3SeUCs4Sj+pITjjIOoQlLOqvcg4tS N0fTU0GLOgQXc+aAMvvBTMXXyBOt1isyX5N2nUxBPOOtwHZsY8tyiMa/HcE8lZFK5vAS /biQ== 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 x6-v6si3615491pgk.597.2018.07.27.03.37.45; Fri, 27 Jul 2018 03:38:00 -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 S1730931AbeG0L6C (ORCPT + 99 others); Fri, 27 Jul 2018 07:58:02 -0400 Received: from smtprelay0066.hostedemail.com ([216.40.44.66]:53274 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730026AbeG0L6C (ORCPT ); Fri, 27 Jul 2018 07:58:02 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id 4C83014D37; Fri, 27 Jul 2018 10:36:42 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:355:379:541:599:800:960:967:973:988:989:1260:1277:1311:1313:1314:1345:1359:1431:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2525:2553:2559:2563:2682:2685:2828:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:5007:6120:7576:7903:8603:9010:9025:10004:10400:10848:10967:11232:11658:11914:12043:12048:12555:12740:12760:12895:13069:13095:13255:13311:13357:13439:13845:13972:14181:14659:14721:21080:21212:21433:21451:21627:21740:30029:30054:30070:30083:30090:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.8.0.100 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:26,LUA_SUMMARY:none X-HE-Tag: color66_749997c5a6d5c X-Filterd-Recvd-Size: 2639 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf06.hostedemail.com (Postfix) with ESMTPA; Fri, 27 Jul 2018 10:36:41 +0000 (UTC) Message-ID: <1a75fda0861a0b2bce208fbf9b53785bf0e76fa2.camel@perches.com> Subject: Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack From: Joe Perches To: David Laight , 'Andrew Morton' , Andy Whitcroft , LKML Cc: Julia Lawall Date: Fri, 27 Jul 2018 03:36:39 -0700 In-Reply-To: <9f0377fa74bd4964912ba5a4fc76526d@AcuMS.aculab.com> 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> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.28.1-2 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 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/