]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
batman-adv: constify and move broadcast addr definition
authorMatthias Schiffer <mschiffer@universe-factory.net>
Tue, 8 Apr 2025 15:53:36 +0000 (17:53 +0200)
committerSimon Wunderlich <sw@simonwunderlich.de>
Wed, 9 Apr 2025 19:59:19 +0000 (21:59 +0200)
The variable is used only once and is read-only. Make it a const local
variable.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
net/batman-adv/main.c
net/batman-adv/main.h
net/batman-adv/send.c

index a08132888a3d4f38c0f9b7ef7228f73e4707e211..e41f816f0887b8a9e3a7d5e59602c0ca78ca107f 100644 (file)
@@ -69,8 +69,6 @@ unsigned int batadv_hardif_generation;
 static int (*batadv_rx_handler[256])(struct sk_buff *skb,
                                     struct batadv_hard_iface *recv_if);
 
-unsigned char batadv_broadcast_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-
 struct workqueue_struct *batadv_event_workqueue;
 
 static void batadv_recv_handler_init(void);
index 4b5ce8972848a8592d654677dc1e1e11a35508bc..692109be22101f580bc977b29326804e472fb1d6 100644 (file)
@@ -235,7 +235,6 @@ static inline int batadv_print_vid(unsigned short vid)
 extern struct list_head batadv_hardif_list;
 extern unsigned int batadv_hardif_generation;
 
-extern unsigned char batadv_broadcast_addr[];
 extern struct workqueue_struct *batadv_event_workqueue;
 
 int batadv_mesh_init(struct net_device *mesh_iface);
index 735ac807782198f47ae1d4c2d1347dde9728a247..9d72f4f15b3d75bca3d1373c3e21c54fbc85ad4a 100644 (file)
@@ -124,7 +124,9 @@ send_skb_err:
 int batadv_send_broadcast_skb(struct sk_buff *skb,
                              struct batadv_hard_iface *hard_iface)
 {
-       return batadv_send_skb_packet(skb, hard_iface, batadv_broadcast_addr);
+       static const u8 broadcast_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+
+       return batadv_send_skb_packet(skb, hard_iface, broadcast_addr);
 }
 
 /**