[v2,2/3] batman-adv: use static const for STP constant address

Message ID 1334214449-3996-3-git-send-email-ordex@autistici.org (mailing list archive)
State Not Applicable, archived
Headers

Commit Message

Antonio Quartulli April 12, 2012, 7:07 a.m. UTC
  stp_addr is now declared as a simple "uint8_t []", but since it's content is
statically defined, it has to be declared as "static const uint8_t []"

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
 soft-interface.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Marek Lindner April 13, 2012, 8:33 p.m. UTC | #1
On Thursday, April 12, 2012 09:07:28 Antonio Quartulli wrote:
> stp_addr is now declared as a simple "uint8_t []", but since it's content
> is statically defined, it has to be declared as "static const uint8_t []"
> 
> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
> ---
>  soft-interface.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied in revision 94ca561.

Thanks,
Marek
  

Patch

diff --git a/soft-interface.c b/soft-interface.c
index f8a4a59..b56dafd 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -131,7 +131,8 @@  static int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
 	struct hard_iface *primary_if = NULL;
 	struct bcast_packet *bcast_packet;
 	struct vlan_ethhdr *vhdr;
-	uint8_t stp_addr[ETH_ALEN] = {0x01, 0x80, 0xC2, 0x00, 0x00, 0x00};
+	static const uint8_t stp_addr[ETH_ALEN] = {0x01, 0x80, 0xC2, 0x00, 0x00,
+						   0x00};
 	unsigned int header_len = 0;
 	int data_len = skb->len, ret;
 	short vid __maybe_unused = -1;