lkml.org 
[lkml]   [2011]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Put braces around potentially empty 'if' body in handle_pte_fault()
From
Date
Le dimanche 18 décembre 2011 à 01:03 +0100, Jesper Juhl a écrit :
> If one builds the kernel with -Wempty-body one gets this warning:
>
> mm/memory.c:3432:46: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
>
> due to the fact that 'flush_tlb_fix_spurious_fault' is a macro that
> can sometimes be defined to nothing.
>
> I suggest we heed gcc's advice and put a pair of braces on that if.
>
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>
> ---
> mm/memory.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/mm/memory.c b/mm/memory.c
> index 829d437..9cf1b48 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -3428,9 +3428,9 @@ int handle_pte_fault(struct mm_struct *mm,
> * This still avoids useless tlb flushes for .text page faults
> * with threads.
> */
> - if (flags & FAULT_FLAG_WRITE)
> + if (flags & FAULT_FLAG_WRITE) {
> flush_tlb_fix_spurious_fault(vma, address);
> + }
> }
> unlock:
> pte_unmap_unlock(pte, ptl);
> --
> 1.7.8
>

Thats should be fixed in the reverse way :

#define flush_tlb_fix_spurious_fault(vma, address) do { } while (0)



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-12-18 01:21    [W:0.038 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site