aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hidp
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2011-10-06 21:05:37 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-10-06 22:15:06 -0400
commitab88f7149e0e3284623adcaa60460a9a69d9f131 (patch)
tree17da94da7c1894fcd8f8e4cacd7db3eee3241547 /net/bluetooth/hidp
parent192893c72197b3f49f76a315024bdcd5aa26fff3 (diff)
Bluetooth: Uses test_and_clear_bit() when possible
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/hidp')
-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,
496 case HIDP_HSHK_ERR_INVALID_REPORT_ID: 496 case HIDP_HSHK_ERR_INVALID_REPORT_ID:
497 case HIDP_HSHK_ERR_UNSUPPORTED_REQUEST: 497 case HIDP_HSHK_ERR_UNSUPPORTED_REQUEST:
498 case HIDP_HSHK_ERR_INVALID_PARAMETER: 498 case HIDP_HSHK_ERR_INVALID_PARAMETER:
499 if (test_bit(HIDP_WAITING_FOR_RETURN, &session->flags)) { 499 if (test_and_clear_bit(HIDP_WAITING_FOR_RETURN, &session->flags))
500 clear_bit(HIDP_WAITING_FOR_RETURN, &session->flags);
501 wake_up_interruptible(&session->report_queue); 500 wake_up_interruptible(&session->report_queue);
502 } 501
503 /* FIXME: Call into SET_ GET_ handlers here */ 502 /* FIXME: Call into SET_ GET_ handlers here */
504 break; 503 break;
505 504
@@ -520,10 +519,8 @@ static void hidp_process_handshake(struct hidp_session *session,
520 } 519 }
521 520
522 /* Wake up the waiting thread. */ 521 /* Wake up the waiting thread. */
523 if (test_bit(HIDP_WAITING_FOR_SEND_ACK, &session->flags)) { 522 if (test_and_clear_bit(HIDP_WAITING_FOR_SEND_ACK, &session->flags))
524 clear_bit(HIDP_WAITING_FOR_SEND_ACK, &session->flags);
525 wake_up_interruptible(&session->report_queue); 523 wake_up_interruptible(&session->report_queue);
526 }
527} 524}
528 525
529static void hidp_process_hid_control(struct hidp_session *session, 526static void hidp_process_hid_control(struct hidp_session *session,