From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752213AbbKJWRT (ORCPT ); Tue, 10 Nov 2015 17:17:19 -0500 Received: from smtprelay0076.hostedemail.com ([216.40.44.76]:49581 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751476AbbKJWRR (ORCPT ); Tue, 10 Nov 2015 17:17:17 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::,RULES_HIT:41:355:379:541:599:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2692:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:3872:3874:4321:5007:6119:6261:7903:8879:10004:10400:10848:11232:11658:11914:12517:12519:12663:12740:13069:13095:13180:13229:13311:13357:14096:14097:14659:21080:30012:30041:30054:30064:30075:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: frame33_79633602ee559 X-Filterd-Recvd-Size: 2440 Message-ID: <1447193832.2701.102.camel@perches.com> Subject: Re: [PATCH] video: constify geode ops structures From: Joe Perches To: Dan Carpenter Cc: Kees Cook , Christoph Hellwig , Julia Lawall , Jean-Christophe Plagniol-Villard , kernel-janitors@vger.kernel.org, Tomi Valkeinen , linux-geode@lists.infradead.org, linux-fbdev@vger.kernel.org, LKML Date: Tue, 10 Nov 2015 14:17:12 -0800 In-Reply-To: <20151110220244.GU7289@mwanda> References: <1447018493-20631-1-git-send-email-Julia.Lawall@lip6.fr> <20151108221624.GP18797@mwanda> <20151110063821.GA31014@infradead.org> <1447188569.2701.91.camel@perches.com> <20151110220244.GU7289@mwanda> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.16.5-1ubuntu3 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, 2015-11-11 at 01:02 +0300, Dan Carpenter wrote: > On Tue, Nov 10, 2015 at 12:49:29PM -0800, Joe Perches wrote: > > Is there a warning/info message produced by gcc and the > > plug-in when a non-const declaration is converted to > > const because of this attribute? > > I'm not sure I understand the question. What would the warning say? Perhaps something like: declaration of struct converted to const by __attribute__((do_const)) > We'll hopefully automatically make over 3000 structs const. I > understand warning that people should make structs const when possible > but I don't understand why we would want to remove auto consting? I'm not suggesting removing the attribute. It seems sensible enough. I just think the plug-in should at least optionally note the instances when non-const declarations are converted to const. > Putting __do_const in the .h file is basically the same as marking > every struct of that type as const in the .c file. Not for a reader of the code that doesn't first inspect the header files. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Perches Date: Tue, 10 Nov 2015 22:17:12 +0000 Subject: Re: [PATCH] video: constify geode ops structures Message-Id: <1447193832.2701.102.camel@perches.com> List-Id: References: <1447018493-20631-1-git-send-email-Julia.Lawall@lip6.fr> <20151108221624.GP18797@mwanda> <20151110063821.GA31014@infradead.org> <1447188569.2701.91.camel@perches.com> <20151110220244.GU7289@mwanda> In-Reply-To: <20151110220244.GU7289@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dan Carpenter Cc: Kees Cook , Christoph Hellwig , Julia Lawall , Jean-Christophe Plagniol-Villard , kernel-janitors@vger.kernel.org, Tomi Valkeinen , linux-geode@lists.infradead.org, linux-fbdev@vger.kernel.org, LKML On Wed, 2015-11-11 at 01:02 +0300, Dan Carpenter wrote: > On Tue, Nov 10, 2015 at 12:49:29PM -0800, Joe Perches wrote: > > Is there a warning/info message produced by gcc and the > > plug-in when a non-const declaration is converted to > > const because of this attribute? > > I'm not sure I understand the question. What would the warning say? Perhaps something like: declaration of struct converted to const by __attribute__((do_const)) > We'll hopefully automatically make over 3000 structs const. I > understand warning that people should make structs const when possible > but I don't understand why we would want to remove auto consting? I'm not suggesting removing the attribute. It seems sensible enough. I just think the plug-in should at least optionally note the instances when non-const declarations are converted to const. > Putting __do_const in the .h file is basically the same as marking > every struct of that type as const in the .c file. Not for a reader of the code that doesn't first inspect the header files.