greybus: connection: Fix sparse warnings around locking
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 28 Jan 2016 10:20:48 +0000 (15:50 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 3 Feb 2016 05:37:50 +0000 (21:37 -0800)
commit127c1fbd55939642365f26efd3121562629ec1b1
tree785876ad6f1486a016789e82809d81b97f18cb70
parent68ba0a01ccc3e0aff3687ac2704c01a3849d5345
greybus: connection: Fix sparse warnings around locking

The callers ensures that connection->lock is taken before calling few
routines, but that isn't enough for sparse as it sees an unexpected
unlock.

greybus/connection.c:380:29: warning: context imbalance in 'gb_connection_cancel_operations' - unexpected unlock

Fix that adding __must_lock() attribute to the function declaration.

This also adds the attribute for
gb_connection_flush_incoming_operations(), which isn't showing any
sparse warnings with the current state of code, but with minor
rearrangements of the code.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/connection.c