[PATCH 2/4] libertas: get rid of useless wlan_memchr() function

Dan Williams dcbw at redhat.com
Mon Aug 21 14:59:23 EDT 2006


Standard memchr should be enough.

Signed-off-by: Dan Williams <dcbw at redhat.com>

diff --git a/drivers/net/wireless/libertas/wlan_wext.c b/drivers/net/wireless/libertas/wlan_wext.c
index 0f77057..8c0bb7b 100644
--- a/drivers/net/wireless/libertas/wlan_wext.c
+++ b/drivers/net/wireless/libertas/wlan_wext.c
@@ -80,26 +80,6 @@ static int wlan_get_txpow(struct net_dev
 static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev);
 
 /** 
- *  @brief Find a character in a string.
- *   
- *  @param s	   A pointer to string
- *  @param c	   Character to be located 
- *  @param dlen    the length of string
- *  @return 	   A pointer to the first occurrence of c in string, or NULL if c is not found.
- */
-static void *wlan_memchr(void *s, int c, int n)
-{
-	const u8 *p = s;
-
-	while (n-- != 0) {
-		if ((u8) c == *p++) {
-			return (void *)(p - 1);
-		}
-	}
-	return NULL;
-}
-
-/** 
  *  @brief Convert mw value to dbm value
  *   
  *  @param mw	   the value of mw
@@ -2408,8 +2388,8 @@ u8 libertas_data_rate_to_index(u32 rate)
 	u8 *ptr;
 
 	if (rate)
-		if ((ptr = wlan_memchr(libertas_wlan_data_rates, (u8) rate,
-				       sizeof(libertas_wlan_data_rates))))
+		if ((ptr = memchr(libertas_wlan_data_rates, (u8) rate,
+				  sizeof(libertas_wlan_data_rates))))
 			return (ptr - libertas_wlan_data_rates);
 
 	return 0;





More information about the libertas-dev mailing list