Skip to content

Commit

Permalink
fs/ntfs3: Add ifndef + define to all header files
Browse files Browse the repository at this point in the history
Add guards so that compiler will only include header files once.

Signed-off-by: Kari Argillander <kari.argillander@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
  • Loading branch information
teksturi authored and xanmod committed Aug 31, 2021
1 parent cfab079 commit 9457b12
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fs/ntfs3/debug.h
Expand Up @@ -7,6 +7,9 @@
*/

// clang-format off
#ifndef _LINUX_NTFS3_DEBUG_H
#define _LINUX_NTFS3_DEBUG_H

#ifndef Add2Ptr
#define Add2Ptr(P, I) ((void *)((u8 *)(P) + (I)))
#define PtrOffset(B, O) ((size_t)((size_t)(O) - (size_t)(B)))
Expand Down Expand Up @@ -61,4 +64,6 @@ void ntfs_inode_printk(struct inode *inode, const char *fmt, ...)
#define ntfs_free(p) kfree(p)
#define ntfs_vfree(p) kvfree(p)
#define ntfs_memdup(src, len) kmemdup(src, len, GFP_NOFS)

#endif /* _LINUX_NTFS3_DEBUG_H */
// clang-format on
3 changes: 3 additions & 0 deletions fs/ntfs3/ntfs.h
Expand Up @@ -7,6 +7,8 @@
*/

// clang-format off
#ifndef _LINUX_NTFS3_NTFS_H
#define _LINUX_NTFS3_NTFS_H

/* TODO:
* - Check 4K mft record and 512 bytes cluster
Expand Down Expand Up @@ -1235,4 +1237,5 @@ struct SID {
};
static_assert(offsetof(struct SID, SubAuthority) == 8);

#endif /* _LINUX_NTFS3_NTFS_H */
// clang-format on
5 changes: 5 additions & 0 deletions fs/ntfs3/ntfs_fs.h
Expand Up @@ -6,6 +6,9 @@
*/

// clang-format off
#ifndef _LINUX_NTFS3_NTFS_FS_H
#define _LINUX_NTFS3_NTFS_FS_H

#define MINUS_ONE_T ((size_t)(-1))
/* Biggest MFT / smallest cluster */
#define MAXIMUM_BYTES_PER_MFT 4096
Expand Down Expand Up @@ -1085,3 +1088,5 @@ static inline void le64_sub_cpu(__le64 *var, u64 val)
{
*var = cpu_to_le64(le64_to_cpu(*var) - val);
}

#endif /* _LINUX_NTFS3_NTFS_FS_H */

0 comments on commit 9457b12

Please sign in to comment.