perf: Change and simplify ctx::is_active semantics

    Instead of tracking if a context is active or not, track which events
    of the context are active. By making it a bitmask of
    EVENT_PINNED|EVENT_FLEXIBLE we can simplify some of the scheduling
    routines since it can avoid adding events that are already active.

    Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Link: http://lkml.kernel.org/r/20110409192141.930282378@chello.nl
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
perf: Collect the schedule-in rules in one function

    This was scattered out - refactor it into a single function.
    No change in functionality.

    Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Link: http://lkml.kernel.org/r/20110409192141.979862055@chello.nl
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
perf: Change close() semantics for group events

    In order to always call list_del_event() on the correct cpu if the
    event is part of an active context and avoid having to do two IPIs,
    change the close() semantics slightly.

    The current perf_event_disable() call would disable a whole group if
    the event that's being closed is the group leader, whereas the new
    code keeps the group siblings enabled.

    People should not rely on this behaviour and I don't think they do,
    but in case we find they do, the fix is easy and we have to take the
    double IPI cost.

    Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Vince Weaver <vweaver1@eecs.utk.edu>
    Link: http://lkml.kernel.org/r/20110409192142.038377551@chello.nl
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
perf: De-schedule a task context when removing the last event

    Since perf_install_in_context() will now install a context when we
    add the first event, we can de-schedule the context when the last
    event is removed.

    Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Link: http://lkml.kernel.org/r/20110409192142.090431763@chello.nl
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
x86: Convert vmalloc()+memset() to vzalloc()

    Signed-off-by: Joe Perches <joe@perches.com>
    Cc: Jiri Kosina <trivial@kernel.org>
    Link: http://lkml.kernel.org/r/10e35243fda0b8739c89ac32a7bdf348ec4752e1.1306603968.git.joe@perches.com
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
ASoC: Remove redundant freq assignment for max98095->sysclk/max98088->sysclk

    Current implementation set max98095->sysclk/max98088->sysclk to freq twice.
    Set it once is enough, this patch removes the first assignment in case
    we may set invalid clock frequency to max98095->sysclk/max98088->sysclk.

    Signed-off-by: Axel Lin <axel.lin@gmail.com>
    Acked-by: Peter Hsiang <peter.hsiang@maxim-ic.com>
    Acked-by: Liam Girdwood <lrg@ti.com>
    Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
batman-adv: move neigh_node->if_incoming->if_status check in find_router()

    Every time that find_router() is invoked, if_status has to be compared with
    IF_ACTIVE. Moving this comparison inside find_router() will avoid to write it
    each time.

    Signed-off-by: Antonio Quartulli <ordex@autistici.org>
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
batman-adv: Use kzalloc rather than kmalloc followed by memset with 0

    Signed-off-by: Sven Eckelmann <sven@narfation.org>
batman-adv: Annotate functions with format strings

    Signed-off-by: Sven Eckelmann <sven@narfation.org>
batman-adv: Print jiffies as unsigned long

    Signed-off-by: Sven Eckelmann <sven@narfation.org>
batman-adv: Remove comparising < 0 for unsigned type

    Signed-off-by: Sven Eckelmann <sven@narfation.org>
batman-adv: Don't do pointer arithmetic with void*

    The size of void is currently set by gcc to 1, but is not well defined
    in general. Therefore it is more advisable to cast it to char* before
    doing pointer arithmetic.

    Signed-off-by: Sven Eckelmann <sven@narfation.org>
batman-adv: Add const type qualifier for pointers

    batman-adv uses pointers which are marked as const and should not
    violate that type qualifier by passing it to functions which force a
    cast to the non-const version.

    Signed-off-by: Sven Eckelmann <sven@narfation.org>
batman-adv: Only use int up and down gw representation

    It is not save to provide memory for an int and then cast the pointer to
    it to long*. It is better to standardize the up and down gateway
    bandwith representation to simple ints and only use long inside
    conversation routines.

    Signed-off-by: Sven Eckelmann <sven@narfation.org>
batman-adv: Remove explicit casts cast from void* for store

    It is not necessary to cast a void* to the pointer type when we just
    store it and don't want to do pointer arithmetic before the actual
    assignment.

    Signed-off-by: Sven Eckelmann <sven@narfation.org>
batman-adv: Remove casts from type x to type x

    Casting from pointer like 'struct orig_node*' to 'struct orig_node *'
    doesn't provide any additional functionality and can be savely removed.

    Signed-off-by: Sven Eckelmann <sven@narfation.org>
batman-adv: Calculate sizeof using variable insead of types

    Documentation/CodingStyle recommends to use the form

    	p = kmalloc(sizeof(*p), ...);

    to calculate the size of a struct and not the version where the struct
    name is spelled out to prevent bugs when the type of p changes. This
    also seems appropriate for manipulation of buffers when they are
    directly associated with p.

    Signed-off-by: Sven Eckelmann <sven@narfation.org>
batman-adv: Use rcu_dereference_protected by update-side

    Usually rcu_dereference isn't necessary in situations were the
    RCU-protected data structure cannot change, but sparse and lockdep still
    need a similar functionality for analysis. rcu_dereference_protected
    implements the reduced version which should be used to support the
    dynamic and static analysis.

    Signed-off-by: Sven Eckelmann <sven@narfation.org>
batman-adv: move smallest_signed_int(), seq_before() and seq_after() into main.h

    smallest_signed_int(), seq_before() and seq_after() are very useful
    functions that help to handle comparisons between sequence numbers.
    However they were only defined in vis.c. With this patch every
    batman-adv function will be able to use them.

    Signed-off-by: Antonio Quartulli <ordex@autistici.org>
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
batman-adv: Check type of x and y in seq_(before|after)

    seq_before and seq_after depend on the fact that both sequence numbers
    have the same type and thus the same bitwidth. We can ensure that by
    compile time checking using a compare between the pointer to the
    temporary buffers which were created using the typeof of both
    parameters. For example gcc would create a warning like
    "warning: comparison of distinct pointer types lacks a cast".

    Signed-off-by: Sven Eckelmann <sven@narfation.org>