netdev
[Top] [All Lists]

[PATCH] etherdevice.h -- make constant args

To: "David S. Miller" <davem@xxxxxxxxxx>
Subject: [PATCH] etherdevice.h -- make constant args
From: Stephen Hemminger <shemminger@xxxxxxxx>
Date: Thu, 8 Apr 2004 11:06:53 -0700
Cc: netdev@xxxxxxxxxxx, Jeff Garzik <jgarzik@xxxxxxxxx>
Organization: Open Source Development Lab
Sender: netdev-bounce@xxxxxxxxxxx
Rather than forcing cast in some new validation code in the bridge;
please fix a couple of inline functions should have "const" on args.

diff -Nru a/include/linux/etherdevice.h b/include/linux/etherdevice.h
--- a/include/linux/etherdevice.h       Thu Apr  8 11:03:52 2004
+++ b/include/linux/etherdevice.h       Thu Apr  8 11:03:52 2004
@@ -40,7 +40,9 @@
                                         unsigned char *haddr);
 
 extern struct net_device *alloc_etherdev(int sizeof_priv);
-static inline void eth_copy_and_sum (struct sk_buff *dest, unsigned char *src, 
int len, int base)
+static inline void eth_copy_and_sum (struct sk_buff *dest, 
+                                    const unsigned char *src, 
+                                    int len, int base)
 {
        memcpy (dest->data, src, len);
 }
@@ -55,7 +57,7 @@
  *
  * Return true if the address is valid.
  */
-static inline int is_valid_ether_addr( u8 *addr )
+static inline int is_valid_ether_addr( const u8 *addr )
 {
        const char zaddr[6] = {0,};
 

<Prev in Thread] Current Thread [Next in Thread>