Skip to content

Commit 88d3a8a

Browse files
Johan Hedbergholtmann
authored andcommitted
Bluetooth: Add define for key distribution mask
This patch adds a define for the allowed bits of the key distribution mask so we don't have to have magic 0x07 constants throughout the code. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
1 parent fc75cc8 commit 88d3a8a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/bluetooth/smp.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#define SMP_TIMEOUT msecs_to_jiffies(30000)
3535

3636
#define AUTH_REQ_MASK 0x07
37+
#define KEY_DIST_MASK 0x07
3738

3839
enum {
3940
SMP_FLAG_TK_VALID,
@@ -703,7 +704,7 @@ static void smp_distribute_keys(struct smp_chan *smp)
703704
rsp = (void *) &smp->prsp[1];
704705

705706
/* The responder sends its keys first */
706-
if (hcon->out && (smp->remote_key_dist & 0x07))
707+
if (hcon->out && (smp->remote_key_dist & KEY_DIST_MASK))
707708
return;
708709

709710
req = (void *) &smp->preq[1];
@@ -789,7 +790,7 @@ static void smp_distribute_keys(struct smp_chan *smp)
789790
}
790791

791792
/* If there are still keys to be received wait for them */
792-
if ((smp->remote_key_dist & 0x07))
793+
if (smp->remote_key_dist & KEY_DIST_MASK)
793794
return;
794795

795796
set_bit(SMP_FLAG_COMPLETE, &smp->flags);

0 commit comments

Comments
 (0)