Bluetooth: remove magic offset and size
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Thu, 20 Oct 2011 14:02:44 +0000 (17:02 +0300)
committerGustavo F. Padovan <padovan@profusion.mobi>
Mon, 7 Nov 2011 19:24:44 +0000 (17:24 -0200)
make code readable by removing magic numbers

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
net/bluetooth/l2cap_core.c

index 7d663bd..18b0bba 100644 (file)
@@ -3021,7 +3021,7 @@ static inline int l2cap_information_req(struct l2cap_conn *conn, struct l2cap_cm
                struct l2cap_info_rsp *rsp = (struct l2cap_info_rsp *) buf;
                rsp->type   = cpu_to_le16(L2CAP_IT_FIXED_CHAN);
                rsp->result = cpu_to_le16(L2CAP_IR_SUCCESS);
-               memcpy(buf + 4, l2cap_fixed_chan, 8);
+               memcpy(rsp->data, l2cap_fixed_chan, sizeof(l2cap_fixed_chan));
                l2cap_send_cmd(conn, cmd->ident,
                                        L2CAP_INFO_RSP, sizeof(buf), buf);
        } else {