From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751150AbbCTEGG (ORCPT ); Fri, 20 Mar 2015 00:06:06 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:48030 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750764AbbCTEGD (ORCPT ); Fri, 20 Mar 2015 00:06:03 -0400 Message-ID: <550B9C8E.9090106@huawei.com> Date: Fri, 20 Mar 2015 12:05:34 +0800 From: Xie XiuQi User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Steven Rostedt CC: Borislav Petkov , , , , , , , Subject: Re: [PATCH] trace, RAS: remove unnecessary const References: <1426755004-28434-1-git-send-email-xiexiuqi@huawei.com> <20150319103330.GC11544@pd.tnic> <550AB99D.5010006@huawei.com> <20150319090002.1ba09905@gandalf.local.home> In-Reply-To: <20150319090002.1ba09905@gandalf.local.home> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.177.17.191] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.550B9C9E.0172,ss=1,re=0.001,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 63db1eb682d0dbe2fa2222461f984b47 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2015/3/19 21:00, Steven Rostedt wrote: > 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; Yes, I agree. I've retrieved the entire kernel source tree, and did not find elsewhere such usage. Both sounds reasonable. Now, I've no idea about this patch. Thanks Steve and Boris! -- Xie XiuQi > > -- Steve > > . >