Wei Yongjun | 21 Aug 2012 10:39
Picon

[PATCH] Staging: rtl8192u: using random_ether_addr() to generate random MAC

From: Wei Yongjun <yongjun_wei <at> trendmicro.com.cn>

Using random_ether_addr() to generate a random Ethernet
address (MAC) that is not multicast and has the local
assigned bit set. Not need to duplicating its implementation.

spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <yongjun_wei <at> trendmicro.com.cn>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index f6ff8cf..a9dc4a2 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
 <at>  <at>  -19,6 +19,7  <at>  <at> 
 #include <linux/random.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
+#include <linux/etherdevice.h>
 #include <asm/uaccess.h>
 #include "dot11d.h"

 <at>  <at>  -2286,13 +2287,7  <at>  <at>  void ieee80211_stop_queue(struct ieee80211_device *ieee)
 inline void ieee80211_randomize_cell(struct ieee80211_device *ieee)
 {

(Continue reading)


Gmane