From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aHX5l-0008Jk-Oy for kexec@lists.infradead.org; Fri, 08 Jan 2016 13:28:34 +0000 Subject: Re: [PATCH v3 2/2] kexec: Provide arch_kexec_protect(unprotect)_crashkres() 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> From: Xunlei Pang Message-ID: <568FB964.7030705@redhat.com> Date: Fri, 8 Jan 2016 21:28:04 +0800 MIME-Version: 1.0 In-Reply-To: <20160108084741.GB6295@dhcp-128-25.nay.redhat.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Minfei Huang Cc: Petr Tesarik , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, ebiederm@xmission.com, akpm@linux-foundation.org, Dave Young , Vivek Goyal 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 :-) Regards, Xunlei > > Otherwise it looks good for me. > > Thanks > Minfei > > _______________________________________________ > kexec mailing list > kexec@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/kexec _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751777AbcAHN2O (ORCPT ); Fri, 8 Jan 2016 08:28:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45976 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750785AbcAHN2N (ORCPT ); Fri, 8 Jan 2016 08:28:13 -0500 Subject: Re: [PATCH v3 2/2] kexec: Provide arch_kexec_protect(unprotect)_crashkres() To: Minfei Huang 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> Cc: Petr Tesarik , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, ebiederm@xmission.com, akpm@linux-foundation.org, Dave Young , Vivek Goyal From: Xunlei Pang Message-ID: <568FB964.7030705@redhat.com> Date: Fri, 8 Jan 2016 21:28:04 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20160108084741.GB6295@dhcp-128-25.nay.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 :-) Regards, Xunlei > > Otherwise it looks good for me. > > Thanks > Minfei > > _______________________________________________ > kexec mailing list > kexec@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/kexec