public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Xie XiuQi <xiexiuqi@huawei.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Borislav Petkov <bp@suse.de>, <akpm@linux-foundation.org>,
	<n-horiguchi@ah.jp.nec.com>, <gong.chen@linux.intel.com>,
	<bhelgaas@google.com>, <tony.luck@intel.com>,
	<linux-kernel@vger.kernel.org>, <jingle.chen@huawei.com>
Subject: Re: [PATCH] trace, RAS: remove unnecessary const
Date: Fri, 20 Mar 2015 12:05:34 +0800	[thread overview]
Message-ID: <550B9C8E.9090106@huawei.com> (raw)
In-Reply-To: <20150319090002.1ba09905@gandalf.local.home>

On 2015/3/19 21:00, Steven Rostedt wrote:
> On Thu, 19 Mar 2015 19:57:17 +0800
> Xie XiuQi <xiexiuqi@huawei.com> 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
> 
> .
> 



  reply	other threads:[~2015-03-20  4:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19  8:50 [PATCH] trace, RAS: remove unnecessary const Xie XiuQi
2015-03-19 10:33 ` Borislav Petkov
2015-03-19 11:57   ` Xie XiuQi
2015-03-19 13:00     ` Steven Rostedt
2015-03-20  4:05       ` Xie XiuQi [this message]
2015-03-19 12:57   ` Steven Rostedt
2015-03-19 13:10     ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=550B9C8E.9090106@huawei.com \
    --to=xiexiuqi@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhelgaas@google.com \
    --cc=bp@suse.de \
    --cc=gong.chen@linux.intel.com \
    --cc=jingle.chen@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=rostedt@goodmis.org \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox