Skip to contentSkip to conversation

clean-up: fixes "unsigned>=0" warning

PATCH In review Riina Kikas 2 participants 3 messages Dec 6, 2004 NTFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clean-up: fixes "unsigned>=0" warning

This patch fixes warning "comparison of unsigned expression >= 0 is always true" occuring on line 38

fs/ntfs/collate.h +1 -1
@@ -37,7 +37,7 @@
 	if (unlikely(cr != COLLATION_BINARY && cr != COLLATION_NTOFS_ULONG))
 		return FALSE;
 	i = le32_to_cpu(cr);
-	if (likely(((i >= 0) && (i <= 0x02)) ||
+	if (likely(cr <= 0x02 ||
 			((i >= 0x10) && (i <= 0x13))))
 		return TRUE;
 	return FALSE;
#1 lore raw

fs/ntfs/collate.h 2004-12-04 13:26:03.000000000 +0000 line 40

Quoted 13 lines · Riina Kikas

This patch fixes warning "comparison of unsigned expression >= 0 is always true" occuring on line 38

fs/ntfs/collate.h 2004-12-04 13:26:03.000000000 +0000 renamed from fs/ntfs/collate.h 2004-10-18 21:53:06.000000000 +0000 +1 -1
@@ -37,7 +37,7 @@
     if (unlikely(cr != COLLATION_BINARY && cr != COLLATION_NTOFS_ULONG))
         return FALSE;
     i = le32_to_cpu(cr);
-    if (likely(((i >= 0) && (i <= 0x02)) ||
+    if (likely(cr <= 0x02 ||

Do we really want to be doing any operations on "cr", since it's not known what endianness of cpu we're on?

Chris

#2 lore raw

Seems that this one has been fixed somewhere between 2.6.8 and 2.6.9, so it doesn't need to be fixed any more. Sorry for that.

Riina

Quoted 20 lines · Chris Friesen
Quoted 8 lines · Riina Kikas

This patch fixes warning "comparison of unsigned expression >= 0 is always true" occuring on line 38

fs/ntfs/collate.h 2004-12-04 13:26:03.000000000 +0000 line 41

Quoted 6 lines
fs/ntfs/collate.h 2004-12-04 13:26:03.000000000 +0000 renamed from fs/ntfs/collate.h 2004-10-18 21:53:06.000000000 +0000 +1 -1
@@ -37,7 +37,7 @@
     if (unlikely(cr != COLLATION_BINARY && cr != 
 COLLATION_NTOFS_ULONG))
         return FALSE;
     i = le32_to_cpu(cr);
-    if (likely(((i >= 0) && (i <= 0x02)) ||
+    if (likely(cr <= 0x02 ||

Do we really want to be doing any operations on "cr", since it's not known what endianness of cpu we're on?

Chris