Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp47591imm; Thu, 26 Jul 2018 13:40:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpewIeLaNkMuZ6XctqNKRknnfZh4cgCvpc4AZ/w//yki7q3yU3HPqSJc/WFgrs06U2i0TXTB X-Received: by 2002:a62:129a:: with SMTP id 26-v6mr3647636pfs.102.1532637626317; Thu, 26 Jul 2018 13:40:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532637626; cv=none; d=google.com; s=arc-20160816; b=CBMoq1SqXrNwvDw0g9wpWNRfVfs9ZObKy/wk/xdWGM+y6rR7mcwCuaBiaKVJdD4QL0 WYnDIynDp6TZ3TvpuD3hNBK/ztl60P5TSirv3Z4pgW/k35axdbBZLVNCChpKtpFAOM6y NSpuyMfkRTf46EtqaHPPzWhKNpi/r4nHsJIGjxjdkpOppw8de6OQ0GaWb1KP8jR+2Zzo 6arcnIWdL19pwo0ufe35AoeMlo98PdYFVU/vczrxsHPYD8DWpsqg/c46dRgxbOyOX3O/ efVzjNdKVZp7nq8r2Pj3n4PPZqq6TpAxuaiO6A0zi6rKqe9XGeb6IWrdc3+JTEmi/8h6 6W1Q== 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:message-id:subject:cc:to:from:date :arc-authentication-results; bh=J/1cAJrTPscNZ3ejg4d/Ysrrfgb6fxfXewEK2cLheak=; b=wcG1H/RcE7rKv/xbz+Is8K2sr9J7NgHeAXr9ftL3atW13LLi4MAq81rIVq+O/R86d0 eOr7gumB5BxvWuLvQkVa5Km5VmDZ/GvUoavSk+troGCH3n9pFklw4PiF3H3JZvNfPaCr LeefgcQ4Ur4eSmB6JWG4T50JBg7GIYSA+O7Nubz4y3nAuHxOxm2O6qSOzoM8CKBGKB+U NN80ckWOLBGUWN4upSg0eCBr+Cbza4NdF9i1yo1h/ChXhCe8mRTByz6XSAzy3vK5MAve cSb72p3CUxqOy6mFSNugl1VA49Rj5+WyX+KF7KfvnwTC9vK7vwNC02tUI13008Ciwlg8 2aXw== 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 h69-v6si2157093pfc.206.2018.07.26.13.39.57; Thu, 26 Jul 2018 13:40:26 -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 S1731321AbeGZV5B (ORCPT + 99 others); Thu, 26 Jul 2018 17:57:01 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45262 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730533AbeGZV5B (ORCPT ); Thu, 26 Jul 2018 17:57:01 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.9.92]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 0DF4340B; Thu, 26 Jul 2018 20:38:30 +0000 (UTC) Date: Thu, 26 Jul 2018 13:38:29 -0700 From: Andrew Morton To: Joe Perches Cc: Andy Whitcroft , LKML Subject: Re: [RFC PATCH] checkpatch: check for function calls with struct or union on stack Message-Id: <20180726133829.bbe2677217f905c5df11d2d6@linux-foundation.org> In-Reply-To: <00bf258587510ee96a27918293bd4d75622512c6.camel@perches.com> References: <1236369d28b2f1f5389ff652c4eb89e699e6481e.camel@perches.com> <20180726122533.104f6eea950853ef50ebc680@linux-foundation.org> <20180726122807.fad0566951e36d930edb6874@linux-foundation.org> <00bf258587510ee96a27918293bd4d75622512c6.camel@perches.com> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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, 26 Jul 2018 13:05:29 -0700 Joe Perches wrote: > 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) > +{ hm. 12 bytes. I don't know if this would be more efficient than using const struct msm_display_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) > +{ Two 32-byte structures? That seems excessive. Yes, a warning which sends developers back for a bit more thinnking sounds useful.