linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/hmm: fix header file if/else/endif maze, again
@ 2018-04-04 11:02 Arnd Bergmann
  2018-04-04 15:51 ` Jerome Glisse
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2018-04-04 11:02 UTC (permalink / raw)
  To: Jérôme Glisse
  Cc: Arnd Bergmann, Andrew Morton, John Hubbard, Stephen Rothwell,
	Evgeny Baskakov, Ralph Campbell, linux-mm, linux-kernel

The last fix was still wrong, as we need the inline dummy functions
also for the case that CONFIG_HMM is enabled but CONFIG_HMM_MIRROR
is not:

kernel/fork.o: In function `__mmdrop':
fork.c:(.text+0x14f6): undefined reference to `hmm_mm_destroy'

This adds back the second copy of the dummy functions, hopefully
this time in the right place.

Fixes: 8900d06a277a ("mm/hmm: fix header file if/else/endif maze")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/linux/hmm.h | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/include/linux/hmm.h b/include/linux/hmm.h
index 5d26e0a223d9..39988924de3a 100644
--- a/include/linux/hmm.h
+++ b/include/linux/hmm.h
@@ -376,8 +376,18 @@ bool hmm_vma_range_done(struct hmm_range *range);
  * See the function description in mm/hmm.c for further documentation.
  */
 int hmm_vma_fault(struct hmm_range *range, bool block);
-#endif /* IS_ENABLED(CONFIG_HMM_MIRROR) */
 
+/* Below are for HMM internal use only! Not to be used by device driver! */
+void hmm_mm_destroy(struct mm_struct *mm);
+
+static inline void hmm_mm_init(struct mm_struct *mm)
+{
+	mm->hmm = NULL;
+}
+#else /* IS_ENABLED(CONFIG_HMM_MIRROR) */
+static inline void hmm_mm_destroy(struct mm_struct *mm) {}
+static inline void hmm_mm_init(struct mm_struct *mm) {}
+#endif /* IS_ENABLED(CONFIG_HMM_MIRROR) */
 
 #if IS_ENABLED(CONFIG_DEVICE_PRIVATE) ||  IS_ENABLED(CONFIG_DEVICE_PUBLIC)
 struct hmm_devmem;
@@ -550,16 +560,9 @@ struct hmm_device {
 struct hmm_device *hmm_device_new(void *drvdata);
 void hmm_device_put(struct hmm_device *hmm_device);
 #endif /* CONFIG_DEVICE_PRIVATE || CONFIG_DEVICE_PUBLIC */
-
-/* Below are for HMM internal use only! Not to be used by device driver! */
-void hmm_mm_destroy(struct mm_struct *mm);
-
-static inline void hmm_mm_init(struct mm_struct *mm)
-{
-	mm->hmm = NULL;
-}
 #else /* IS_ENABLED(CONFIG_HMM) */
 static inline void hmm_mm_destroy(struct mm_struct *mm) {}
 static inline void hmm_mm_init(struct mm_struct *mm) {}
 #endif /* IS_ENABLED(CONFIG_HMM) */
+
 #endif /* LINUX_HMM_H */
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm/hmm: fix header file if/else/endif maze, again
  2018-04-04 11:02 [PATCH] mm/hmm: fix header file if/else/endif maze, again Arnd Bergmann
@ 2018-04-04 15:51 ` Jerome Glisse
  0 siblings, 0 replies; 2+ messages in thread
From: Jerome Glisse @ 2018-04-04 15:51 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Andrew Morton, John Hubbard, Stephen Rothwell, Evgeny Baskakov,
	Ralph Campbell, linux-mm, linux-kernel

On Wed, Apr 04, 2018 at 01:02:15PM +0200, Arnd Bergmann wrote:
> The last fix was still wrong, as we need the inline dummy functions
> also for the case that CONFIG_HMM is enabled but CONFIG_HMM_MIRROR
> is not:
> 
> kernel/fork.o: In function `__mmdrop':
> fork.c:(.text+0x14f6): undefined reference to `hmm_mm_destroy'
> 
> This adds back the second copy of the dummy functions, hopefully
> this time in the right place.
> 
> Fixes: 8900d06a277a ("mm/hmm: fix header file if/else/endif maze")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Jerome Glisse <jglisse@redhat.com>

Hopefuly this is the last config combinatorial issue...

> ---
>  include/linux/hmm.h | 21 ++++++++++++---------
>  1 file changed, 12 insertions(+), 9 deletions(-)
> 
> diff --git a/include/linux/hmm.h b/include/linux/hmm.h
> index 5d26e0a223d9..39988924de3a 100644
> --- a/include/linux/hmm.h
> +++ b/include/linux/hmm.h
> @@ -376,8 +376,18 @@ bool hmm_vma_range_done(struct hmm_range *range);
>   * See the function description in mm/hmm.c for further documentation.
>   */
>  int hmm_vma_fault(struct hmm_range *range, bool block);
> -#endif /* IS_ENABLED(CONFIG_HMM_MIRROR) */
>  
> +/* Below are for HMM internal use only! Not to be used by device driver! */
> +void hmm_mm_destroy(struct mm_struct *mm);
> +
> +static inline void hmm_mm_init(struct mm_struct *mm)
> +{
> +	mm->hmm = NULL;
> +}
> +#else /* IS_ENABLED(CONFIG_HMM_MIRROR) */
> +static inline void hmm_mm_destroy(struct mm_struct *mm) {}
> +static inline void hmm_mm_init(struct mm_struct *mm) {}
> +#endif /* IS_ENABLED(CONFIG_HMM_MIRROR) */
>  
>  #if IS_ENABLED(CONFIG_DEVICE_PRIVATE) ||  IS_ENABLED(CONFIG_DEVICE_PUBLIC)
>  struct hmm_devmem;
> @@ -550,16 +560,9 @@ struct hmm_device {
>  struct hmm_device *hmm_device_new(void *drvdata);
>  void hmm_device_put(struct hmm_device *hmm_device);
>  #endif /* CONFIG_DEVICE_PRIVATE || CONFIG_DEVICE_PUBLIC */
> -
> -/* Below are for HMM internal use only! Not to be used by device driver! */
> -void hmm_mm_destroy(struct mm_struct *mm);
> -
> -static inline void hmm_mm_init(struct mm_struct *mm)
> -{
> -	mm->hmm = NULL;
> -}
>  #else /* IS_ENABLED(CONFIG_HMM) */
>  static inline void hmm_mm_destroy(struct mm_struct *mm) {}
>  static inline void hmm_mm_init(struct mm_struct *mm) {}
>  #endif /* IS_ENABLED(CONFIG_HMM) */
> +
>  #endif /* LINUX_HMM_H */
> -- 
> 2.9.0
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-04 15:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-04 11:02 [PATCH] mm/hmm: fix header file if/else/endif maze, again Arnd Bergmann
2018-04-04 15:51 ` Jerome Glisse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).