diff mbox series

[next] selftests/mm: mkdirty: Fix incorrect position of #endif

Message ID 20230712134648.456349-1-colin.i.king@gmail.com (mailing list archive)
State Accepted
Commit 25b5949c30938c7f26dbadc948b491e0e0811c78
Headers show
Series [next] selftests/mm: mkdirty: Fix incorrect position of #endif | expand

Commit Message

Colin Ian King July 12, 2023, 1:46 p.m. UTC
The #endif is the wrong side of a } causing a build failure when
__NR_userfaultfd is not defined. Fix this by moving the #end to
enclose the }

Fixes: 9eac40fc0cc7 ("selftests/mm: mkdirty: test behavior of (pte|pmd)_mkdirty on VMAs without write permissions")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 tools/testing/selftests/mm/mkdirty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Hildenbrand July 12, 2023, 7:10 p.m. UTC | #1
On 12.07.23 15:46, Colin Ian King wrote:
> The #endif is the wrong side of a } causing a build failure when
> __NR_userfaultfd is not defined. Fix this by moving the #end to
> enclose the }
> 
> Fixes: 9eac40fc0cc7 ("selftests/mm: mkdirty: test behavior of (pte|pmd)_mkdirty on VMAs without write permissions")
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>   tools/testing/selftests/mm/mkdirty.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/mm/mkdirty.c b/tools/testing/selftests/mm/mkdirty.c
> index 6d71d972997b..301abb99e027 100644
> --- a/tools/testing/selftests/mm/mkdirty.c
> +++ b/tools/testing/selftests/mm/mkdirty.c
> @@ -321,8 +321,8 @@ static void test_uffdio_copy(void)
>   munmap:
>   	munmap(dst, pagesize);
>   	free(src);
> -#endif /* __NR_userfaultfd */
>   }
> +#endif /* __NR_userfaultfd */
>   
>   int main(void)
>   {

Ouch, thanks!

Reviewed-by: David Hildenbrand <david@redhat.com>
diff mbox series

Patch

diff --git a/tools/testing/selftests/mm/mkdirty.c b/tools/testing/selftests/mm/mkdirty.c
index 6d71d972997b..301abb99e027 100644
--- a/tools/testing/selftests/mm/mkdirty.c
+++ b/tools/testing/selftests/mm/mkdirty.c
@@ -321,8 +321,8 @@  static void test_uffdio_copy(void)
 munmap:
 	munmap(dst, pagesize);
 	free(src);
-#endif /* __NR_userfaultfd */
 }
+#endif /* __NR_userfaultfd */
 
 int main(void)
 {