Skip to content

Commit b28b08d

Browse files
Jérôme Glissetorvalds
authored andcommitted
mm/hmm: fix header file if/else/endif maze
The #if/#else/#endif for IS_ENABLED(CONFIG_HMM) were wrong. Because of this after multiple include there was multiple definition of both hmm_mm_init() and hmm_mm_destroy() leading to build failure if HMM was enabled (CONFIG_HMM set). Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Jérôme Glisse <[email protected]> Acked-by: Balbir Singh <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Ralph Campbell <[email protected]> Cc: John Hubbard <[email protected]> Cc: Evgeny Baskakov <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 76ea470 commit b28b08d

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

include/linux/hmm.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -498,23 +498,16 @@ struct hmm_device {
498498
struct hmm_device *hmm_device_new(void *drvdata);
499499
void hmm_device_put(struct hmm_device *hmm_device);
500500
#endif /* CONFIG_DEVICE_PRIVATE || CONFIG_DEVICE_PUBLIC */
501-
#endif /* IS_ENABLED(CONFIG_HMM) */
502501

503502
/* Below are for HMM internal use only! Not to be used by device driver! */
504-
#if IS_ENABLED(CONFIG_HMM_MIRROR)
505503
void hmm_mm_destroy(struct mm_struct *mm);
506504

507505
static inline void hmm_mm_init(struct mm_struct *mm)
508506
{
509507
mm->hmm = NULL;
510508
}
511-
#else /* IS_ENABLED(CONFIG_HMM_MIRROR) */
512-
static inline void hmm_mm_destroy(struct mm_struct *mm) {}
513-
static inline void hmm_mm_init(struct mm_struct *mm) {}
514-
#endif /* IS_ENABLED(CONFIG_HMM_MIRROR) */
515-
516-
517509
#else /* IS_ENABLED(CONFIG_HMM) */
518510
static inline void hmm_mm_destroy(struct mm_struct *mm) {}
519511
static inline void hmm_mm_init(struct mm_struct *mm) {}
512+
#endif /* IS_ENABLED(CONFIG_HMM) */
520513
#endif /* LINUX_HMM_H */

0 commit comments

Comments
 (0)