From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755648AbdJRLtw (ORCPT ); Wed, 18 Oct 2017 07:49:52 -0400 Received: from smtprelay0174.hostedemail.com ([216.40.44.174]:36709 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754386AbdJRLtt (ORCPT ); Wed, 18 Oct 2017 07:49:49 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:988:989:1042:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:2899:3138:3139:3140:3141:3142:3352:3622:3865:3867:3870:3871:3873:4321:4605:5007:6742:10004:10400:10559:10848:11232:11658:11914:12043:12740:12760:12895:13069:13161:13229:13311:13357:13439:14181:14659:14819:21080:21451:21627:30012:30054:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: jeans65_37fdd5ae1e131 X-Filterd-Recvd-Size: 3145 Message-ID: <1508327383.6806.7.camel@perches.com> Subject: Re: Adjusting further size determinations? From: Joe Perches To: SF Markus Elfring , linux-integrity@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Cc: Julia Lawall , Alexander.Steffen@infineon.com, James Bottomley , Dan Carpenter , Jarkko Sakkinen , Andy Shevchenko , Benjamin Herrenschmidt , Corentin Labbe , Jason Gunthorpe , Jerry Snitselaar , Kenneth Goldman , Michael Ellerman , Nayna Jain , Paul Mackerras , Peter =?ISO-8859-1?Q?H=FCwe?= , Stefan Berger , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Date: Wed, 18 Oct 2017 04:49:43 -0700 In-Reply-To: References: <1d3516a2-a8e6-9e95-d438-f115fac84c7f@users.sourceforge.net> <20171016183139.otyh3m5c5yurtmow@linux.intel.com> <20171016183512.3bz6x4b6lbhpbkje@linux.intel.com> <20171017085124.pkrjzghcf5wmcydc@mwanda> <1508255833.3129.33.camel@HansenPartnership.com> <1508280210.6530.32.camel@perches.com> <1508318326.6806.1.camel@perches.com> <026d582729b849b780fbaa06fb8bc79e@infineon.com> <1508322510.6806.3.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2017-10-18 at 13:00 +0200, SF Markus Elfring wrote: > > Ugly grep follows: > > > > $ grep -rohP --include=*.[ch] "\w+\s*=\s*[kv].alloc\s*\(\s*sizeof.*," * | \ > > sed -r -e 's/(\w+)\s*=\s*[kv].alloc\s*\(\s*sizeof\s*\(\s*\*\s*\1\s*\)/foo = k.alloc(sizeof(*foo))/' \ > > -e 's/(\w+)\s*=\s*[kv].alloc\s*\(\s*sizeof\s*\(\s*struct\s+\w+\s*\)/foo = k.alloc(sizeof(struct foo))/' | \ > > sort | uniq -c | sort -rn | head -2 > > 6123 foo = k.alloc(sizeof(*foo)), > > 3060 foo = k.alloc(sizeof(struct foo)), > > Would you like to get this ratio changed in any ways? No. > Available development tools could help to improve the software situation > in a desired direction, couldn't they? > > > Unpleasant consequences are possible in both cases. > How much do you care to reduce the failure probability further? Zero. The alloc style is trivially useful for new code. Existing code doesn't need change.