From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752423AbbCQHqR (ORCPT ); Tue, 17 Mar 2015 03:46:17 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:34197 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751268AbbCQHqO (ORCPT ); Tue, 17 Mar 2015 03:46:14 -0400 Date: Tue, 17 Mar 2015 08:46:08 +0100 From: Ingo Molnar To: Arjun Sreedharan Cc: "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86,boot: standardize strcmp() Message-ID: <20150317074608.GB27687@gmail.com> References: <1426520267-1803-1-git-send-email-arjun024@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1426520267-1803-1-git-send-email-arjun024@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Arjun Sreedharan wrote: > strcmp() is always expected to return 0 when args are > same, <0 when arg1 is lesser and >0 otherwise. > Previously strcmp("a","b") returned 1. Now it gives -1. I'd also add the following to the changelog: Until now this bug never triggered, because all uses for strcmp() in the boot code tested for nonzero: triton:~/tip> git grep strcmp arch/x86/boot/ arch/x86/boot/boot.h:int strcmp(const char *str1, const char *str2); arch/x86/boot/edd.c: if (!strcmp(eddarg, "skipmbr") || !strcmp(eddarg, "skip")) { arch/x86/boot/edd.c: else if (!strcmp(eddarg, "off")) arch/x86/boot/edd.c: else if (!strcmp(eddarg, "on")) should in the future strcmp() be used in a comparative way in the boot code, it might have led to (not so subtle) bugs. Thanks, Ingo