From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756711AbcAJBGJ (ORCPT ); Sat, 9 Jan 2016 20:06:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44032 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753755AbcAJBGI (ORCPT ); Sat, 9 Jan 2016 20:06:08 -0500 Date: Sun, 10 Jan 2016 09:08:51 +0800 From: Minfei Huang To: Xunlei Pang Cc: Petr Tesarik , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, ebiederm@xmission.com, akpm@linux-foundation.org, Dave Young , Vivek Goyal Subject: Re: [PATCH v3 2/2] kexec: Provide arch_kexec_protect(unprotect)_crashkres() Message-ID: <20160110010851.GA19773@dhcp-128-25.nay.redhat.com> References: <1452220423-4733-1-git-send-email-xlpang@redhat.com> <1452220423-4733-2-git-send-email-xlpang@redhat.com> <20160108084741.GB6295@dhcp-128-25.nay.redhat.com> <568FB964.7030705@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <568FB964.7030705@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/08/16 at 09:28pm, Xunlei Pang wrote: > On 01/08/2016 at 04:47 PM, Minfei Huang wrote: > > On 01/08/16 at 10:33am, Xunlei Pang wrote: > >> + > >> +static int > >> +kexec_mark_range(unsigned long start, unsigned long end, bool protect) > >> +{ > >> + struct page *page; > >> + unsigned int nr_pages; > >> + > >> + /* For physical range: [start, end] */ > >> + if (!end || start > end) > >> + return 0; > > This test !end is hard to be understood without the annotation. It is > > better to add the comment about it. > > !end is just for uninitialized crashk resource with a zero end member, > maybe not so hard to understand :-) Yes, The test !end may be simple, if someone knows the logic of kexec. But it's hard to be understood, if there is only a glance from someone without any annotation. This test !end is related to the specific code flow, so it is better to annotate it. Thanks Minfei > > Regards, > Xunlei > > > > > Otherwise it looks good for me.