Skip to content

Commit 67f86a4

Browse files
committed
Bluetooth: Use const for struct l2cap_ops field
The struct l2cap_ops field should not allow any modifications and thus it is better declared as const. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
1 parent b0c3e13 commit 67f86a4

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎include/net/bluetooth/l2cap.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ struct l2cap_chan {
579579
struct list_head global_l;
580580

581581
void *data;
582-
struct l2cap_ops *ops;
582+
const struct l2cap_ops *ops;
583583
struct mutex lock;
584584
};
585585

‎net/bluetooth/a2mp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ static struct sk_buff *a2mp_chan_alloc_skb_cb(struct l2cap_chan *chan,
704704
return skb;
705705
}
706706

707-
static struct l2cap_ops a2mp_chan_ops = {
707+
static const struct l2cap_ops a2mp_chan_ops = {
708708
.name = "L2CAP A2MP channel",
709709
.recv = a2mp_chan_recv_cb,
710710
.close = a2mp_chan_close_cb,

‎net/bluetooth/l2cap_sock.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,7 @@ static void l2cap_sock_suspend_cb(struct l2cap_chan *chan)
13751375
sk->sk_state_change(sk);
13761376
}
13771377

1378-
static struct l2cap_ops l2cap_chan_ops = {
1378+
static const struct l2cap_ops l2cap_chan_ops = {
13791379
.name = "L2CAP Socket Interface",
13801380
.new_connection = l2cap_sock_new_connection_cb,
13811381
.recv = l2cap_sock_recv_cb,

0 commit comments

Comments
 (0)