diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2012-03-07 23:25:00 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2012-03-08 00:02:26 -0500 |
commit | 04124681f104c1980024ff249a34a77a249fd2bc (patch) | |
tree | 5caad821f1cdd55930b054cbdeab1c45421559b4 /net/bluetooth/smp.c | |
parent | f64b993f44c3a5fe709b276ac5652d006afe9d33 (diff) |
Bluetooth: fix conding style issues all over the tree
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/smp.c')
-rw-r--r-- | net/bluetooth/smp.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 75937d73d8ae..8f56282c247d 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c | |||
@@ -264,7 +264,7 @@ static void smp_failure(struct l2cap_conn *conn, u8 reason, u8 send) | |||
264 | 264 | ||
265 | clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->hcon->flags); | 265 | clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->hcon->flags); |
266 | mgmt_auth_failed(conn->hcon->hdev, conn->dst, hcon->type, | 266 | mgmt_auth_failed(conn->hcon->hdev, conn->dst, hcon->type, |
267 | hcon->dst_type, reason); | 267 | hcon->dst_type, reason); |
268 | 268 | ||
269 | if (test_and_clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags)) { | 269 | if (test_and_clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags)) { |
270 | cancel_delayed_work_sync(&conn->security_timer); | 270 | cancel_delayed_work_sync(&conn->security_timer); |
@@ -384,12 +384,11 @@ static void confirm_work(struct work_struct *work) | |||
384 | 384 | ||
385 | if (conn->hcon->out) | 385 | if (conn->hcon->out) |
386 | ret = smp_c1(tfm, smp->tk, smp->prnd, smp->preq, smp->prsp, 0, | 386 | ret = smp_c1(tfm, smp->tk, smp->prnd, smp->preq, smp->prsp, 0, |
387 | conn->src, conn->hcon->dst_type, conn->dst, | 387 | conn->src, conn->hcon->dst_type, conn->dst, res); |
388 | res); | ||
389 | else | 388 | else |
390 | ret = smp_c1(tfm, smp->tk, smp->prnd, smp->preq, smp->prsp, | 389 | ret = smp_c1(tfm, smp->tk, smp->prnd, smp->preq, smp->prsp, |
391 | conn->hcon->dst_type, conn->dst, 0, conn->src, | 390 | conn->hcon->dst_type, conn->dst, 0, conn->src, |
392 | res); | 391 | res); |
393 | if (ret) { | 392 | if (ret) { |
394 | reason = SMP_UNSPECIFIED; | 393 | reason = SMP_UNSPECIFIED; |
395 | goto error; | 394 | goto error; |
@@ -424,12 +423,10 @@ static void random_work(struct work_struct *work) | |||
424 | 423 | ||
425 | if (hcon->out) | 424 | if (hcon->out) |
426 | ret = smp_c1(tfm, smp->tk, smp->rrnd, smp->preq, smp->prsp, 0, | 425 | ret = smp_c1(tfm, smp->tk, smp->rrnd, smp->preq, smp->prsp, 0, |
427 | conn->src, hcon->dst_type, conn->dst, | 426 | conn->src, hcon->dst_type, conn->dst, res); |
428 | res); | ||
429 | else | 427 | else |
430 | ret = smp_c1(tfm, smp->tk, smp->rrnd, smp->preq, smp->prsp, | 428 | ret = smp_c1(tfm, smp->tk, smp->rrnd, smp->preq, smp->prsp, |
431 | hcon->dst_type, conn->dst, 0, conn->src, | 429 | hcon->dst_type, conn->dst, 0, conn->src, res); |
432 | res); | ||
433 | if (ret) { | 430 | if (ret) { |
434 | reason = SMP_UNSPECIFIED; | 431 | reason = SMP_UNSPECIFIED; |
435 | goto error; | 432 | goto error; |
@@ -454,7 +451,7 @@ static void random_work(struct work_struct *work) | |||
454 | swap128(key, stk); | 451 | swap128(key, stk); |
455 | 452 | ||
456 | memset(stk + smp->enc_key_size, 0, | 453 | memset(stk + smp->enc_key_size, 0, |
457 | SMP_MAX_ENC_KEY_SIZE - smp->enc_key_size); | 454 | SMP_MAX_ENC_KEY_SIZE - smp->enc_key_size); |
458 | 455 | ||
459 | if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &hcon->flags)) { | 456 | if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &hcon->flags)) { |
460 | reason = SMP_UNSPECIFIED; | 457 | reason = SMP_UNSPECIFIED; |
@@ -480,8 +477,8 @@ static void random_work(struct work_struct *work) | |||
480 | SMP_MAX_ENC_KEY_SIZE - smp->enc_key_size); | 477 | SMP_MAX_ENC_KEY_SIZE - smp->enc_key_size); |
481 | 478 | ||
482 | hci_add_ltk(hcon->hdev, conn->dst, hcon->dst_type, | 479 | hci_add_ltk(hcon->hdev, conn->dst, hcon->dst_type, |
483 | HCI_SMP_STK_SLAVE, 0, 0, stk, | 480 | HCI_SMP_STK_SLAVE, 0, 0, stk, smp->enc_key_size, |
484 | smp->enc_key_size, ediv, rand); | 481 | ediv, rand); |
485 | } | 482 | } |
486 | 483 | ||
487 | return; | 484 | return; |
@@ -829,8 +826,8 @@ static int smp_cmd_master_ident(struct l2cap_conn *conn, struct sk_buff *skb) | |||
829 | hci_dev_lock(hdev); | 826 | hci_dev_lock(hdev); |
830 | authenticated = (conn->hcon->sec_level == BT_SECURITY_HIGH); | 827 | authenticated = (conn->hcon->sec_level == BT_SECURITY_HIGH); |
831 | hci_add_ltk(conn->hcon->hdev, conn->dst, hcon->dst_type, | 828 | hci_add_ltk(conn->hcon->hdev, conn->dst, hcon->dst_type, |
832 | HCI_SMP_LTK, 1, authenticated, smp->tk, | 829 | HCI_SMP_LTK, 1, authenticated, smp->tk, smp->enc_key_size, |
833 | smp->enc_key_size, rp->ediv, rp->rand); | 830 | rp->ediv, rp->rand); |
834 | smp_distribute_keys(conn, 1); | 831 | smp_distribute_keys(conn, 1); |
835 | hci_dev_unlock(hdev); | 832 | hci_dev_unlock(hdev); |
836 | 833 | ||
@@ -954,9 +951,8 @@ int smp_distribute_keys(struct l2cap_conn *conn, __u8 force) | |||
954 | 951 | ||
955 | authenticated = hcon->sec_level == BT_SECURITY_HIGH; | 952 | authenticated = hcon->sec_level == BT_SECURITY_HIGH; |
956 | hci_add_ltk(conn->hcon->hdev, conn->dst, hcon->dst_type, | 953 | hci_add_ltk(conn->hcon->hdev, conn->dst, hcon->dst_type, |
957 | HCI_SMP_LTK_SLAVE, 1, authenticated, | 954 | HCI_SMP_LTK_SLAVE, 1, authenticated, |
958 | enc.ltk, smp->enc_key_size, | 955 | enc.ltk, smp->enc_key_size, ediv, ident.rand); |
959 | ediv, ident.rand); | ||
960 | 956 | ||
961 | ident.ediv = cpu_to_le16(ediv); | 957 | ident.ediv = cpu_to_le16(ediv); |
962 | 958 | ||