From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754348AbbCSNAI (ORCPT ); Thu, 19 Mar 2015 09:00:08 -0400 Received: from smtprelay0065.hostedemail.com ([216.40.44.65]:44751 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751351AbbCSNAF convert rfc822-to-8bit (ORCPT ); Thu, 19 Mar 2015 09:00:05 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::,RULES_HIT:41:152:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1513:1515:1516:1518:1521:1534:1540:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:3138:3139:3140:3141:3142:3167:3352:3622:3865:3866:3867:3868:3870:3871:3874:5007:6261:7875:7903:8957:9040:10004:10400:10848:10967:11026:11232:11658:11914:12043:12438:12517:12519:12740:13069:13161:13229:13311:13357:21080,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 X-HE-Tag: straw95_905a3ffbc0f X-Filterd-Recvd-Size: 1943 Date: Thu, 19 Mar 2015 09:00:02 -0400 From: Steven Rostedt To: Xie XiuQi Cc: Borislav Petkov , , , , , , , Subject: Re: [PATCH] trace, RAS: remove unnecessary const Message-ID: <20150319090002.1ba09905@gandalf.local.home> In-Reply-To: <550AB99D.5010006@huawei.com> References: <1426755004-28434-1-git-send-email-xiexiuqi@huawei.com> <20150319103330.GC11544@pd.tnic> <550AB99D.5010006@huawei.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 19 Mar 2015 19:57:17 +0800 Xie XiuQi wrote: > On 2015/3/19 18:33, Borislav Petkov wrote: > > On Thu, Mar 19, 2015 at 04:50:04PM +0800, Xie XiuQi wrote: > >> These parameters are passed by value. There's no need to make them const. > > > > I can think of a reason: > > > > include/trace/../../include/ras/ras_event.h: In function ‘ftrace_raw_event_mc_event’: > > include/trace/../../include/ras/ras_event.h:136:35: error: assignment of read-only parameter ‘top_layer’ > > __entry->top_layer = top_layer = 12; > > Oh, indeed. Thanks, Boris! > Don't get too excited about that answer. If this is indeed the case, then all functions with parameters that do not get modify later should be set to const. Do we really want that? And how does this fix: __entry->top_layer = 12; -- Steve