From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751923AbcGMNDo (ORCPT ); Wed, 13 Jul 2016 09:03:44 -0400 Received: from smtp2.provo.novell.com ([137.65.250.81]:48414 "EHLO smtp2.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750923AbcGMNDg (ORCPT ); Wed, 13 Jul 2016 09:03:36 -0400 Date: Wed, 13 Jul 2016 15:03:22 +0200 From: Petr Tesarik To: Josh Triplett Cc: Juergen Gross , Ingo Molnar , Thomas Gleixner , Eric Biederman , "H. Peter Anvin" , Boris Ostrovsky , "Paul E. McKenney" , Dave Young , Andrew Morton , David Vrabel , "moderated list:XEN HYPERVISOR INTERFACE" , "maintainer:X86 ARCHITECTURE 32-BIT AND 64-BIT" , "open list:KEXEC" , open list Subject: Re: [PATCH 1/2] Add a kexec_crash_loaded() function Message-ID: <20160713150322.45d47ed4@hananiah.suse.cz> In-Reply-To: <20160713125232.GA32462@x> References: <20160713121950.14969.78606.stgit@hananiah.suse.cz> <20160713121955.14969.69080.stgit@hananiah.suse.cz> <20160713125232.GA32462@x> Organization: SUSE Linux X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.30; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 13 Jul 2016 05:52:33 -0700 Josh Triplett wrote: > On Wed, Jul 13, 2016 at 02:19:55PM +0200, Petr Tesarik wrote: > > --- a/kernel/kexec_core.c > > +++ b/kernel/kexec_core.c > > @@ -95,6 +95,12 @@ int kexec_should_crash(struct task_struct *p) > > return 0; > > } > > > > +int kexec_crash_loaded(void) > > +{ > > + return !!kexec_crash_image; > > +} > > Nit: this function should return bool rather than int, since it > effectively returns true/false. I thought about this for a moment. Since the return value should also be used for the corresponding sysctl, which is an integer, I wasn't sure if bool is the correct type, especially since other boolean functions in kexec.h also return int... But that could be legacy. I've got no problem changing the type to 'bool' if that's what it takes. Petr T