Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2158235imm; Sat, 28 Jul 2018 10:25:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeynqMaTFC98C/GdVu4eI66Y2rmEMmQVt9bhNF7kXBzvcdZa0Dd58ApE+dglmizFdwZGaHM X-Received: by 2002:a63:6949:: with SMTP id e70-v6mr10686461pgc.119.1532798750525; Sat, 28 Jul 2018 10:25:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532798750; cv=none; d=google.com; s=arc-20160816; b=nzr2vKILC61H4vLDxhkt2db5bK5i8+21ttUi3KLYFAPhbUtP1nKwpJ/hdK0Ggd4vsC liQd8w6OH2LVPUQ6vL9xPNMyMOqDil8eFRTdBujH+IeDFYocJE21r9gakHhrQUeN0H7c xtBCg0/YOoRXpxd/FjnjuOguO6XtYGwNCmcRYdhO2Hn9uJe3dLVZEZBivchZOIdMbz4d ojTepD6FGhA41gfGEto10B+QaNLNdoX0zGr2NImrgGrc32kSBbH+siCUlk57FtIcWRSH P0kN3kIWnKrnzu3FuAvy2zCjAQrOo//O6XG0cEYXb+2YPNFIxneNopP59UDwfctNqOZX bJRg== 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=XJv7IOK8r/L0743m97G3KUCkEUnChSQ3nuWr7nNkBvk=; b=IQMioUpRczfG8K7GpJ+9I94w4ZXrlq4tzTe11f4iGzoockjUwO7CVZFu19VvLiLdAl cEE9ElmCZzmDoQAGbrRrWKAuLNVIWFsimLIlDqJ/o+Eei6ZrGsUUuAB7rlQwVHQxk4Qh 0cYzmnO4Hh/JLdrX4aAiO66rjkRpS2cKnhj273N+uvk+DIBRuOg3yT6IqJIADaE2c1M5 7b0XHPgRUO5psSZn/af0pyB/RWRR11wWApwXwzyzP0MzOzI4BzGYEy/eJarbhve4EyR5 ncWmHEuoQYVrt7YtMfre25AyXOduOkgqC6qTV9Pr2IKHfQ4Ym0SVpBgDfV0yVIkO0CW5 qVLQ== 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 o126-v6si6814570pfb.20.2018.07.28.10.25.35; Sat, 28 Jul 2018 10:25: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 S1729537AbeG1SwB (ORCPT + 99 others); Sat, 28 Jul 2018 14:52:01 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:51874 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729517AbeG1SwB (ORCPT ); Sat, 28 Jul 2018 14:52:01 -0400 X-IronPort-AV: E=Sophos;i="5.51,414,1526335200"; d="scan'208";a="340597717" 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 19:24:48 +0200 Date: Sat, 28 Jul 2018 19:24:48 +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: <6439210644b66a1847e6fad9205fcc7056319de1.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> <6439210644b66a1847e6fad9205fcc7056319de1.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 Sat, 28 Jul 2018, Joe Perches wrote: > On Sat, 2018-07-28 at 08:25 +0200, Julia Lawall wrote: > > On Fri, 27 Jul 2018, Joe Perches wrote: > [] > > > 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 > > Perhaps this might be the most useful to check. > > > or at least 3 fields is worth reporting on? > > a struct with 3 chars or bools might be faster > by value, but maybe for structs with arrays or > other structs. > > For instance: > > lib/vsprintf.c uses struct printf_spec which > is 16 bytes and that fits nicely in a This message seems to be cut off. I got around 70 results, of which 23 are from vsprintf. Perhaps the simplest would be to print the structure declaration with the warning message, so the user could easily check the results. julia