linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86,boot: standardize strcmp()
@ 2015-03-16 15:37 Arjun Sreedharan
  2015-03-16 18:16 ` Borislav Petkov
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Arjun Sreedharan @ 2015-03-16 15:37 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Thomas Gleixner, Ingo Molnar, x86, linux-kernel

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.

Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
---
 arch/x86/boot/string.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
index 493f3fd..318b846 100644
--- a/arch/x86/boot/string.c
+++ b/arch/x86/boot/string.c
@@ -30,7 +30,7 @@ int strcmp(const char *str1, const char *str2)
 	int delta = 0;
 
 	while (*s1 || *s2) {
-		delta = *s2 - *s1;
+		delta = *s1 - *s2;
 		if (delta)
 			return delta;
 		s1++;
-- 
1.8.1.msysgit.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-03-23 12:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-16 15:37 [PATCH] x86,boot: standardize strcmp() Arjun Sreedharan
2015-03-16 18:16 ` Borislav Petkov
2015-03-17  7:46 ` Ingo Molnar
2015-03-17 14:13   ` Arjun Sreedharan
2015-03-18  1:36     ` Bernd Petrovitsch
2015-03-18 18:10       ` Arjun Sreedharan
2015-03-18 18:37       ` Arjun Sreedharan
2015-03-19 17:34     ` H. Peter Anvin
2015-03-20 11:42       ` Bernd Petrovitsch
2015-03-17 14:28   ` Borislav Petkov
2015-03-23 12:23 ` [tip:x86/boot] x86/boot: Standardize strcmp() tip-bot for Arjun Sreedharan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).