From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751884AbaFOQ5w (ORCPT ); Sun, 15 Jun 2014 12:57:52 -0400 Received: from terminus.zytor.com ([198.137.202.10]:40680 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751609AbaFOQ5v (ORCPT ); Sun, 15 Jun 2014 12:57:51 -0400 Message-ID: <539DD04F.9020507@zytor.com> Date: Sun, 15 Jun 2014 09:56:47 -0700 From: "H. Peter Anvin" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Borislav Petkov , Vivek Goyal CC: linux-kernel@vger.kernel.org, kexec@lists.infradead.org, ebiederm@xmission.com, mjg59@srcf.ucam.org, greg@kroah.com, jkosina@suse.cz, dyoung@redhat.com, chaowang@redhat.com, bhe@redhat.com, akpm@linux-foundation.org Subject: Re: [PATCH 11/13] kexec-bzImage: Support for loading bzImage using 64bit entry References: <1401800822-27425-1-git-send-email-vgoyal@redhat.com> <1401800822-27425-12-git-send-email-vgoyal@redhat.com> <20140615163515.GA17016@pd.tnic> In-Reply-To: <20140615163515.GA17016@pd.tnic> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/15/2014 09:35 AM, Borislav Petkov wrote: > >> + if (memcmp((char *)&header->header, "HdrS", 4) != 0) { > > Not strncmp? "HdrS" is a string... > No, memcmp() is more appropriate. It is really more of a byte sequence than a string. It could just as easily be done as: header->header == 0x53726448 -hpa From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from terminus.zytor.com ([2001:1868:205::10] helo=mail.zytor.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WwDkS-0006IP-87 for kexec@lists.infradead.org; Sun, 15 Jun 2014 16:57:40 +0000 Message-ID: <539DD04F.9020507@zytor.com> Date: Sun, 15 Jun 2014 09:56:47 -0700 From: "H. Peter Anvin" MIME-Version: 1.0 Subject: Re: [PATCH 11/13] kexec-bzImage: Support for loading bzImage using 64bit entry References: <1401800822-27425-1-git-send-email-vgoyal@redhat.com> <1401800822-27425-12-git-send-email-vgoyal@redhat.com> <20140615163515.GA17016@pd.tnic> In-Reply-To: <20140615163515.GA17016@pd.tnic> 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: Borislav Petkov , Vivek Goyal Cc: mjg59@srcf.ucam.org, bhe@redhat.com, jkosina@suse.cz, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, ebiederm@xmission.com, greg@kroah.com, akpm@linux-foundation.org, dyoung@redhat.com, chaowang@redhat.com On 06/15/2014 09:35 AM, Borislav Petkov wrote: > >> + if (memcmp((char *)&header->header, "HdrS", 4) != 0) { > > Not strncmp? "HdrS" is a string... > No, memcmp() is more appropriate. It is really more of a byte sequence than a string. It could just as easily be done as: header->header == 0x53726448 -hpa _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec