Skip to content

Commit 91fbc6e

Browse files
NTFS: Fix sparse warnings that have crept in over time.
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
1 parent efb0372 commit 91fbc6e

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎fs/ntfs/ChangeLog‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ ToDo/Notes:
2222
- Enable the code for setting the NT4 compatibility flag when we start
2323
making NTFS 1.2 specific modifications.
2424

25+
2.1.25-WIP
26+
27+
- Fix sparse warnings that have crept in over time.
28+
2529
2.1.24 - Lots of bug fixes and support more clean journal states.
2630

2731
- Support journals ($LogFile) which have been modified by chkdsk. This

‎fs/ntfs/layout.h‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,13 @@ typedef u64 MFT_REF;
317317
typedef le64 leMFT_REF;
318318

319319
#define MK_MREF(m, s) ((MFT_REF)(((MFT_REF)(s) << 48) | \
320-
((MFT_REF)(m) & MFT_REF_MASK_CPU)))
320+
((MFT_REF)(m) & (u64)MFT_REF_MASK_CPU)))
321321
#define MK_LE_MREF(m, s) cpu_to_le64(MK_MREF(m, s))
322322

323-
#define MREF(x) ((unsigned long)((x) & MFT_REF_MASK_CPU))
323+
#define MREF(x) ((unsigned long)((x) & (u64)MFT_REF_MASK_CPU))
324324
#define MSEQNO(x) ((u16)(((x) >> 48) & 0xffff))
325-
#define MREF_LE(x) ((unsigned long)(le64_to_cpu(x) & MFT_REF_MASK_CPU))
325+
#define MREF_LE(x) ((unsigned long)(le64_to_cpu(x) & \
326+
(u64)MFT_REF_MASK_CPU))
326327
#define MSEQNO_LE(x) ((u16)((le64_to_cpu(x) >> 48) & 0xffff))
327328

328329
#define IS_ERR_MREF(x) (((x) & 0x0000800000000000ULL) ? 1 : 0)

‎fs/ntfs/logfile.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ typedef struct {
113113
*/
114114
enum {
115115
RESTART_VOLUME_IS_CLEAN = const_cpu_to_le16(0x0002),
116-
RESTART_SPACE_FILLER = 0xffff, /* gcc: Force enum bit width to 16. */
116+
RESTART_SPACE_FILLER = const_cpu_to_le16(0xffff), /* gcc: Force enum bit width to 16. */
117117
} __attribute__ ((__packed__));
118118

119119
typedef le16 RESTART_AREA_FLAGS;

0 commit comments

Comments
 (0)