Re: [PATCH 1/3] hw_breakpoint: Simplify list/idx mess in toggle_bp_slot() paths

2013-06-15 Thread Frederic Weisbecker
On Sat, Jun 01, 2013 at 09:45:48PM +0200, Oleg Nesterov wrote: > The enable/disable logic in toggle_bp_slot() is not symmetrical > and imho very confusing. "old_count" in toggle_bp_task_slot() is > actually new_count because this bp was already removed from the > list. > > Change toggle_bp_slot()

Re: [PATCH 1/3] hw_breakpoint: Simplify list/idx mess in toggle_bp_slot() paths

2013-06-15 Thread Frederic Weisbecker
On Sat, Jun 01, 2013 at 09:45:48PM +0200, Oleg Nesterov wrote: The enable/disable logic in toggle_bp_slot() is not symmetrical and imho very confusing. old_count in toggle_bp_task_slot() is actually new_count because this bp was already removed from the list. Change toggle_bp_slot() to

[PATCH 1/3] hw_breakpoint: Simplify list/idx mess in toggle_bp_slot() paths

2013-06-01 Thread Oleg Nesterov
The enable/disable logic in toggle_bp_slot() is not symmetrical and imho very confusing. "old_count" in toggle_bp_task_slot() is actually new_count because this bp was already removed from the list. Change toggle_bp_slot() to always call list_add/list_del after toggle_bp_task_slot(). This way

[PATCH 1/3] hw_breakpoint: Simplify list/idx mess in toggle_bp_slot() paths

2013-06-01 Thread Oleg Nesterov
The enable/disable logic in toggle_bp_slot() is not symmetrical and imho very confusing. old_count in toggle_bp_task_slot() is actually new_count because this bp was already removed from the list. Change toggle_bp_slot() to always call list_add/list_del after toggle_bp_task_slot(). This way