Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp20554imm; Thu, 26 Jul 2018 13:06:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcHpa8EAnrSsAFPgsdQQaEm6UEDH67roi/j+emTCFDTfogugf8IURljW7xQ71Pkf9eFPsLc X-Received: by 2002:a62:c0c4:: with SMTP id g65-v6mr3535779pfk.72.1532635610847; Thu, 26 Jul 2018 13:06:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532635610; cv=none; d=google.com; s=arc-20160816; b=FeRn3lcN6evCrkQ8s8AtVljqF52vckQ2cwRDwLAwhC2tdWRnFUHJ2XqT9+nZd4nWQU TmtkshC73WGaMlkwBTwYb2EwzPYjdf7svTWbclP6FMVO9dCQb+5iI5v/CT802aLRg9Ax vgPoue2/+b12iBXhPA6l8/FMSML5hbMKGOdSCRHdTxsEAy2CQbnGPebBCyHJu6Qf3niy DwTJqDXCFVIQwWVa3xiNuvMkTL4UTvoXiOOmpvhB5xJ1P+fUoZm4kEFtxo95VWkxS/zG 76GJbjgh6d3WDYO4dVR/+YnGcGoHiyeUXnYrEkgHMgsqmXJDbFTZlVYyX/7kE3oQnfWB UWYQ== 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=o/UtUdgKopigNt8LJlpjVIj3a0GgNZXkDcPywW6ciek=; b=hDNhsqYjymC5/wCRJpAXNu8p1SGtf+H5sGEh/fUMZoHFUNqX08hbyBQx8ylDNuwmhj xw2oGX3V9ySlT/mVcJUqXpwIj3h1YmY/Em5OhVfIe/3LAgAlUaFaDWxNPRnnYXWQpaS/ oSWLD3Q4Q9Rl6y1V+lAzq2TsP9y2/YTZ1S1FQCpkRJdiZ81OIrQPv8/zPxBkCv1XlDoQ iGVe7exfexhIY+i8C1oz3OBOHpWQ9vvkSNWWro+taPSghXnFUuDm0e4CrHs5F4V3wxez jEePXnCAa6I5KS8f6En66AY46XJrTEtISN6sB7db7DPNSGFsdcNKGezwcncSSeqZlx9c 6PUA== 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 q66-v6si2276079pfd.153.2018.07.26.13.06.35; Thu, 26 Jul 2018 13:06:50 -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 S1731646AbeGZVX5 (ORCPT + 99 others); Thu, 26 Jul 2018 17:23:57 -0400 Received: from smtprelay0105.hostedemail.com ([216.40.44.105]:43515 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730285AbeGZVX4 (ORCPT ); Thu, 26 Jul 2018 17:23:56 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay01.hostedemail.com (Postfix) with ESMTP id E6AEE100E806B; Thu, 26 Jul 2018 20:05:31 +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:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1431:1437:1515:1516:1518:1534:1543:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2553:2559:2562:2828:2919:3138:3139:3140:3141:3142:3354:3622:3653:3865:3866:3867:3868:3870:3871:3872:3874:4321:5007:6120:7903:10004:10400:10848:10967:11026:11232:11658:11914:12043:12296:12438:12555:12663:12679:12740:12760:12895:13095:13161:13229:13255:13439:13972:14096:14097:14181:14659:14721:21080:21212:21365:21433:21451:21627:30054:30056:30070: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:25,LUA_SUMMARY:none X-HE-Tag: sink74_4d3b098418a54 X-Filterd-Recvd-Size: 4088 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf08.hostedemail.com (Postfix) with ESMTPA; Thu, 26 Jul 2018 20:05:30 +0000 (UTC) Message-ID: <00bf258587510ee96a27918293bd4d75622512c6.camel@perches.com> Subject: Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack From: Joe Perches To: Andrew Morton Cc: Andy Whitcroft , LKML Date: Thu, 26 Jul 2018 13:05:29 -0700 In-Reply-To: <20180726122807.fad0566951e36d930edb6874@linux-foundation.org> References: <1236369d28b2f1f5389ff652c4eb89e699e6481e.camel@perches.com> <20180726122533.104f6eea950853ef50ebc680@linux-foundation.org> <20180726122807.fad0566951e36d930edb6874@linux-foundation.org> 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 Thu, 2018-07-26 at 12:28 -0700, Andrew Morton wrote: > 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. RFC, No worries, I'll change it if it's OK. I'm testing it right now against the last 5000 commits (which takes awhile here) via $ git log --no-merges --format=oneline -5000 | \ cut -f1 -d" " | \ while read commit ; do \ echo $commit; \ ./scripts/checkpatch.pl --git $commit --types=aggregate_on_stack --quiet --no-summary ; \ done It doesn't seem noisy at all, but maybe there are a few known structs like "struct timespec64" that could be excluded. The only real hits so far are: commit f2fb56afba11426ee5c9603b28a9827c530909c0 WARNING: Unusual use of 'struct msm_display_topology' on stack #28374: FILE: drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c:149: +enum dpu_rm_topology_name +dpu_rm_get_topology_name(struct msm_display_topology topology) +{ WARNING: Unusual use of 'struct msm_display_topology' on stack #29021: FILE: drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c:796: +static int _dpu_rm_populate_requirements( + struct dpu_rm *rm, + struct drm_encoder *enc, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + struct dpu_rm_requirements *reqs, + struct msm_display_topology req_topology) +{ WARNING: Unusual use of 'struct msm_display_topology' on stack #29203: FILE: drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c:978: +int dpu_rm_reserve( + struct dpu_rm *rm, + struct drm_encoder *enc, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + struct msm_display_topology topology, + bool test_only) +{ WARNING: Unusual use of 'struct msm_display_topology' on stack #29443: FILE: drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h:133: +int dpu_rm_reserve(struct dpu_rm *rm, + struct drm_encoder *drm_enc, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + struct msm_display_topology topology, + bool test_only); WARNING: Unusual use of 'struct msm_display_topology' on stack #29506: FILE: drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h:196: +enum dpu_rm_topology_name +dpu_rm_get_topology_name(struct msm_display_topology topology); and 33477d84c26bbfa626da2c032e567a90dd70a528 WARNING: Unusual use of 'struct cppc_perf_fb_ctrs' on stack #45: FILE: drivers/cpufreq/cppc_cpufreq.c:307: +static int cppc_get_rate_from_fbctrs(struct cppc_cpudata *cpu, + struct cppc_perf_fb_ctrs fb_ctrs_t0, + struct cppc_perf_fb_ctrs fb_ctrs_t1) +{ WARNING: Unusual use of 'struct cppc_perf_fb_ctrs' on stack #45: FILE: drivers/cpufreq/cppc_cpufreq.c:307: +static int cppc_get_rate_from_fbctrs(struct cppc_cpudata *cpu, + struct cppc_perf_fb_ctrs fb_ctrs_t0, + struct cppc_perf_fb_ctrs fb_ctrs_t1) +{