lkml.org 
[lkml]   [2013]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/5] lockdep: check that no locks held at freeze time
Well, this is almost cosmetics, and I am not maintaner, but...

On 02/16, Mandeep Singh Baines wrote:
>
> static inline bool try_to_freeze(void)
> {
> + if (current->flags & PF_NOFREEZE)
> + return false;
> + debug_check_no_locks_held(current, "lock held while trying to freeze");

I think this should be

if (!(current->flags & PF_NOFREEZE))
debug_check_no_locks_held(...);

without "return". This way we avoid the unnecessary PF_NOFREEZE check
if !CONFIG_LOCKDEP. And perhaps more importantly, this way it is clear
that we check PF_NOFREEZE for debugging only and do not change the code
behaviour.

But I leave this to Rafael/Tejun.

And again, unless I missed something, this makes 1/5 unnecessary.

Oleg.



\
 
 \ /
  Last update: 2013-02-16 18:41    [W:0.198 / U:0.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site