Skip to contentSkip to conversation

NTFS sparc compile fix

PATCH In review Anton Altaparmakov 2 participants 2 messages Nov 3, 2001 – Nov 19, 2001

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NTFS sparc compile fix

Linus, Alan,

Please apply below patchlet for your next releases (applies cleanly to any recent kernel). It fixes compilation of NTFS driver on Sparc.

Thanks to Jan-Benedict Glaw for reporting and testing.

Best regards,

Anton

Signature · 39 lines
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Linux NTFS maintainer / WWW: http://linux-ntfs.sf.net/
ICQ: 8561279 / WWW: http://www-stu.christs.cam.ac.uk/~aia21/

--- ntfs-sparc.diff ---

diff -u -urN linux-2.4.14-pre7-vanilla/fs/ntfs/dir.c linux-2.4.14-pre7-ntfs/fs/ntfs/dir.c
--- linux-2.4.14-pre7-vanilla/fs/ntfs/dir.c	Wed Sep 12 01:02:46 2001
+++ linux-2.4.14-pre7-ntfs/fs/ntfs/dir.c	Sat Nov  3 17:56:40 2001
@@ -19,6 +19,7 @@
 #include "support.h"
 #include "util.h"
 #include <linux/smp_lock.h>
+#include <linux/bitops.h>
 
 static char I30[] = "$I30";
 
diff -u -urN linux-2.4.14-pre7-vanilla/include/linux/ntfs_fs.h linux-2.4.14-pre7-ntfs/include/linux/ntfs_fs.h
--- linux-2.4.14-pre7-vanilla/include/linux/ntfs_fs.h	Sat Sep  8 20:24:40 2001
+++ linux-2.4.14-pre7-ntfs/include/linux/ntfs_fs.h	Sat Nov  3 16:43:03 2001
@@ -10,12 +10,12 @@
  * Attribute flags (16-bit).
  */
 typedef enum {
-	ATTR_IS_COMPRESSED      = cpu_to_le16(0x0001),
-	ATTR_COMPRESSION_MASK   = cpu_to_le16(0x00ff),  /* Compression method
-							 * mask. Also, first
-							 * illegal value. */
-	ATTR_IS_ENCRYPTED       = cpu_to_le16(0x4000),
-	ATTR_IS_SPARSE          = cpu_to_le16(0x8000),
+	ATTR_IS_COMPRESSED      = __constant_cpu_to_le16(0x0001),
+	ATTR_COMPRESSION_MASK   = __constant_cpu_to_le16(0x00ff),
+					/* Compression method mask. Also,
+					 * first illegal value. */
+	ATTR_IS_ENCRYPTED       = __constant_cpu_to_le16(0x4000),
+	ATTR_IS_SPARSE          = __constant_cpu_to_le16(0x8000),
 } __attribute__ ((__packed__)) ATTR_FLAGS;
 
 /*
#1 lore raw
Quoted 2 lines

Please apply below patchlet for your next releases (applies cleanly to any recent kernel). It fixes compilation of NTFS driver on Sparc.

...

Review

Quoted 2 lines
(quoted diff) +2 -0
+	ATTR_IS_ENCRYPTED       = __constant_cpu_to_le16(0x4000),
+	ATTR_IS_SPARSE          = __constant_cpu_to_le16(0x8000),

Can't SPARC be fixed with something like __builtin_constant_p() ? It sure looks ugly to need __constant_cpu_to_le16() in a driver.