Bluetooth: Use macro for L2CAP hint mask on receiving config request
authorGustavo F. Padovan <gustavo@las.ic.unicamp.br>
Mon, 20 Apr 2009 04:31:07 +0000 (01:31 -0300)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 8 Jun 2009 12:50:00 +0000 (14:50 +0200)
Using the L2CAP_CONF_HINT macro is easier to understand than using a
hardcoded 0x80 value.

Signed-off-by: Gustavo F. Padovan <gustavo@las.ic.unicamp.br>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
include/net/bluetooth/l2cap.h
net/bluetooth/l2cap.c

index ed4ba91..300b63f 100644 (file)
@@ -149,6 +149,8 @@ struct l2cap_conf_opt {
 } __attribute__ ((packed));
 #define L2CAP_CONF_OPT_SIZE    2
 
+#define L2CAP_CONF_HINT                0x80
+
 #define L2CAP_CONF_MTU         0x01
 #define L2CAP_CONF_FLUSH_TO    0x02
 #define L2CAP_CONF_QOS         0x03
index ff1744e..c0c0915 100644 (file)
@@ -1739,7 +1739,7 @@ static int l2cap_parse_conf_req(struct sock *sk, void *data)
        while (len >= L2CAP_CONF_OPT_SIZE) {
                len -= l2cap_get_conf_opt(&req, &type, &olen, &val);
 
-               hint  = type & 0x80;
+               hint  = type & L2CAP_CONF_HINT;
                type &= 0x7f;
 
                switch (type) {