]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
Bluetooth: Use min_t for calculating chan->mps
authorJohan Hedberg <johan.hedberg@intel.com>
Fri, 6 Dec 2013 05:08:52 +0000 (07:08 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 6 Dec 2013 06:07:42 +0000 (22:07 -0800)
Since there's a nice convenient helper for calculating the minimum of
two values, let's use that one.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/l2cap_core.c

index 6e6f308af036da34bffc7298d007eb718e9644f3..35feb9d6c322b3bc67e7d0bacd57acacd12b4a9d 100644 (file)
@@ -505,11 +505,7 @@ static void l2cap_le_flowctl_init(struct l2cap_chan *chan)
        chan->sdu_len = 0;
        chan->tx_credits = 0;
        chan->rx_credits = le_max_credits;
-
-       if (chan->imtu < L2CAP_LE_DEFAULT_MPS)
-               chan->mps = chan->imtu;
-       else
-               chan->mps = L2CAP_LE_DEFAULT_MPS;
+       chan->mps = min_t(u16, chan->imtu, L2CAP_LE_DEFAULT_MPS);
 
        skb_queue_head_init(&chan->tx_q);
 }