summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hidp/core.c
diff options
context:
space:
mode:
authorGustavo F. Padovan2011-10-07 03:05:37 +0200
committerGustavo F. Padovan2011-10-07 04:15:06 +0200
commitab88f7149e0e3284623adcaa60460a9a69d9f131 (patch)
tree17da94da7c1894fcd8f8e4cacd7db3eee3241547 /net/bluetooth/hidp/core.c
parentBluetooth: Remove wrong error check (diff)
downloadkernel-qcow2-linux-ab88f7149e0e3284623adcaa60460a9a69d9f131.tar.gz
kernel-qcow2-linux-ab88f7149e0e3284623adcaa60460a9a69d9f131.tar.xz
kernel-qcow2-linux-ab88f7149e0e3284623adcaa60460a9a69d9f131.zip
Bluetooth: Uses test_and_clear_bit() when possible
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/hidp/core.c')
-rw-r--r--net/bluetooth/hidp/core.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index 7722d8346684..f2bec4981b76 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -496,10 +496,9 @@ static void hidp_process_handshake(struct hidp_session *session,
case HIDP_HSHK_ERR_INVALID_REPORT_ID:
case HIDP_HSHK_ERR_UNSUPPORTED_REQUEST:
case HIDP_HSHK_ERR_INVALID_PARAMETER:
- if (test_bit(HIDP_WAITING_FOR_RETURN, &session->flags)) {
- clear_bit(HIDP_WAITING_FOR_RETURN, &session->flags);
+ if (test_and_clear_bit(HIDP_WAITING_FOR_RETURN, &session->flags))
wake_up_interruptible(&session->report_queue);
- }
+
/* FIXME: Call into SET_ GET_ handlers here */
break;
@@ -520,10 +519,8 @@ static void hidp_process_handshake(struct hidp_session *session,
}
/* Wake up the waiting thread. */
- if (test_bit(HIDP_WAITING_FOR_SEND_ACK, &session->flags)) {
- clear_bit(HIDP_WAITING_FOR_SEND_ACK, &session->flags);
+ if (test_and_clear_bit(HIDP_WAITING_FOR_SEND_ACK, &session->flags))
wake_up_interruptible(&session->report_queue);
- }
}
static void hidp_process_hid_control(struct hidp_session *session,