Bluetooth: 6lowpan: Make variable header_ops constant
Subsystems (4)
PATCH 1/1 Bluetooth: 6lowpan: Make variable header_ops constant
Static variable header_ops, of type header_ops, is used only once, when it is assigned to field header_ops of a variable having type net_device. This corresponding field is declared as const in the definition of net_device. Hence make header_ops constant as well to protect it from unnecessary modification.
Issue found with Coccinelle.
--- net/bluetooth/6lowpan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/6lowpan.c +1 -1
@@ -583,7 +583,7 @@ static const struct net_device_ops netdev_ops = { .ndo_start_xmit = bt_xmit, }; -static struct header_ops header_ops = { +static const struct header_ops header_ops = { .create = header_create, };
Signature · 1 line
2.19.1
Marcel Holtmann
maintainerHi Nishka,
Quoted 11 lines
Static variable
header_ops, of typeheader_ops, is used only once, when it is assigned to fieldheader_opsof a variable having typenet_device. This corresponding field is declared as const in the definition ofnet_device. Hence makeheader_opsconstant as well to protect it from unnecessary modification.
Issue found with Coccinelle.Signed-off-by Nishka Dasgupta <[email protected]>---
net/bluetooth/6lowpan.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel