From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ctbs9-0003Kz-98 for qemu-devel@nongnu.org; Thu, 30 Mar 2017 11:20:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ctbs4-00029i-AQ for qemu-devel@nongnu.org; Thu, 30 Mar 2017 11:20:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44966) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ctbs4-00028P-3g for qemu-devel@nongnu.org; Thu, 30 Mar 2017 11:20:20 -0400 References: <20170330145719.12068-1-shah.suramya@gmail.com> From: Marcel Apfelbaum Message-ID: Date: Thu, 30 Mar 2017 18:20:11 +0300 MIME-Version: 1.0 In-Reply-To: <20170330145719.12068-1-shah.suramya@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] hw/unicore32: fix a kernel_filename!=NULL assertion error in puv3.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Suramya Shah , qemu-devel@nongnu.org On 03/30/2017 05:57 PM, Suramya Shah wrote: > Signed-off-by: Suramya Shah Hi, Thank you for contributing to QEMU project. I suggest to avoid details in the subject, use something like: "hw/unicore32: remove wrong assertion in puv machine init" > --- > Running QEMU with qemu-system-unicore32 without the kernel parameter results in an assertion error. The description should appear before the "---" separator. The patch cannot be applied. Please use git format-patch to prepare the patch. Please run ./scripts/checkpatch.pl before sending the patch. > Fix this by.. This is not enough for a description. Try to briefly explain how/why you fixed it. "Assert should not be used to check user provided parameters. Report an error and exit instead" Thanks, Marcel > hw/unicore32/puv3.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c > index 032078f..2c17cc9 100644 > --- a/hw/unicore32/puv3.c > +++ b/hw/unicore32/puv3.c > @@ -93,8 +93,11 @@ static void puv3_load_kernel(const char *kernel_filename) > if (kernel_filename == NULL && qtest_enabled()) { > return; > } > - assert(kernel_filename != NULL); > - > + if (kernel_filename == NULL) { > + error_report("No kernel found"); > + exit(1); > + } > + > /* only zImage format supported */ > size = load_image_targphys(kernel_filename, KERNEL_LOAD_ADDR, > KERNEL_MAX_SIZE); >