Bluetooth: shell: Remove forward declaration

It is possible to remove the forward declaration of l2cap_alloc_buf as
the recv pointer can be compared directly with chan pointer avoiding
using l2cap_ops directly.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2017-05-14 13:57:01 +03:00 committed by Johan Hedberg
commit 4f019eab26

View file

@ -2077,7 +2077,15 @@ static void l2cap_disconnected(struct bt_l2cap_chan *chan)
printk("Channel %p disconnected\n", chan);
}
static struct net_buf *l2cap_alloc_buf(struct bt_l2cap_chan *chan);
static struct net_buf *l2cap_alloc_buf(struct bt_l2cap_chan *chan)
{
/* print if metrics is disabled */
if (chan->ops->recv != l2cap_recv_metrics) {
printk("Channel %p requires buffer\n", chan);
}
return net_buf_alloc(&data_rx_pool, K_FOREVER);
}
static struct bt_l2cap_chan_ops l2cap_ops = {
.alloc_buf = l2cap_alloc_buf,
@ -2091,16 +2099,6 @@ static struct bt_l2cap_le_chan l2cap_chan = {
.rx.mtu = DATA_MTU,
};
static struct net_buf *l2cap_alloc_buf(struct bt_l2cap_chan *chan)
{
/* print if metrics is disabled */
if (l2cap_ops.recv != l2cap_recv_metrics) {
printk("Channel %p requires buffer\n", chan);
}
return net_buf_alloc(&data_rx_pool, K_FOREVER);
}
static int l2cap_accept(struct bt_conn *conn, struct bt_l2cap_chan **chan)
{
printk("Incoming conn %p\n", conn);