]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Bluetooth: 6lowpan: Make variable header_ops constant
authorNishka Dasgupta <nishkadg.linux@gmail.com>
Thu, 15 Aug 2019 05:52:55 +0000 (11:22 +0530)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 5 Sep 2019 15:27:21 +0000 (17:27 +0200)
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.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/6lowpan.c

index 9d41de1ec90f687ea9ad249c7ede9a5e37f86968..bb55d92691b068d32b281b1b3ceff58b8ac51fc4 100644 (file)
@@ -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,
 };