linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/16] wilc1000: dead code removal and other cleanup
@ 2015-05-29 20:52 Arnd Bergmann
  2015-05-29 20:52 ` [PATCH 01/16] staging: wilc1000: remove linux version checks Arnd Bergmann
                   ` (15 more replies)
  0 siblings, 16 replies; 21+ messages in thread
From: Arnd Bergmann @ 2015-05-29 20:52 UTC (permalink / raw)
  To: Greg KH
  Cc: Rachel Kim, Dean Lee, Chris Park, devel, nicolas.ferre,
	Johnny Kim, linux-kernel, Arnd Bergmann

Hi Greg,

This turned out to be more work than the first version, but I
think I've split it up enough sensibly to allow review, and
I've added a few more patches at the end.

	Arnd

Arnd Bergmann (16):
  staging: wilc1000: remove linux version checks
  staging: wilc1000: remove platform version checks
  staging: wilc1000: remove thread wrapper
  staging: wilc1000: remove __DRIVER_VERSION__ macro
  staging: wilc1000: remove time wrapper
  staging: wilc1000: remove unused string functions
  staging: wilc1000: simplify msgqueue code
  staging: wilc1000: remove unused memory handling code
  staging: wilc1000: simplify semaphore wrapper
  staging: wilc1000: clean up sleep wrapper
  staging: wilc1000: clean up timer feature
  staging: wilc1000: remove unused OS abstraction features
  staging: wilc1000: remove EXPORT_SYMTAB
  staging: wilc1000: remove semaphore wrapper
  staging: wilc1000: fix const cast warnings
  staging: wilc1000: fix compiler warnings

 drivers/staging/wilc1000/Makefile                 |  13 +-
 drivers/staging/wilc1000/coreconfigurator.c       |  31 +-
 drivers/staging/wilc1000/fifo_buffer.c            | 108 ++---
 drivers/staging/wilc1000/fifo_buffer.h            |   2 +-
 drivers/staging/wilc1000/host_interface.c         | 219 ++++-----
 drivers/staging/wilc1000/host_interface.h         |  40 +-
 drivers/staging/wilc1000/linux_mon.c              |   2 +-
 drivers/staging/wilc1000/linux_wlan.c             |  98 +---
 drivers/staging/wilc1000/linux_wlan_spi.c         |   3 -
 drivers/staging/wilc1000/wilc_errorsupport.h      |  17 -
 drivers/staging/wilc1000/wilc_event.h             | 123 -----
 drivers/staging/wilc1000/wilc_memory.c            |   7 +-
 drivers/staging/wilc1000/wilc_memory.h            |  95 +---
 drivers/staging/wilc1000/wilc_msgqueue.c          |  41 +-
 drivers/staging/wilc1000/wilc_msgqueue.h          |  30 --
 drivers/staging/wilc1000/wilc_osconfig.h          |  46 --
 drivers/staging/wilc1000/wilc_oswrapper.h         |  61 ---
 drivers/staging/wilc1000/wilc_platform.h          | 131 +-----
 drivers/staging/wilc1000/wilc_semaphore.c         |  70 ---
 drivers/staging/wilc1000/wilc_semaphore.h         | 115 -----
 drivers/staging/wilc1000/wilc_sleep.c             |  18 -
 drivers/staging/wilc1000/wilc_sleep.h             |  30 +-
 drivers/staging/wilc1000/wilc_spi.c               |   4 +-
 drivers/staging/wilc1000/wilc_strutils.c          | 351 --------------
 drivers/staging/wilc1000/wilc_strutils.h          | 282 ------------
 drivers/staging/wilc1000/wilc_thread.c            |  35 --
 drivers/staging/wilc1000/wilc_thread.h            | 153 -------
 drivers/staging/wilc1000/wilc_time.c              | 163 -------
 drivers/staging/wilc1000/wilc_time.h              | 205 ---------
 drivers/staging/wilc1000/wilc_timer.c             |   6 -
 drivers/staging/wilc1000/wilc_timer.h             |  27 --
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 533 +---------------------
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.h |   9 +-
 drivers/staging/wilc1000/wilc_wfi_netdevice.h     |  12 +-
 drivers/staging/wilc1000/wilc_wlan.c              |   6 +-
 35 files changed, 226 insertions(+), 2860 deletions(-)
 delete mode 100644 drivers/staging/wilc1000/wilc_event.h
 delete mode 100644 drivers/staging/wilc1000/wilc_semaphore.c
 delete mode 100644 drivers/staging/wilc1000/wilc_semaphore.h
 delete mode 100644 drivers/staging/wilc1000/wilc_thread.c
 delete mode 100644 drivers/staging/wilc1000/wilc_thread.h
 delete mode 100644 drivers/staging/wilc1000/wilc_time.c
 delete mode 100644 drivers/staging/wilc1000/wilc_time.h

-- 
2.1.0.rc2


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 01/16] staging: wilc1000: remove linux version checks
  2015-05-29 20:52 [PATCH 00/16] wilc1000: dead code removal and other cleanup Arnd Bergmann
@ 2015-05-29 20:52 ` Arnd Bergmann
  2015-05-29 20:52 ` [PATCH 02/16] staging: wilc1000: remove platform " Arnd Bergmann
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 21+ messages in thread
From: Arnd Bergmann @ 2015-05-29 20:52 UTC (permalink / raw)
  To: Greg KH
  Cc: Rachel Kim, Dean Lee, Chris Park, devel, nicolas.ferre,
	Johnny Kim, linux-kernel, Arnd Bergmann

For code that is integrated into mainline Linux, checks for
the kernel version make no sense, because we know which version
we are compiling against.

This removes all checks and the associated dead code.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/wilc1000/linux_wlan.c             |  88 +---
 drivers/staging/wilc1000/wilc_sleep.c             |   8 -
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 486 +---------------------
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.h |   7 +-
 drivers/staging/wilc1000/wilc_wfi_netdevice.h     |   8 -
 5 files changed, 5 insertions(+), 592 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 18f1bd00201a..3f8b3c54f196 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -180,7 +180,6 @@ linux_wlan_t *g_linux_wlan;
 wilc_wlan_oup_t *gpstrWlanOps;
 WILC_Bool bEnablePS = WILC_TRUE;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
 static const struct net_device_ops wilc_netdev_ops = {
 	.ndo_init = mac_init_fn,
 	.ndo_open = mac_open,
@@ -191,37 +190,7 @@ static const struct net_device_ops wilc_netdev_ops = {
 	.ndo_set_rx_mode  = wilc_set_multicast_list,
 
 };
-#define wilc_set_netdev_ops(ndev) do { (ndev)->netdev_ops = &wilc_netdev_ops; } while (0)
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
 
-static const struct net_device_ops wilc_netdev_ops = {
-	.ndo_init = mac_init_fn,
-	.ndo_open = mac_open,
-	.ndo_stop = mac_close,
-	.ndo_start_xmit = mac_xmit,
-	.ndo_do_ioctl = mac_ioctl,
-	.ndo_get_stats = mac_stats,
-	.ndo_set_multicast_list = wilc_set_multicast_list,
-
-};
-
-#define wilc_set_netdev_ops(ndev) do { (ndev)->netdev_ops = &wilc_netdev_ops; } while (0)
-
-#else
-
-static void wilc_set_netdev_ops(struct net_device *ndev)
-{
-
-	ndev->init = mac_init_fn;
-	ndev->open = mac_open;
-	ndev->stop = mac_close;
-	ndev->hard_start_xmit = mac_xmit;
-	ndev->do_ioctl = mac_ioctl;
-	ndev->get_stats = mac_stats;
-	ndev->set_multicast_list = wilc_set_multicast_list,
-}
-
-#endif
 #ifdef DEBUG_MODE
 
 extern volatile int timeNo;
@@ -594,12 +563,7 @@ static void linux_wlan_msleep(uint32_t msc)
 {
 	if (msc <= 4000000) {
 		WILC_Uint32 u32Temp = msc * 1000;
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)
 		usleep_range(u32Temp, u32Temp);
-#else
-		/* This is delay not sleep !!!, has to be changed*/
-		msleep(msc);
-#endif
 	} else {
 		msleep(msc);
 	}
@@ -2195,7 +2159,6 @@ struct net_device_stats *mac_stats(struct net_device *dev)
 }
 
 /* Setup the multicast filter */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34)
 static void wilc_set_multicast_list(struct net_device *dev)
 {
 
@@ -2251,55 +2214,6 @@ static void wilc_set_multicast_list(struct net_device *dev)
 
 }
 
-#else
-
-static void wilc_set_multicast_list(struct net_device *dev)
-{
-	/* BIG Warning, Beware : Uncompiled, untested... */
-	struct dev_mc_list *mc_ptr;
-	int i = 0;
-
-	if (!dev)
-		return;
-
-	PRINT_D(INIT_DBG, "Setting Multicast List. \n");
-	PRINT_D(INIT_DBG, "dev->mc_count = %d\n", dev->mc_count);
-
-	if (dev->flags & IFF_PROMISC) {
-		/* Normally, we should configure the chip to retrive all packets
-		 * but we don't wanna support this right now */
-		/* TODO: add promiscuous mode support */
-		PRINT_D(INIT_DBG, "Set promiscuous mode ON, retrive all packets \n");
-		return;
-	}
-
-	/* If there's more addresses than we handle, get all multicast
-	 * packets and sort them out in software. */
-	if ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > WILC_MULTICAST_TABLE_SIZE)) {
-		PRINT_D(INIT_DBG, "Disable multicast filter, retrive all multicast packets\n");
-		host_int_setup_multicast_filter((WILC_WFIDrvHandle)gWFiDrvHandle, WILC_FALSE, 0);
-		return;
-	}
-
-	/* No multicast?  Just get our own stuff */
-	if (dev->mc_count == 0) {
-		PRINT_D(INIT_DBG, "Enable multicast filter, retrive directed packets only.\n");
-		host_int_setup_multicast_filter((WILC_WFIDrvHandle)gWFiDrvHandle, WILC_TRUE, 0);
-		return;
-	}
-
-	/* Store all of the multicast addresses in the hardware filter */
-
-	for (mc_ptr = dev->mc_list; mc_ptr; mc_ptr = mc_ptr->next, i++) {
-		WILC_memcpy(gau8MulticastMacAddrList[i], mc_ptr->dmi_addr, ETH_ALEN)
-		i++;
-	}
-
-	host_int_setup_multicast_filter((WILC_WFIDrvHandle)gWFiDrvHandle, WILC_TRUE, (dev->mc_count));
-
-}
-#endif
-
 static void linux_wlan_tx_complete(void *priv, int status)
 {
 
@@ -2765,7 +2679,7 @@ int wilc_netdev_init(void)
 		nic->wilc_netdev = ndev;
 		g_linux_wlan->strInterfaceInfo[g_linux_wlan->u8NoIfcs].wilc_netdev = ndev;
 		g_linux_wlan->u8NoIfcs++;
-		wilc_set_netdev_ops(ndev);
+		ndev->netdev_ops = &wilc_netdev_ops;
 
 		#ifdef USE_WIRELESS
 		{
diff --git a/drivers/staging/wilc1000/wilc_sleep.c b/drivers/staging/wilc1000/wilc_sleep.c
index 368157175f40..b8f45146956b 100644
--- a/drivers/staging/wilc1000/wilc_sleep.c
+++ b/drivers/staging/wilc1000/wilc_sleep.c
@@ -12,11 +12,7 @@ void WILC_Sleep(WILC_Uint32 u32TimeMilliSec)
 {
 	if (u32TimeMilliSec <= 4000000)	{
 		WILC_Uint32 u32Temp = u32TimeMilliSec * 1000;
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)
 		usleep_range(u32Temp, u32Temp);
-#else
-		udelay(u32Temp);
-#endif
 	} else {
 		msleep(u32TimeMilliSec);
 	}
@@ -27,10 +23,6 @@ void WILC_Sleep(WILC_Uint32 u32TimeMilliSec)
 /* #ifdef CONFIG_WILC_SLEEP_HI_RES */
 void WILC_SleepMicrosec(WILC_Uint32 u32TimeMicoSec)
 {
-	#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)
 	usleep_range(u32TimeMicoSec, u32TimeMicoSec);
-	#else
-	udelay(u32TimeMicoSec);
-	#endif
 }
 /* #endif */
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 648472925de0..c1d511825147 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -126,9 +126,7 @@ static struct ieee80211_supported_band WILC_WFI_band_2ghz = {
 /*BugID_5137*/
 struct add_key_params {
 	u8 key_idx;
-	#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
 	bool pairwise;
-	#endif
 	u8 *mac_addr;
 };
 struct add_key_params g_add_gtk_key_params;
@@ -202,30 +200,15 @@ void refresh_scan(void *pUserVoid, uint8_t all, WILC_Bool bDirectScan)
 
 			if (pstrNetworkInfo != WILC_NULL) {
 
-				#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 38)
 				s32Freq = ieee80211_channel_to_frequency((WILC_Sint32)pstrNetworkInfo->u8channel, IEEE80211_BAND_2GHZ);
-				#else
-				s32Freq = ieee80211_channel_to_frequency((WILC_Sint32)pstrNetworkInfo->u8channel);
-				#endif
-
 				channel = ieee80211_get_channel(wiphy, s32Freq);
 
 				rssi = get_rssi_avg(pstrNetworkInfo);
 				if (WILC_memcmp("DIRECT-", pstrNetworkInfo->au8ssid, 7) || bDirectScan)	{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
 					bss = cfg80211_inform_bss(wiphy, channel, CFG80211_BSS_FTYPE_UNKNOWN, pstrNetworkInfo->au8bssid, pstrNetworkInfo->u64Tsf, pstrNetworkInfo->u16CapInfo,
 								  pstrNetworkInfo->u16BeaconPeriod, (const u8 *)pstrNetworkInfo->pu8IEs,
 								  (size_t)pstrNetworkInfo->u16IEsLen, (((WILC_Sint32)rssi) * 100), GFP_KERNEL);
-#else
-					bss = cfg80211_inform_bss(wiphy, channel, pstrNetworkInfo->au8bssid, pstrNetworkInfo->u64Tsf, pstrNetworkInfo->u16CapInfo,
-								  pstrNetworkInfo->u16BeaconPeriod, (const u8 *)pstrNetworkInfo->pu8IEs,
-								  (size_t)pstrNetworkInfo->u16IEsLen, (((WILC_Sint32)rssi) * 100), GFP_KERNEL);
-#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)
 					cfg80211_put_bss(wiphy, bss);
-#else
-					cfg80211_put_bss(bss);
-#endif
 				}
 			}
 
@@ -417,11 +400,7 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, tstrNetworkInfo *pstrNetwo
 			}
 
 			if (pstrNetworkInfo != WILC_NULL) {
-				#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 38)
 				s32Freq = ieee80211_channel_to_frequency((WILC_Sint32)pstrNetworkInfo->u8channel, IEEE80211_BAND_2GHZ);
-				#else
-				s32Freq = ieee80211_channel_to_frequency((WILC_Sint32)pstrNetworkInfo->u8channel);
-				#endif
 				channel = ieee80211_get_channel(wiphy, s32Freq);
 
 				WILC_NULLCHECK(s32Error, channel);
@@ -448,20 +427,10 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, tstrNetworkInfo *pstrNetwo
 						/*P2P peers are sent to WPA supplicant and added to shadow table*/
 
 						if (!(WILC_memcmp("DIRECT-", pstrNetworkInfo->au8ssid, 7))) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
 							bss = cfg80211_inform_bss(wiphy, channel, CFG80211_BSS_FTYPE_UNKNOWN,  pstrNetworkInfo->au8bssid, pstrNetworkInfo->u64Tsf, pstrNetworkInfo->u16CapInfo,
 										  pstrNetworkInfo->u16BeaconPeriod, (const u8 *)pstrNetworkInfo->pu8IEs,
 										  (size_t)pstrNetworkInfo->u16IEsLen, (((WILC_Sint32)pstrNetworkInfo->s8rssi) * 100), GFP_KERNEL);
-#else
-							bss = cfg80211_inform_bss(wiphy, channel, pstrNetworkInfo->au8bssid, pstrNetworkInfo->u64Tsf, pstrNetworkInfo->u16CapInfo,
-										  pstrNetworkInfo->u16BeaconPeriod, (const u8 *)pstrNetworkInfo->pu8IEs,
-										  (size_t)pstrNetworkInfo->u16IEsLen, (((WILC_Sint32)pstrNetworkInfo->s8rssi) * 100), GFP_KERNEL);
-#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)
 							cfg80211_put_bss(wiphy, bss);
-#else
-							cfg80211_put_bss(bss);
-#endif
 						}
 
 
@@ -730,27 +699,8 @@ static void CfgConnectResult(tenuConnDisconnEvent enuConnDisconnEvent,
  *  @date	01 MAR 2012
  *  @version	1.0
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
-/*
- *	struct changed from v3.8.0
- *	tony, sswd, WILC-KR, 2013-10-29
- *	struct cfg80211_chan_def {
- *       struct ieee80211_channel *chan;
- *       enum nl80211_chan_width width;
- *       u32 center_freq1;
- *       u32 center_freq2;
- *      };
- */
 static int WILC_WFI_CfgSetChannel(struct wiphy *wiphy,
 				  struct cfg80211_chan_def *chandef)
-#else
-static int WILC_WFI_CfgSetChannel(struct wiphy *wiphy,
-	#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 32)
-				  struct net_device *netdev,
-	#endif
-				  struct ieee80211_channel *channel,
-				  enum nl80211_channel_type channel_type)
-#endif
 {
 
 	WILC_Uint32 channelnum = 0;
@@ -758,14 +708,8 @@ static int WILC_WFI_CfgSetChannel(struct wiphy *wiphy,
 	WILC_Sint32 s32Error = WILC_SUCCESS;
 	priv = wiphy_priv(wiphy);
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) /* tony for v3.8.0 support */
 	channelnum = ieee80211_frequency_to_channel(chandef->chan->center_freq);
 	PRINT_D(CFG80211_DBG, "Setting channel %d with frequency %d\n", channelnum, chandef->chan->center_freq);
-#else
-	channelnum = ieee80211_frequency_to_channel(channel->center_freq);
-
-	PRINT_D(CFG80211_DBG, "Setting channel %d with frequency %d\n", channelnum, channel->center_freq);
-#endif
 
 	u8CurrChannel = channelnum;
 	s32Error   = host_int_set_mac_chnl_num(priv->hWILCWFIDrv, channelnum);
@@ -793,11 +737,7 @@ static int WILC_WFI_CfgSetChannel(struct wiphy *wiphy,
  *	kernel version 3.8.8 supported
  *	tony, sswd, WILC-KR, 2013-10-29
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
 static int WILC_WFI_CfgScan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
-#else
-static int WILC_WFI_CfgScan(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_scan_request *request)
-#endif
 {
 	struct WILC_WFI_priv *priv;
 	WILC_Uint32 i;
@@ -807,10 +747,6 @@ static int WILC_WFI_CfgScan(struct wiphy *wiphy, struct net_device *dev, struct
 
 	priv = wiphy_priv(wiphy);
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0)
-	PRINT_D(CORECONFIG_DBG, "Scan on netdev [%p] host if [%x]\n", dev, (WILC_Uint32)priv->hWILCWFIDrv);
-#endif
-
 	/*if(connecting)
 	 *              return -EBUSY; */
 
@@ -819,18 +755,10 @@ static int WILC_WFI_CfgScan(struct wiphy *wiphy, struct net_device *dev, struct
 	/*requests "create group" during a running scan*/
 	/* host_int_set_wfi_drv_handler(priv->hWILCWFIDrv); */
 #if 0
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) /* tony for v3.8.0 support */
 	if (priv->dev->ieee80211_ptr->iftype == NL80211_IFTYPE_AP) {
 		PRINT_D(GENERIC_DBG, "Required scan while in AP mode");
 		return s32Error;
 	}
-#else
-	if (dev->ieee80211_ptr->iftype == NL80211_IFTYPE_AP) {
-		PRINT_D(GENERIC_DBG, "Required scan while in AP mode");
-		s32Error = WILC_BUSY;
-		return s32Error;
-	}
-#endif
 #endif /* end of if 0 */
 	priv->pstrScanReq = request;
 
@@ -1224,9 +1152,7 @@ static int WILC_WFI_disconnect(struct wiphy *wiphy, struct net_device *dev, u16
  *  @version	1.0
  */
 static int WILC_WFI_add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
-	#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
 			    bool pairwise,
-	#endif
 			    const u8 *mac_addr, struct key_params *params)
 
 {
@@ -1316,11 +1242,7 @@ static int WILC_WFI_add_key(struct wiphy *wiphy, struct net_device *netdev, u8 k
 
 
 
-					#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
 			if (!pairwise)
-					#else
-			if (!mac_addr || is_broadcast_ether_addr(mac_addr))
-					#endif
 			{
 				if (params->cipher == WLAN_CIPHER_SUITE_TKIP)
 					u8gmode = ENCRYPT_ENABLED | WPA | TKIP;
@@ -1419,11 +1341,7 @@ static int WILC_WFI_add_key(struct wiphy *wiphy, struct net_device *netdev, u8 k
 
 		{
 			u8mode = 0;
-			 #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
 			if (!pairwise)
-			 #else
-			if (!mac_addr || is_broadcast_ether_addr(mac_addr))
-			#endif
 			{
 				if (params->key_len > 16 && params->cipher == WLAN_CIPHER_SUITE_TKIP) {
 					/* swap the tx mic by rx mic */
@@ -1436,9 +1354,7 @@ static int WILC_WFI_add_key(struct wiphy *wiphy, struct net_device *netdev, u8 k
 				/*save keys only on interface 0 (wifi interface)*/
 				if (!g_gtk_keys_saved && netdev == g_linux_wlan->strInterfaceInfo[0].wilc_netdev) {
 					g_add_gtk_key_params.key_idx = key_index;
-						#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
 					g_add_gtk_key_params.pairwise = pairwise;
-						#endif
 					if (!mac_addr) {
 						g_add_gtk_key_params.mac_addr = NULL;
 					} else {
@@ -1476,9 +1392,7 @@ static int WILC_WFI_add_key(struct wiphy *wiphy, struct net_device *netdev, u8 k
 				/*save keys only on interface 0 (wifi interface)*/
 				if (!g_ptk_keys_saved && netdev == g_linux_wlan->strInterfaceInfo[0].wilc_netdev) {
 					g_add_ptk_key_params.key_idx = key_index;
-						#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
 					g_add_ptk_key_params.pairwise = pairwise;
-						#endif
 					if (!mac_addr) {
 						g_add_ptk_key_params.mac_addr = NULL;
 					} else {
@@ -1533,9 +1447,7 @@ static int WILC_WFI_add_key(struct wiphy *wiphy, struct net_device *netdev, u8 k
  */
 static int WILC_WFI_del_key(struct wiphy *wiphy, struct net_device *netdev,
 			    u8 key_index,
-	#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
 			    bool pairwise,
-	#endif
 			    const u8 *mac_addr)
 {
 	struct WILC_WFI_priv *priv;
@@ -1645,9 +1557,7 @@ static int WILC_WFI_del_key(struct wiphy *wiphy, struct net_device *netdev,
  *  @version	1.0
  */
 static int WILC_WFI_get_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
-	#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
 			    bool pairwise,
-	#endif
 			    const u8 *mac_addr, void *cookie, void (*callback)(void *cookie, struct key_params *))
 {
 
@@ -1659,11 +1569,7 @@ static int WILC_WFI_get_key(struct wiphy *wiphy, struct net_device *netdev, u8 k
 	priv = wiphy_priv(wiphy);
 
 
-		#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
 	if (!pairwise)
-		#else
-	if (!mac_addr || is_broadcast_ether_addr(mac_addr))
-		#endif
 	{
 		PRINT_D(CFG80211_DBG, "Getting group key idx: %x\n", key_index);
 
@@ -1700,11 +1606,8 @@ static int WILC_WFI_get_key(struct wiphy *wiphy, struct net_device *netdev, u8 k
  *  @date	01 MAR 2012
  *  @version	1.0
  */
-static int WILC_WFI_set_default_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index
-	#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 37)
-				    , bool unicast, bool multicast
-	#endif
-				    )
+static int WILC_WFI_set_default_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
+				    bool unicast, bool multicast)
 {
 	WILC_Sint32 s32Error = WILC_SUCCESS;
 	struct WILC_WFI_priv *priv;
@@ -1794,11 +1697,7 @@ static int WILC_WFI_get_station(struct wiphy *wiphy, struct net_device *dev,
 			return s32Error;
 		}
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)	//0421
 		sinfo->filled |= BIT(NL80211_STA_INFO_INACTIVE_TIME);
-#else
-		sinfo->filled |= STATION_INFO_INACTIVE_TIME;
-#endif
 
 		host_int_get_inactive_time(priv->hWILCWFIDrv, mac, &(inactive_time));
 		sinfo->inactive_time = 1000 * inactive_time;
@@ -1816,26 +1715,16 @@ static int WILC_WFI_get_station(struct wiphy *wiphy, struct net_device *dev,
 		 * tx_failed introduced more than
 		 * kernel version 3.0.0
 		 */
-	#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)	//0421
 		sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL) |
 						BIT( NL80211_STA_INFO_RX_PACKETS) |
 						BIT(NL80211_STA_INFO_TX_PACKETS) |
 						BIT(NL80211_STA_INFO_TX_FAILED) |
 						BIT(NL80211_STA_INFO_TX_BITRATE);
-    #elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)
-		sinfo->filled |= STATION_INFO_SIGNAL | STATION_INFO_RX_PACKETS | STATION_INFO_TX_PACKETS
-			| STATION_INFO_TX_FAILED | STATION_INFO_TX_BITRATE;
-    #else
-		sinfo->filled |= STATION_INFO_SIGNAL | STATION_INFO_RX_PACKETS | STATION_INFO_TX_PACKETS
-			| STATION_INFO_TX_BITRATE;
-    #endif
 
 		sinfo->signal		=  strStatistics.s8RSSI;
 		sinfo->rx_packets   =  strStatistics.u32RxCount;
 		sinfo->tx_packets   =  strStatistics.u32TxCount + strStatistics.u32TxFailureCount;
-    #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)
 		sinfo->tx_failed	=  strStatistics.u32TxFailureCount;
-    #endif
 		sinfo->txrate.legacy = strStatistics.u8LinkSpeed * 10;
 
 #ifdef TCP_ENHANCEMENTS
@@ -1846,13 +1735,8 @@ static int WILC_WFI_get_station(struct wiphy *wiphy, struct net_device *dev,
 		}
 #endif
 
-    #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)
 		PRINT_D(CORECONFIG_DBG, "*** stats[%d][%d][%d][%d][%d]\n", sinfo->signal, sinfo->rx_packets, sinfo->tx_packets,
 			sinfo->tx_failed, sinfo->txrate.legacy);
-    #else
-		PRINT_D(CORECONFIG_DBG, "*** stats[%d][%d][%d][%d]\n", sinfo->signal, sinfo->rx_packets, sinfo->tx_packets,
-			sinfo->txrate.legacy);
-    #endif
 	}
 	return s32Error;
 }
@@ -2008,7 +1892,7 @@ static int WILC_WFI_set_wiphy_params(struct wiphy *wiphy, u32 changed)
 
 	return s32Error;
 }
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 32)
+
 /**
  *  @brief      WILC_WFI_set_bitrate_mask
  *  @details    set the bitrate mask configuration
@@ -2166,7 +2050,6 @@ static int  WILC_WFI_flush_pmksa(struct wiphy *wiphy, struct net_device *netdev)
 
 	return 0;
 }
-#endif
 
 #ifdef WILC_P2P
 
@@ -2388,29 +2271,17 @@ void WILC_WFI_p2p_rx (struct net_device *dev, uint8_t *buff, uint32_t size)
 	if (pkt_offset & IS_MANAGMEMENT_CALLBACK) {
 		if (buff[FRAME_TYPE_ID] == IEEE80211_STYPE_PROBE_RESP) {
 			PRINT_D(GENERIC_DBG, "Probe response ACK\n");
-			#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
-			cfg80211_mgmt_tx_status(dev, priv->u64tx_cookie, buff, size, true, GFP_KERNEL);
-			#else
 			cfg80211_mgmt_tx_status(priv->wdev, priv->u64tx_cookie, buff, size, true, GFP_KERNEL);
-			#endif
 			return;
 		} else {
 			if (pkt_offset & IS_MGMT_STATUS_SUCCES)	{
 				PRINT_D(GENERIC_DBG, "Success Ack - Action frame category: %x Action Subtype: %d Dialog T: %x OR %x\n", buff[ACTION_CAT_ID], buff[ACTION_SUBTYPE_ID],
 					buff[ACTION_SUBTYPE_ID + 1], buff[P2P_PUB_ACTION_SUBTYPE + 1]);
-				#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
-				cfg80211_mgmt_tx_status(dev, priv->u64tx_cookie, buff, size, true, GFP_KERNEL);
-				#else
 				cfg80211_mgmt_tx_status(priv->wdev, priv->u64tx_cookie, buff, size, true, GFP_KERNEL);
-				#endif
 			} else {
 				PRINT_D(GENERIC_DBG, "Fail Ack - Action frame category: %x Action Subtype: %d Dialog T: %x OR %x\n", buff[ACTION_CAT_ID], buff[ACTION_SUBTYPE_ID],
 					buff[ACTION_SUBTYPE_ID + 1], buff[P2P_PUB_ACTION_SUBTYPE + 1]);
-				#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
-				cfg80211_mgmt_tx_status(dev, priv->u64tx_cookie, buff, size, false, GFP_KERNEL);
-				#else
 				cfg80211_mgmt_tx_status(priv->wdev, priv->u64tx_cookie, buff, size, false, GFP_KERNEL);
-				#endif
 			}
 			return;
 		}
@@ -2420,11 +2291,7 @@ void WILC_WFI_p2p_rx (struct net_device *dev, uint8_t *buff, uint32_t size)
 
 		/*BugID_5442*/
 		/*Upper layer is informed that the frame is received on this freq*/
-		#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 38)
 		s32Freq = ieee80211_channel_to_frequency(u8CurrChannel, IEEE80211_BAND_2GHZ);
-		#else
-		s32Freq = ieee80211_channel_to_frequency(u8CurrChannel);
-		#endif
 
 		if (ieee80211_is_action(buff[FRAME_TYPE_ID])) {
 			PRINT_D(GENERIC_DBG, "Rx Action Frame Type: %x %x\n", buff[ACTION_SUBTYPE_ID], buff[P2P_PUB_ACTION_SUBTYPE]);
@@ -2478,18 +2345,7 @@ void WILC_WFI_p2p_rx (struct net_device *dev, uint8_t *buff, uint32_t size)
 					if ((buff[P2P_PUB_ACTION_SUBTYPE] == GO_NEG_REQ || buff[P2P_PUB_ACTION_SUBTYPE] == GO_NEG_RSP) && (bWilc_ie))	{
 						PRINT_D(GENERIC_DBG, "Sending P2P to host without extra elemnt\n");
 						/* extra attribute for sig_dbm: signal strength in mBm, or 0 if unknown */
-							#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
 						cfg80211_rx_mgmt(priv->wdev, s32Freq, 0, buff, size - 7, 0);
-							#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
-						cfg80211_rx_mgmt(priv->wdev, s32Freq, 0, buff, size - 7, 0, GFP_ATOMIC);
-							#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
-						cfg80211_rx_mgmt(priv->wdev, s32Freq, 0, buff, size - 7, GFP_ATOMIC);
-							#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0))
-						cfg80211_rx_mgmt(dev, s32Freq, 0, buff, size - 7, GFP_ATOMIC);          /* rachel */
-							#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0))
-						cfg80211_rx_mgmt(dev, s32Freq, buff, size - 7, GFP_ATOMIC);
-							#endif
-
 						return;
 					}
 					break;
@@ -2501,17 +2357,7 @@ void WILC_WFI_p2p_rx (struct net_device *dev, uint8_t *buff, uint32_t size)
 			}
 		}
 
-		#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
 		cfg80211_rx_mgmt(priv->wdev, s32Freq, 0, buff, size - 7, 0);
-		#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
-		cfg80211_rx_mgmt(priv->wdev, s32Freq, 0, buff, size - 7, 0, GFP_ATOMIC);
-		#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
-		cfg80211_rx_mgmt(priv->wdev, s32Freq, 0, buff, size, GFP_ATOMIC);
-		#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0))
-		cfg80211_rx_mgmt(dev, s32Freq, 0, buff, size, GFP_ATOMIC);
-		#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0))
-		cfg80211_rx_mgmt(dev, s32Freq, buff, size, GFP_ATOMIC);
-		#endif
 	}
 }
 
@@ -2553,20 +2399,11 @@ static void WILC_WFI_RemainOnChannelReady(void *pUserVoid)
 
 	priv->bInP2PlistenState = WILC_TRUE;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
 	cfg80211_ready_on_channel(priv->wdev,
 				  priv->strRemainOnChanParams.u64ListenCookie,
 				  priv->strRemainOnChanParams.pstrListenChan,
 				  priv->strRemainOnChanParams.u32ListenDuration,
 				  GFP_KERNEL);
-#else
-	cfg80211_ready_on_channel(priv->dev,
-				  priv->strRemainOnChanParams.u64ListenCookie,
-				  priv->strRemainOnChanParams.pstrListenChan,
-				  priv->strRemainOnChanParams.tenuChannelType,
-				  priv->strRemainOnChanParams.u32ListenDuration,
-				  GFP_KERNEL);
-#endif
 }
 
 /**
@@ -2591,18 +2428,10 @@ static void WILC_WFI_RemainOnChannelExpired(void *pUserVoid, WILC_Uint32 u32Sess
 		priv->bInP2PlistenState = WILC_FALSE;
 
 		/*Inform wpas of remain-on-channel expiration*/
-	#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
 		cfg80211_remain_on_channel_expired(priv->wdev,
 						   priv->strRemainOnChanParams.u64ListenCookie,
 						   priv->strRemainOnChanParams.pstrListenChan,
 						   GFP_KERNEL);
-	#else
-		cfg80211_remain_on_channel_expired(priv->dev,
-						   priv->strRemainOnChanParams.u64ListenCookie,
-						   priv->strRemainOnChanParams.pstrListenChan,
-						   priv->strRemainOnChanParams.tenuChannelType,
-						   GFP_KERNEL);
-	#endif
 	} else {
 		PRINT_D(GENERIC_DBG, "Received ID 0x%x Expected ID 0x%x (No match)\n", u32SessionID
 			, priv->strRemainOnChanParams.u32ListenSessionID);
@@ -2624,15 +2453,8 @@ static void WILC_WFI_RemainOnChannelExpired(void *pUserVoid, WILC_Uint32 u32Sess
  *  @version	1.0
  */
 static int  WILC_WFI_remain_on_channel(struct wiphy *wiphy,
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
 				       struct wireless_dev *wdev,
-#else
-				       struct net_device *dev,
-#endif
 				       struct ieee80211_channel *chan,
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0))
-				       enum nl80211_channel_type channel_type,
-#endif
 				       unsigned int duration, u64 *cookie)
 {
 	WILC_Sint32 s32Error = WILC_SUCCESS;
@@ -2645,26 +2467,16 @@ static int  WILC_WFI_remain_on_channel(struct wiphy *wiphy,
 	/*This check is to handle the situation when user*/
 	/*requests "create group" during a running scan*/
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
 	if (wdev->iftype == NL80211_IFTYPE_AP) {
 		PRINT_D(GENERIC_DBG, "Required remain-on-channel while in AP mode");
 		return s32Error;
 	}
-#else
-	if (dev->ieee80211_ptr->iftype == NL80211_IFTYPE_AP) {
-		PRINT_D(GENERIC_DBG, "Required remain-on-channel while in AP mode");
-		return s32Error;
-	}
-#endif
 
 	u8CurrChannel = chan->hw_value;
 
 	/*Setting params needed by WILC_WFI_RemainOnChannelExpired()*/
 	priv->strRemainOnChanParams.pstrListenChan = chan;
 	priv->strRemainOnChanParams.u64ListenCookie = *cookie;
-	#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0))
-	priv->strRemainOnChanParams.tenuChannelType = channel_type;
-	#endif
 	priv->strRemainOnChanParams.u32ListenDuration = duration;
 	priv->strRemainOnChanParams.u32ListenSessionID++;
 
@@ -2693,11 +2505,7 @@ static int  WILC_WFI_remain_on_channel(struct wiphy *wiphy,
  *  @version	1.0
  */
 static int   WILC_WFI_cancel_remain_on_channel(struct wiphy *wiphy,
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
 					       struct wireless_dev *wdev,
-#else
-					       struct net_device *dev,
-#endif
 					       u64 cookie)
 {
 	WILC_Sint32 s32Error = WILC_SUCCESS;
@@ -2736,57 +2544,14 @@ void WILC_WFI_add_wilcvendorspec(WILC_Uint8 *buff)
 extern linux_wlan_t *g_linux_wlan;
 extern WILC_Bool bEnablePS;
 int WILC_WFI_mgmt_tx(struct wiphy *wiphy,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
 			struct wireless_dev *wdev,
 			struct cfg80211_mgmt_tx_params *params,
 			u64 *cookie)
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
-			struct wireless_dev *wdev,
-			struct ieee80211_channel *chan,
-			bool offchan,
-			unsigned int wait,
-			const u8 *buf,
-			size_t len,
-			bool no_cck,
-			bool dont_wait_for_ack, u64 *cookie)
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
-			struct wireless_dev *wdev,
-			struct ieee80211_channel *chan, bool offchan,
-			enum nl80211_channel_type channel_type,
-			bool channel_type valid,
-			unsigned int wait, const u8 *buf,
-			size_t len, bool no_cck,
-			bool dont_wait_for_ack, u64 *cookie)
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0))
-			struct net_device *dev,
-			struct ieee80211_channel *chan, bool offchan,
-			enum nl80211_channel_type channel_type,
-			bool channel_type_valid,
-			unsigned int wait, const u8 *buf,
-			size_t len, bool no_cck,
-			bool dont_wait_for_ack, u64 *cookie)
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0))
-			struct net_device *dev,
-			struct ieee80211_channel *chan, bool offchan,
-			enum nl80211_channel_type channel_type,
-			bool channel_type_valid,
-			unsigned int wait, const u8 *buf,
-			size_t len, bool no_cck, u64 *cookie)
-#else
-			struct net_device *dev,
-			struct ieee80211_channel *chan, bool offchan,
-			enum nl80211_channel_type channel_type,
-			bool channel_type_valid,
-			unsigned int wait, const u8 *buf,
-			size_t len, u64 *cookie)
-#endif
 {
-	#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
 	struct ieee80211_channel *chan = params->chan;
 	unsigned int wait = params->wait;
 	const u8 *buf = params->buf;
 	size_t len = params->len;
-	#endif
 	const struct ieee80211_mgmt *mgmt;
 	struct p2p_mgmt_data *mgmt_tx;
 	struct WILC_WFI_priv *priv;
@@ -2796,11 +2561,7 @@ int WILC_WFI_mgmt_tx(struct wiphy *wiphy,
 	perInterface_wlan_t *nic;
 	WILC_Uint32 buf_len = len + sizeof(u8P2P_vendorspec) + sizeof(u8P2Plocalrandom);
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
 	nic = netdev_priv(wdev->netdev);
-#else
-	nic = netdev_priv(dev);
-#endif
 	priv = wiphy_priv(wiphy);
 	pstrWFIDrv = (tstrWILC_WFIDrv *)priv->hWILCWFIDrv;
 
@@ -2938,11 +2699,7 @@ int WILC_WFI_mgmt_tx(struct wiphy *wiphy,
 }
 
 int   WILC_WFI_mgmt_tx_cancel_wait(struct wiphy *wiphy,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
 				   struct wireless_dev *wdev,
-#else
-				   struct net_device *dev,
-#endif
 				   u64 cookie)
 {
 	struct WILC_WFI_priv *priv;
@@ -2957,46 +2714,16 @@ int   WILC_WFI_mgmt_tx_cancel_wait(struct wiphy *wiphy,
 	if (priv->bInP2PlistenState == WILC_FALSE) {
 		/* Bug 5504: This is just to avoid connection failure when getting stuck when the supplicant
 		 *                      considers the driver falsely that it is in Listen state */
-		#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
 		cfg80211_remain_on_channel_expired(priv->wdev,
 						   priv->strRemainOnChanParams.u64ListenCookie,
 						   priv->strRemainOnChanParams.pstrListenChan,
 						   GFP_KERNEL);
-		#else
-		cfg80211_remain_on_channel_expired(priv->dev,
-						   priv->strRemainOnChanParams.u64ListenCookie,
-						   priv->strRemainOnChanParams.pstrListenChan,
-						   priv->strRemainOnChanParams.tenuChannelType,
-						   GFP_KERNEL);
-		#endif
-
 	}
 
 	return 0;
 }
 
 /**
- *  @brief      WILC_WFI_action
- *  @details Transmit an action frame
- *  @param[in]
- *  @return     int : Return 0 on Success.
- *  @author	mdaftedar
- *  @date	01 JUL 2012
- *  @version	1.0
- * */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34)
-int  WILC_WFI_action(struct wiphy *wiphy, struct net_device *dev,
-		     struct ieee80211_channel *chan, enum nl80211_channel_type channel_type,
-		     const u8 *buf, size_t len, u64 *cookie)
-{
-	PRINT_D(HOSTAPD_DBG, "In action function\n");
-	return WILC_SUCCESS;
-}
-#endif
-#else
-
-/**
  *  @brief      WILC_WFI_frame_register
  *  @details Notify driver that a management frame type was
  *              registered. Note that this callback may not sleep, and cannot run
@@ -3008,11 +2735,7 @@ int  WILC_WFI_action(struct wiphy *wiphy, struct net_device *dev,
  *  @version
  */
 void    WILC_WFI_frame_register(struct wiphy *wiphy,
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
 				struct wireless_dev *wdev,
-#else
-				struct net_device *dev,
-#endif
 				u16 frame_type, bool reg)
 {
 
@@ -3060,7 +2783,6 @@ void    WILC_WFI_frame_register(struct wiphy *wiphy,
 
 
 }
-#endif
 #endif /*WILC_P2P*/
 
 /**
@@ -3107,11 +2829,7 @@ static int WILC_WFI_dump_station(struct wiphy *wiphy, struct net_device *dev,
 	priv = wiphy_priv(wiphy);
 	/* priv = netdev_priv(priv->wdev->netdev); */
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))	//0421
 	sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
-#else
-	sinfo->filled |= STATION_INFO_SIGNAL;
-#endif
 
 	host_int_get_rssi(priv->hWILCWFIDrv, &(sinfo->signal));
 
@@ -3279,18 +2997,14 @@ static int WILC_WFI_change_virt_intf(struct wiphy *wiphy, struct net_device *dev
 				WILC_WFI_add_key(g_linux_wlan->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
 						 g_linux_wlan->strInterfaceInfo[0].wilc_netdev,
 						 g_add_ptk_key_params.key_idx,
-									#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
 						 g_add_ptk_key_params.pairwise,
-									#endif
 						 g_add_ptk_key_params.mac_addr,
 						 (struct key_params *)(&g_key_ptk_params));
 
 				WILC_WFI_add_key(g_linux_wlan->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
 						 g_linux_wlan->strInterfaceInfo[0].wilc_netdev,
 						 g_add_gtk_key_params.key_idx,
-									#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
 						 g_add_gtk_key_params.pairwise,
-									#endif
 						 g_add_gtk_key_params.mac_addr,
 						 (struct key_params *)(&g_key_gtk_params));
 			}
@@ -3372,18 +3086,14 @@ static int WILC_WFI_change_virt_intf(struct wiphy *wiphy, struct net_device *dev
 				WILC_WFI_add_key(g_linux_wlan->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
 						 g_linux_wlan->strInterfaceInfo[0].wilc_netdev,
 						 g_add_ptk_key_params.key_idx,
-									#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
 						 g_add_ptk_key_params.pairwise,
-									#endif
 						 g_add_ptk_key_params.mac_addr,
 						 (struct key_params *)(&g_key_ptk_params));
 
 				WILC_WFI_add_key(g_linux_wlan->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
 						 g_linux_wlan->strInterfaceInfo[0].wilc_netdev,
 						 g_add_gtk_key_params.key_idx,
-									#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
 						 g_add_gtk_key_params.pairwise,
-									#endif
 						 g_add_gtk_key_params.mac_addr,
 						 (struct key_params *)(&g_key_gtk_params));
 			}
@@ -3531,18 +3241,14 @@ static int WILC_WFI_change_virt_intf(struct wiphy *wiphy, struct net_device *dev
 			WILC_WFI_add_key(g_linux_wlan->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
 					 g_linux_wlan->strInterfaceInfo[0].wilc_netdev,
 					 g_add_ptk_key_params.key_idx,
-								#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
 					 g_add_ptk_key_params.pairwise,
-								#endif
 					 g_add_ptk_key_params.mac_addr,
 					 (struct key_params *)(&g_key_ptk_params));
 
 			WILC_WFI_add_key(g_linux_wlan->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
 					 g_linux_wlan->strInterfaceInfo[0].wilc_netdev,
 					 g_add_gtk_key_params.key_idx,
-								#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
 					 g_add_gtk_key_params.pairwise,
-								#endif
 					 g_add_gtk_key_params.mac_addr,
 					 (struct key_params *)(&g_key_gtk_params));
 			#endif
@@ -3574,7 +3280,6 @@ static int WILC_WFI_change_virt_intf(struct wiphy *wiphy, struct net_device *dev
 	return s32Error;
 }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)
 /* (austin.2013-07-23)
  *
  *      To support revised cfg80211_ops
@@ -3614,12 +3319,10 @@ static int WILC_WFI_start_ap(struct wiphy *wiphy, struct net_device *dev,
 	PRINT_D(HOSTAPD_DBG, "Interval = %d \n DTIM period = %d\n Head length = %d Tail length = %d\n",
 		settings->beacon_interval, settings->dtim_period, beacon->head_len, beacon->tail_len);
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
 	s32Error = WILC_WFI_CfgSetChannel(wiphy, &settings->chandef);
 
 	if (s32Error != WILC_SUCCESS)
 		PRINT_ER("Error in setting channel\n");
-#endif
 
 	linux_wlan_set_bssid(dev, g_linux_wlan->strInterfaceInfo[0].aSrcAddress);
 
@@ -3718,116 +3421,6 @@ static int  WILC_WFI_stop_ap(struct wiphy *wiphy, struct net_device *dev)
 	return s32Error;
 }
 
-#else /* here belows are original for < kernel 3.3 (austin.2013-07-23) */
-
-/**
- *  @brief      WILC_WFI_add_beacon
- *  @details    Add a beacon with given parameters, @head, @interval
- *                      and @dtim_period will be valid, @tail is optional.
- *  @param[in]   wiphy
- *  @param[in]   dev	The net device structure
- *  @param[in]   info	Parameters for the beacon to be added
- *  @return     int : Return 0 on Success.
- *  @author	mdaftedar
- *  @date	01 MAR 2012
- *  @version	1.0
- */
-static int WILC_WFI_add_beacon(struct wiphy *wiphy, struct net_device *dev,
-			       struct beacon_parameters *info)
-{
-	WILC_Sint32 s32Error = WILC_SUCCESS;
-	struct WILC_WFI_priv *priv;
-
-
-
-	priv = wiphy_priv(wiphy);
-	PRINT_D(HOSTAPD_DBG, "Adding Beacon\n");
-
-	PRINT_D(HOSTAPD_DBG, "Interval = %d \n DTIM period = %d\n Head length = %d Tail length = %d\n", info->interval, info->dtim_period, info->head_len, info->tail_len);
-
-	linux_wlan_set_bssid(dev, g_linux_wlan->strInterfaceInfo[0].aSrcAddress);
-
-	#ifndef WILC_FULLY_HOSTING_AP
-	s32Error = host_int_add_beacon(priv->hWILCWFIDrv, info->interval,
-				       info->dtim_period,
-				       info->head_len, info->head,
-				       info->tail_len, info->tail);
-
-	#else
-	s32Error = host_add_beacon(priv->hWILCWFIDrv, info->interval,
-				   info->dtim_period,
-				   info->head_len, info->head,
-				   info->tail_len, info->tail);
-	#endif
-
-	return s32Error;
-}
-
-/**
- *  @brief      WILC_WFI_set_beacon
- *  @details    Change the beacon parameters for an access point mode
- *                      interface. This should reject the call when no beacon has been
- *                      configured.
- *  @param[in]
- *  @return     int : Return 0 on Success.
- *  @author	mdaftedar
- *  @date	01 MAR 2012
- *  @version	1.0
- */
-static int  WILC_WFI_set_beacon(struct wiphy *wiphy, struct net_device *dev,
-				struct beacon_parameters *info)
-{
-	WILC_Sint32 s32Error = WILC_SUCCESS;
-
-
-	PRINT_D(HOSTAPD_DBG, "Setting beacon\n");
-
-	s32Error = WILC_WFI_add_beacon(wiphy, dev, info);
-
-	return s32Error;
-}
-
-/**
- *  @brief      WILC_WFI_del_beacon
- *  @details    Remove beacon configuration and stop sending the beacon.
- *  @param[in]
- *  @return     int : Return 0 on Success.
- *  @author	mdaftedar
- *  @date	01 MAR 2012
- *  @version	1.0
- */
-static int  WILC_WFI_del_beacon(struct wiphy *wiphy, struct net_device *dev)
-{
-	WILC_Sint32 s32Error = WILC_SUCCESS;
-	struct WILC_WFI_priv *priv;
-	WILC_Uint8 NullBssid[ETH_ALEN] = {0};
-
-
-	WILC_NULLCHECK(s32Error, wiphy);
-
-	priv = wiphy_priv(wiphy);
-
-	PRINT_D(HOSTAPD_DBG, "Deleting beacon\n");
-
-	/*BugID_5188*/
-	linux_wlan_set_bssid(dev, NullBssid);
-
-	#ifndef WILC_FULLY_HOSTING_AP
-	s32Error = host_int_del_beacon(priv->hWILCWFIDrv);
-	#else
-	s32Error = host_del_beacon(priv->hWILCWFIDrv);
-	#endif
-
-	WILC_ERRORCHECK(s32Error);
-
-	WILC_CATCH(s32Error)
-	{
-	}
-	return s32Error;
-}
-
-#endif  /* linux kernel 3.4+ (austin.2013-07-23) */
-
 /**
  *  @brief      WILC_WFI_add_station
  *  @details    Add a new station.
@@ -3923,15 +3516,9 @@ static int  WILC_WFI_add_station(struct wiphy *wiphy, struct net_device *dev,
  *  @version	1.0
  */
 static int WILC_WFI_del_station(struct wiphy *wiphy, struct net_device *dev,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
 				struct station_del_parameters *params)
-#else
-				u8 *mac)
-#endif
 {
-	#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
 	u8 *mac = params->mac;
-	#endif
 	WILC_Sint32 s32Error = WILC_SUCCESS;
 	struct WILC_WFI_priv *priv;
 	perInterface_wlan_t *nic;
@@ -4055,35 +3642,14 @@ static int WILC_WFI_change_station(struct wiphy *wiphy, struct net_device *dev,
  *  @date	01 JUL 2012
  *  @version	1.0
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)
 struct wireless_dev *WILC_WFI_add_virt_intf(struct wiphy *wiphy, const char *name,
 						unsigned char name_assign_type,
 						enum nl80211_iftype type, u32 *flags,
 						struct vif_params *params)
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)         /* tony for v3.8 support */
-struct wireless_dev *WILC_WFI_add_virt_intf(struct wiphy *wiphy, const char *name,
-					    enum nl80211_iftype type, u32 *flags,
-					    struct vif_params *params)
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)       /* tony for v3.6 support */
-struct wireless_dev *WILC_WFI_add_virt_intf(struct wiphy *wiphy, char *name,
-					    enum nl80211_iftype type, u32 *flags,
-					    struct vif_params *params)
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
-int WILC_WFI_add_virt_intf(struct wiphy *wiphy, char *name,
-			   enum nl80211_iftype type, u32 *flags,
-			   struct vif_params *params)
-#else
-struct net_device *WILC_WFI_add_virt_intf(struct wiphy *wiphy, char *name,
-					  enum nl80211_iftype type, u32 *flags,
-					  struct vif_params *params)
-#endif
 {
 	perInterface_wlan_t *nic;
 	struct WILC_WFI_priv *priv;
 	/* struct WILC_WFI_mon_priv* mon_priv; */
-	#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
-	WILC_Sint32 s32Error = WILC_SUCCESS;
-	#endif
 	struct net_device *new_ifc = NULL;
 	priv = wiphy_priv(wiphy);
 
@@ -4110,16 +3676,7 @@ struct net_device *WILC_WFI_add_virt_intf(struct wiphy *wiphy, char *name,
 		} else
 			PRINT_ER("Error in initializing monitor interface\n ");
 	}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) /* tony for v3.8 support */
 	return priv->wdev;
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
-	return s32Error;
-#else
-	/* return priv->wdev->netdev; */
-	PRINT_D(HOSTAPD_DBG, "IFC[%p] created\n", new_ifc);
-	return new_ifc;
-#endif
-
 }
 
 /**
@@ -4131,11 +3688,7 @@ struct net_device *WILC_WFI_add_virt_intf(struct wiphy *wiphy, char *name,
  *  @date	01 JUL 2012
  *  @version	1.0
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
 int WILC_WFI_del_virt_intf(struct wiphy *wiphy, struct wireless_dev *wdev)      /* tony for v3.8 support */
-#else
-int WILC_WFI_del_virt_intf(struct wiphy *wiphy, struct net_device *dev)
-#endif
 {
 	PRINT_D(HOSTAPD_DBG, "Deleting virtual interface\n");
 	return WILC_SUCCESS;
@@ -4146,16 +3699,7 @@ int WILC_WFI_del_virt_intf(struct wiphy *wiphy, struct net_device *dev)
 #endif /*WILC_AP_EXTERNAL_MLME*/
 static struct cfg80211_ops WILC_WFI_cfg80211_ops = {
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
-	/*
-	 *	replaced set_channel by set_monitor_channel
-	 *	from v3.6
-	 *	tony, 2013-10-29
-	 */
 	.set_monitor_channel = WILC_WFI_CfgSetChannel,
-#else
-	.set_channel = WILC_WFI_CfgSetChannel,
-#endif
 	.scan = WILC_WFI_CfgScan,
 	.connect = WILC_WFI_CfgConnect,
 	.disconnect = WILC_WFI_disconnect,
@@ -4163,24 +3707,15 @@ static struct cfg80211_ops WILC_WFI_cfg80211_ops = {
 	.del_key = WILC_WFI_del_key,
 	.get_key = WILC_WFI_get_key,
 	.set_default_key = WILC_WFI_set_default_key,
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 32)
 	/* .dump_survey = WILC_WFI_dump_survey, */
-#endif
 	#ifdef WILC_AP_EXTERNAL_MLME
 	.add_virtual_intf = WILC_WFI_add_virt_intf,
 	.del_virtual_intf = WILC_WFI_del_virt_intf,
 	.change_virtual_intf = WILC_WFI_change_virt_intf,
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
-	.add_beacon = WILC_WFI_add_beacon,
-	.set_beacon = WILC_WFI_set_beacon,
-	.del_beacon = WILC_WFI_del_beacon,
-#else
-	/* supports kernel 3.4+ change. austin.2013-07-23 */
 	.start_ap = WILC_WFI_start_ap,
 	.change_beacon = WILC_WFI_change_beacon,
 	.stop_ap = WILC_WFI_stop_ap,
-#endif
 	.add_station = WILC_WFI_add_station,
 	.del_station = WILC_WFI_del_station,
 	.change_station = WILC_WFI_change_station,
@@ -4196,7 +3731,6 @@ static struct cfg80211_ops WILC_WFI_cfg80211_ops = {
 	/* .disassoc = WILC_WFI_disassoc, */
 	.set_wiphy_params = WILC_WFI_set_wiphy_params,
 
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 32)
 	/* .set_bitrate_mask = WILC_WFI_set_bitrate_mask, */
 	.set_pmksa = WILC_WFI_set_pmksa,
 	.del_pmksa = WILC_WFI_del_pmksa,
@@ -4205,15 +3739,8 @@ static struct cfg80211_ops WILC_WFI_cfg80211_ops = {
 	.remain_on_channel = WILC_WFI_remain_on_channel,
 	.cancel_remain_on_channel = WILC_WFI_cancel_remain_on_channel,
 	.mgmt_tx_cancel_wait = WILC_WFI_mgmt_tx_cancel_wait,
-	#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
-	#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34)
-	.action = WILC_WFI_action,
-	#endif
-	#else
 	.mgmt_tx = WILC_WFI_mgmt_tx,
 	.mgmt_frame_register = WILC_WFI_frame_register,
-	#endif
-#endif
 	/* .mgmt_tx_cancel_wait = WILC_WFI_mgmt_tx_cancel_wait, */
 	.set_power_mgmt = WILC_WFI_set_power_mgmt,
 	.set_cqm_rssi_config = WILC_WFI_set_cqm_rssi_config,
@@ -4378,11 +3905,9 @@ struct wireless_dev *WILC_WFI_WiphyRegister(struct net_device *net)
 
 	/*Maximum number of probed ssid to be added by user for the scan request*/
 	wdev->wiphy->max_scan_ssids = MAX_NUM_PROBED_SSID;
-	#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 32)
 	/*Maximum number of pmkids to be cashed*/
 	wdev->wiphy->max_num_pmkids = WILC_MAX_NUM_PMKIDS;
 	PRINT_INFO(CFG80211_DBG, "Max number of PMKIDs = %d\n", wdev->wiphy->max_num_pmkids);
-	#endif
 
 	wdev->wiphy->max_scan_ie_len = 1000;
 
@@ -4392,20 +3917,15 @@ struct wireless_dev *WILC_WFI_WiphyRegister(struct net_device *net)
 	/*Set the availaible cipher suites*/
 	wdev->wiphy->cipher_suites = cipher_suites;
 	wdev->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
 	/*Setting default managment types: for register action frame:  */
 	wdev->wiphy->mgmt_stypes = wilc_wfi_cfg80211_mgmt_types;
-#endif
 
 #ifdef WILC_P2P
 	wdev->wiphy->max_remain_on_channel_duration = 500;
 	/*Setting the wiphy interfcae mode and type before registering the wiphy*/
 	wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_AP) | BIT(NL80211_IFTYPE_MONITOR) | BIT(NL80211_IFTYPE_P2P_GO) |
 		BIT(NL80211_IFTYPE_P2P_CLIENT);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0)
-
 	wdev->wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
-#endif
 #else
 	wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_AP) | BIT(NL80211_IFTYPE_MONITOR);
 #endif
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
index 9eb8f37542d0..508db6a3f6dd 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
@@ -68,7 +68,6 @@
 #define nl80211_SCAN_RESULT_EXPIRE	(3 * HZ)
 #define SCAN_RESULT_EXPIRE				(40 * HZ)
 
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 30)
 static const u32 cipher_suites[] = {
 	WLAN_CIPHER_SUITE_WEP40,
 	WLAN_CIPHER_SUITE_WEP104,
@@ -76,11 +75,7 @@ static const u32 cipher_suites[] = {
 	WLAN_CIPHER_SUITE_CCMP,
 	WLAN_CIPHER_SUITE_AES_CMAC,
 };
-#endif
-
-
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
 static const struct ieee80211_txrx_stypes
 	wilc_wfi_cfg80211_mgmt_types[NL80211_IFTYPE_MAX] = {
 	[NL80211_IFTYPE_STATION] = {
@@ -110,7 +105,7 @@ static const struct ieee80211_txrx_stypes
 			BIT(IEEE80211_STYPE_DEAUTH >> 4)
 	}
 };
-#endif
+
 /* Time to stay on the channel */
 #define WILC_WFI_DWELL_PASSIVE 100
 #define WILC_WFI_DWELL_ACTIVE  40
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index aa30de932ca4..0abe653acc66 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -49,12 +49,7 @@
 #include <asm/checksum.h>
 #include "host_interface.h"
 #include "wilc_wlan.h"
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 30)
-#include <net/wireless.h>
-#else
 #include <linux/wireless.h>     /* tony, 2013-06-12 */
-#endif
-
 
 #define FLOW_CONTROL_LOWER_THRESHOLD	128
 #define FLOW_CONTROL_UPPER_THRESHOLD	256
@@ -163,9 +158,6 @@ struct WILC_WFI_priv {
 	tstrHostIFpmkidAttr pmkid_list;
 	struct WILC_WFI_stats netstats;
 	WILC_Uint8 WILC_WFI_wep_default;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
-#define WLAN_KEY_LEN_WEP104 13
-#endif
 	WILC_Uint8 WILC_WFI_wep_key[4][WLAN_KEY_LEN_WEP104];
 	WILC_Uint8 WILC_WFI_wep_key_len[4];
 	struct net_device *real_ndev;   /* The real interface that the monitor is on */
-- 
2.1.0.rc2


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 02/16] staging: wilc1000: remove platform version checks
  2015-05-29 20:52 [PATCH 00/16] wilc1000: dead code removal and other cleanup Arnd Bergmann
  2015-05-29 20:52 ` [PATCH 01/16] staging: wilc1000: remove linux version checks Arnd Bergmann
@ 2015-05-29 20:52 ` Arnd Bergmann
  2015-05-29 20:52 ` [PATCH 03/16] staging: wilc1000: remove thread wrapper Arnd Bergmann
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 21+ messages in thread
From: Arnd Bergmann @ 2015-05-29 20:52 UTC (permalink / raw)
  To: Greg KH
  Cc: Rachel Kim, Dean Lee, Chris Park, devel, nicolas.ferre,
	Johnny Kim, linux-kernel, Arnd Bergmann

For code that is integrated into mainline Linux, checks for
the OS platform make no sense, because we know that we
are on Linux.

This removes all checks and the associated dead code.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/wilc1000/Makefile           |  3 +--
 drivers/staging/wilc1000/coreconfigurator.c |  2 --
 drivers/staging/wilc1000/wilc_osconfig.h    | 15 ---------------
 drivers/staging/wilc1000/wilc_oswrapper.h   | 14 --------------
 4 files changed, 1 insertion(+), 33 deletions(-)

diff --git a/drivers/staging/wilc1000/Makefile b/drivers/staging/wilc1000/Makefile
index 84bd975ff3be..4aa0d84ba8da 100644
--- a/drivers/staging/wilc1000/Makefile
+++ b/drivers/staging/wilc1000/Makefile
@@ -13,8 +13,7 @@ ccflags-y += -DSTA_FIRMWARE=\"atmel/wilc1000_fw.bin\" \
 ccflags-y += -I$(src)/ -DEXPORT_SYMTAB  -D__CHECK_ENDIAN__ -DWILC_ASIC_A0 \
 		-DPLL_WORKAROUND -DCONNECT_DIRECT  -DAGING_ALG \
 		-DWILC_PARSE_SCAN_IN_HOST -DDISABLE_PWRSAVE_AND_SCAN_DURING_IP \
-		-DWILC_PLATFORM=WILC_LINUXKERNEL -Wno-unused-function -DUSE_WIRELESS \
-		-DWILC_DEBUGFS
+		-Wno-unused-function -DUSE_WIRELESS -DWILC_DEBUGFS
 #ccflags-y += -DTCP_ACK_FILTER
 
 ccflags-$(CONFIG_WILC1000_PREALLOCATE_DURING_SYSTEM_BOOT) += -DMEMORY_STATIC \
diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 01625bdda454..d5a076ed2426 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -2123,7 +2123,6 @@ WILC_Sint32 CoreConfiguratorDeInit(void)
 
 
 #ifndef SIMULATION
-#if WILC_PLATFORM != WILC_WIN32
 /*Using the global handle of the driver*/
 extern wilc_wlan_oup_t *gpstrWlanOps;
 /**
@@ -2198,4 +2197,3 @@ WILC_Sint32 SendConfigPkt(WILC_Uint8 u8Mode, tstrWID *pstrWIDs,
 	return ret;
 }
 #endif
-#endif
diff --git a/drivers/staging/wilc1000/wilc_osconfig.h b/drivers/staging/wilc1000/wilc_osconfig.h
index 8e89702c79be..2e3700e2c1ad 100644
--- a/drivers/staging/wilc1000/wilc_osconfig.h
+++ b/drivers/staging/wilc1000/wilc_osconfig.h
@@ -1,18 +1,3 @@
-/*
- * Automatically generated C config: don't edit
- * Tue Aug 10 19:52:12 2010
- */
-
-/* OSes supported */
-#define WILC_WIN32		0
-#define WILC_NU				1
-#define WILC_MTK		2
-#define WILC_LINUX		3
-#define WILC_LINUXKERNEL	4
-/* the current OS */
-/* #define WILC_PLATFORM WILC_LINUXKERNEL */
-
-
 /* Logs options */
 #define WILC_LOGS_NOTHING          0
 #define WILC_LOGS_WARN             1
diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h
index e50267ec1ef4..df288c8be626 100644
--- a/drivers/staging/wilc1000/wilc_oswrapper.h
+++ b/drivers/staging/wilc1000/wilc_oswrapper.h
@@ -46,21 +46,7 @@ typedef WILC_Uint16 WILC_WideChar;
 
 /* Os Configuration File */
 #include "wilc_osconfig.h"
-
-/* Platform specific include */
-#if WILC_PLATFORM == WILC_WIN32
-#include "wilc_platform.h"
-#elif WILC_PLATFORM == WILC_NU
-#include "wilc_platform.h"
-#elif WILC_PLATFORM == WILC_MTK
 #include "wilc_platform.h"
-#elif WILC_PLATFORM == WILC_LINUX
-#include "wilc_platform.h"
-#elif WILC_PLATFORM == WILC_LINUXKERNEL
-#include "wilc_platform.h"
-#else
-#error "OS not supported"
-#endif
 
 /* Logging Functions */
 #include "wilc_log.h"
-- 
2.1.0.rc2


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 03/16] staging: wilc1000: remove thread wrapper
  2015-05-29 20:52 [PATCH 00/16] wilc1000: dead code removal and other cleanup Arnd Bergmann
  2015-05-29 20:52 ` [PATCH 01/16] staging: wilc1000: remove linux version checks Arnd Bergmann
  2015-05-29 20:52 ` [PATCH 02/16] staging: wilc1000: remove platform " Arnd Bergmann
@ 2015-05-29 20:52 ` Arnd Bergmann
  2015-05-29 20:52 ` [PATCH 04/16] staging: wilc1000: remove __DRIVER_VERSION__ macro Arnd Bergmann
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 21+ messages in thread
From: Arnd Bergmann @ 2015-05-29 20:52 UTC (permalink / raw)
  To: Greg KH
  Cc: Rachel Kim, Dean Lee, Chris Park, devel, nicolas.ferre,
	Johnny Kim, linux-kernel, Arnd Bergmann

The wilc_thread code is a very thin wrapper around kthread,
so just remove it and use kthread directly.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/wilc1000/Makefile         |   2 +-
 drivers/staging/wilc1000/host_interface.c |  16 ++--
 drivers/staging/wilc1000/wilc_osconfig.h  |   3 -
 drivers/staging/wilc1000/wilc_oswrapper.h |   5 -
 drivers/staging/wilc1000/wilc_platform.h  |  14 ---
 drivers/staging/wilc1000/wilc_thread.c    |  35 -------
 drivers/staging/wilc1000/wilc_thread.h    | 153 ------------------------------
 7 files changed, 8 insertions(+), 220 deletions(-)
 delete mode 100644 drivers/staging/wilc1000/wilc_thread.c
 delete mode 100644 drivers/staging/wilc1000/wilc_thread.h

diff --git a/drivers/staging/wilc1000/Makefile b/drivers/staging/wilc1000/Makefile
index 4aa0d84ba8da..4aa5f6764df4 100644
--- a/drivers/staging/wilc1000/Makefile
+++ b/drivers/staging/wilc1000/Makefile
@@ -27,7 +27,7 @@ ccflags-$(CONFIG_WILC1000_DYNAMICALLY_ALLOCATE_MEMROY) += -DWILC_NORMAL_ALLOC
 
 wilc1000-objs := wilc_wfi_netdevice.o wilc_wfi_cfgoperations.o linux_wlan.o linux_mon.o \
 			wilc_memory.o wilc_msgqueue.o wilc_semaphore.o wilc_sleep.o wilc_strutils.o \
-			wilc_thread.o wilc_time.o wilc_timer.o coreconfigurator.o host_interface.o \
+			wilc_time.o wilc_timer.o coreconfigurator.o host_interface.o \
 			fifo_buffer.o wilc_sdio.o wilc_spi.o wilc_wlan_cfg.o wilc_debugfs.o
 
 wilc1000-$(CONFIG_WILC1000_SDIO) += linux_wlan_sdio.o
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index fcbadd1885de..7c764a2ba573 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -543,7 +543,7 @@ tstrWILC_WFIDrv *gWFiDrvHandle = WILC_NULL;
 WILC_Bool g_obtainingIP = WILC_FALSE;
 #endif
 WILC_Uint8 P2P_LISTEN_STATE;
-static WILC_ThreadHandle HostIFthreadHandler;
+static struct task_struct *HostIFthreadHandler;
 static WILC_MsgQueueHandle gMsgQHostIF;
 static WILC_SemaphoreHandle hSemHostIFthrdEnd;
 
@@ -4370,7 +4370,7 @@ static WILC_Sint32 Handle_DelAllRxBASessions(void *drvHandler, tstrHostIfBASessi
  *  @date
  *  @version	1.0
  */
-static void hostIFthread(void *pvArg)
+static int hostIFthread(void *pvArg)
 {
 	WILC_Uint32 u32Ret;
 	tstrHostIFmsg strHostIFmsg;
@@ -4591,10 +4591,7 @@ static void hostIFthread(void *pvArg)
 
 	PRINT_D(HOSTINF_DBG, "Releasing thread exit semaphore\n");
 	WILC_SemaphoreRelease(&hSemHostIFthrdEnd, WILC_NULL);
-	return;
-	/* do_exit(error); */
-	/* PRINT_D(HOSTINF_DBG,"do_exit error code %d\n",error); */
-
+	return 0;
 }
 
 static void TimerCB_Scan(void *pvArg)
@@ -6683,9 +6680,10 @@ WILC_Sint32 host_int_init(WILC_WFIDrvHandle *phWFIDrv)
 			goto _fail_;
 		}
 		msgQ_created = 1;
-		s32Error = WILC_ThreadCreate(&HostIFthreadHandler, hostIFthread, WILC_NULL, WILC_NULL);
-		if (s32Error < 0) {
+		HostIFthreadHandler = kthread_run(hostIFthread, NULL, "WILC_kthread");
+		if (IS_ERR(HostIFthreadHandler)) {
 			PRINT_ER("Failed to creat Thread\n");
+			s32Error = WILC_FAIL;
 			goto _fail_mq_;
 		}
 		s32Error = WILC_TimerCreate(&(g_hPeriodicRSSI), GetPeriodicRSSI, WILC_NULL);
@@ -6788,7 +6786,7 @@ _fail_timer_2:
 _fail_timer_1:
 	WILC_TimerDestroy(&(pstrWFIDrv->hScanTimer), WILC_NULL);
 _fail_thread_:
-	WILC_ThreadDestroy(&HostIFthreadHandler, WILC_NULL);
+	kthread_stop(HostIFthreadHandler);
 _fail_mq_:
 	WILC_MsgQueueDestroy(&gMsgQHostIF, WILC_NULL);
 _fail_:
diff --git a/drivers/staging/wilc1000/wilc_osconfig.h b/drivers/staging/wilc1000/wilc_osconfig.h
index 2e3700e2c1ad..aa98ea5b423f 100644
--- a/drivers/staging/wilc1000/wilc_osconfig.h
+++ b/drivers/staging/wilc1000/wilc_osconfig.h
@@ -10,9 +10,6 @@
 
 /* OS features supported */
 
-#define CONFIG_WILC_THREAD_FEATURE 1
-/* #define CONFIG_WILC_THREAD_SUSPEND_CONTROL 1 */
-/* #define CONFIG_WILC_THREAD_STRICT_PRIORITY 1 */
 #define CONFIG_WILC_SEMAPHORE_FEATURE 1
 /* #define CONFIG_WILC_SEMAPHORE_TIMEOUT 1 */
 #define CONFIG_WILC_SLEEP_FEATURE 1
diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h
index df288c8be626..03a1ecf90625 100644
--- a/drivers/staging/wilc1000/wilc_oswrapper.h
+++ b/drivers/staging/wilc1000/wilc_oswrapper.h
@@ -54,11 +54,6 @@ typedef WILC_Uint16 WILC_WideChar;
 /* Error reporting and handling support */
 #include "wilc_errorsupport.h"
 
-/* Thread support */
-#ifdef CONFIG_WILC_THREAD_FEATURE
-#include "wilc_thread.h"
-#endif
-
 /* Semaphore support */
 #ifdef CONFIG_WILC_SEMAPHORE_FEATURE
 #include "wilc_semaphore.h"
diff --git a/drivers/staging/wilc1000/wilc_platform.h b/drivers/staging/wilc1000/wilc_platform.h
index 31d5034cb7fa..87e4eedcc914 100644
--- a/drivers/staging/wilc1000/wilc_platform.h
+++ b/drivers/staging/wilc1000/wilc_platform.h
@@ -15,18 +15,6 @@
  *      Feature support checks
  *******************************************************************/
 
-/* CONFIG_WILC_THREAD_FEATURE is implemented */
-
-/* remove the following block when implementing its feature */
-#ifdef CONFIG_WILC_THREAD_SUSPEND_CONTROL
-#error This feature is not supported by this OS
-#endif
-
-/* remove the following block when implementing its feature */
-#ifdef CONFIG_WILC_THREAD_STRICT_PRIORITY
-#error This feature is not supported by this OS
-#endif
-
 /* CONFIG_WILC_SEMAPHORE_FEATURE is implemented */
 
 /* remove the following block when implementing its feature
@@ -140,8 +128,6 @@
  *      OS specific types
  *******************************************************************/
 
-typedef struct task_struct *WILC_ThreadHandle;
-
 typedef void *WILC_MemoryPoolHandle;
 typedef struct semaphore WILC_SemaphoreHandle;
 
diff --git a/drivers/staging/wilc1000/wilc_thread.c b/drivers/staging/wilc1000/wilc_thread.c
deleted file mode 100644
index 5eb04e839309..000000000000
--- a/drivers/staging/wilc1000/wilc_thread.c
+++ /dev/null
@@ -1,35 +0,0 @@
-
-#include "wilc_oswrapper.h"
-
-#ifdef CONFIG_WILC_THREAD_FEATURE
-
-
-
-WILC_ErrNo WILC_ThreadCreate(WILC_ThreadHandle *pHandle, tpfWILC_ThreadFunction pfEntry,
-			     void *pvArg, tstrWILC_ThreadAttrs *pstrAttrs)
-{
-
-
-	*pHandle = kthread_run((int (*)(void *))pfEntry, pvArg, "WILC_kthread");
-
-
-	if (IS_ERR(*pHandle)) {
-		return WILC_FAIL;
-	} else {
-		return WILC_SUCCESS;
-	}
-
-}
-
-WILC_ErrNo WILC_ThreadDestroy(WILC_ThreadHandle *pHandle,
-			      tstrWILC_ThreadAttrs *pstrAttrs)
-{
-	WILC_ErrNo s32RetStatus = WILC_SUCCESS;
-
-	kthread_stop(*pHandle);
-	return s32RetStatus;
-}
-
-
-
-#endif
diff --git a/drivers/staging/wilc1000/wilc_thread.h b/drivers/staging/wilc1000/wilc_thread.h
deleted file mode 100644
index c862cd544dd4..000000000000
--- a/drivers/staging/wilc1000/wilc_thread.h
+++ /dev/null
@@ -1,153 +0,0 @@
-#ifndef __WILC_THREAD_H__
-#define __WILC_THREAD_H__
-
-/*!
- *  @file		wilc_thread.h
- *  @brief		Thread OS Wrapper functionality
- *  @author		syounan
- *  @sa			wilc_oswrapper.h top level OS wrapper file
- *  @date		10 Aug 2010
- *  @version		1.0
- */
-
-#ifndef CONFIG_WILC_THREAD_FEATURE
-#error the feature WILC_OS_FEATURE_THREAD must be supported to include this file
-#endif
-
-typedef void (*tpfWILC_ThreadFunction)(void *);
-
-typedef enum {
-	#ifdef CONFIG_WILC_THREAD_STRICT_PRIORITY
-	WILC_OS_THREAD_PIORITY_0 = 0,
-	WILC_OS_THREAD_PIORITY_1 = 1,
-	WILC_OS_THREAD_PIORITY_2 = 2,
-	WILC_OS_THREAD_PIORITY_3 = 3,
-	WILC_OS_THREAD_PIORITY_4 = 4,
-	#endif
-
-	WILC_OS_THREAD_PIORITY_HIGH = 0,
-	WILC_OS_THREAD_PIORITY_NORMAL = 2,
-	WILC_OS_THREAD_PIORITY_LOW = 4
-} tenuWILC_ThreadPiority;
-
-/*!
- *  @struct             WILC_ThreadAttrs
- *  @brief		Thread API options
- *  @author		syounan
- *  @date		10 Aug 2010
- *  @version		1.0
- */
-typedef struct {
-	/*!<
-	 * stack size for use with WILC_ThreadCreate, default is WILC_OS_THREAD_DEFAULT_STACK
-	 */
-	WILC_Uint32 u32StackSize;
-
-	/*!<
-	 * piority for the thread, if WILC_OS_FEATURE_THREAD_STRICT_PIORITY is defined
-	 * this value is strictly observed and can take a larger resolution
-	 */
-	tenuWILC_ThreadPiority enuPiority;
-
-	#ifdef CONFIG_WILC_THREAD_SUSPEND_CONTROL
-	/*!
-	 * if true the thread will be created suspended
-	 */
-	WILC_Bool bStartSuspended;
-	#endif
-
-} tstrWILC_ThreadAttrs;
-
-#define WILC_OS_THREAD_DEFAULT_STACK (10 * 1024)
-
-/*!
- *  @brief	Fills the WILC_ThreadAttrs with default parameters
- *  @param[out]	pstrAttrs structure to be filled
- *  @sa		WILC_ThreadAttrs
- *  @author	syounan
- *  @date	10 Aug 2010
- *  @version	1.0
- */
-
-static void WILC_ThreadFillDefault(tstrWILC_ThreadAttrs *pstrAttrs)
-{
-	pstrAttrs->u32StackSize = WILC_OS_THREAD_DEFAULT_STACK;
-	pstrAttrs->enuPiority = WILC_OS_THREAD_PIORITY_NORMAL;
-
-	#ifdef CONFIG_WILC_THREAD_SUSPEND_CONTROL
-	pstrAttrs->bStartSuspended = WILC_FALSE;
-	#endif
-}
-
-/*!
- *  @brief	Creates a new thread
- *  @details	if the feature WILC_OS_FEATURE_THREAD_SUSPEND_CONTROL is
- *              defined and tstrWILC_ThreadAttrs.bStartSuspended is set to true
- *              the new thread will be created in suspended state, otherwise
- *              it will start executing immeadiately
- *              if the feature WILC_OS_FEATURE_THREAD_STRICT_PIORITY is defined
- *              piorities are strictly observed, otherwise the underlaying OS
- *              may not observe piorities
- *  @param[out]	pHandle handle to the newly created thread object
- *  @param[in]	pfEntry pointer to the entry point of the new thread
- *  @param[in]	pstrAttrs Optional attributes, NULL for default
- *  @return	Error code indicating sucess/failure
- *  @sa		WILC_ThreadAttrs
- *  @author	syounan
- *  @date	10 Aug 2010
- *  @version	1.0
- */
-WILC_ErrNo WILC_ThreadCreate(WILC_ThreadHandle *pHandle, tpfWILC_ThreadFunction pfEntry,
-			     void *pvArg, tstrWILC_ThreadAttrs *pstrAttrs);
-
-/*!
- *  @brief	Destroys the Thread object
- *  @details	This function is used for clean up and freeing any used resources
- *		This function will block until the destroyed thread exits cleanely,
- *		so, the thread code thould handle an exit case before this calling
- *		this function
- *  @param[in]	pHandle handle to the thread object
- *  @param[in]	pstrAttrs Optional attributes, NULL for default
- *  @return	Error code indicating sucess/failure
- *  @sa		WILC_ThreadAttrs
- *  @author	syounan
- *  @date	10 Aug 2010
- *  @version	1.0
- */
-WILC_ErrNo WILC_ThreadDestroy(WILC_ThreadHandle *pHandle,
-			      tstrWILC_ThreadAttrs *pstrAttrs);
-
-#ifdef CONFIG_WILC_THREAD_SUSPEND_CONTROL
-
-/*!
- *  @brief	Suspends an executing Thread object
- *  @param[in]	pHandle handle to the thread object
- *  @param[in]	pstrAttrs Optional attributes, NULL for default
- *  @return	Error code indicating sucess/failure
- *  @sa		WILC_ThreadAttrs
- *  @note	Optional part, WILC_OS_FEATURE_THREAD_SUSPEND_CONTROL must be enabled
- *  @author	syounan
- *  @date	10 Aug 2010
- *  @version	1.0
- */
-WILC_ErrNo WILC_ThreadSuspend(WILC_ThreadHandle *pHandle,
-			      tstrWILC_ThreadAttrs *pstrAttrs);
-
-/*!
- *  @brief	Resumes a suspened Thread object
- *  @param[in]	pHandle handle to the thread object
- *  @param[in]	pstrAttrs Optional attributes, NULL for default
- *  @return	Error code indicating sucess/failure
- *  @sa		WILC_ThreadAttrs
- *  @note	Optional part, WILC_OS_FEATURE_THREAD_SUSPEND_CONTROL must be enabled
- *  @author	syounan
- *  @date	10 Aug 2010
- *  @version	1.0
- */
-WILC_ErrNo WILC_ThreadResume(WILC_ThreadHandle *pHandle,
-			     tstrWILC_ThreadAttrs *pstrAttrs);
-
-#endif
-
-
-#endif
-- 
2.1.0.rc2


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 04/16] staging: wilc1000: remove __DRIVER_VERSION__ macro
  2015-05-29 20:52 [PATCH 00/16] wilc1000: dead code removal and other cleanup Arnd Bergmann
                   ` (2 preceding siblings ...)
  2015-05-29 20:52 ` [PATCH 03/16] staging: wilc1000: remove thread wrapper Arnd Bergmann
@ 2015-05-29 20:52 ` Arnd Bergmann
  2015-05-29 20:52 ` [PATCH 05/16] staging: wilc1000: remove time wrapper Arnd Bergmann
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 21+ messages in thread
From: Arnd Bergmann @ 2015-05-29 20:52 UTC (permalink / raw)
  To: Greg KH
  Cc: Rachel Kim, Dean Lee, Chris Park, devel, nicolas.ferre,
	Johnny Kim, linux-kernel, Arnd Bergmann

The driver version is meaningless, and in particular does not
have to be passed from the Makefile. This removes the macros,
but leaves the behavior of printing the 10.2 version untouched
for the moment.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/wilc1000/Makefile     | 6 ------
 drivers/staging/wilc1000/linux_wlan.c | 2 +-
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/staging/wilc1000/Makefile b/drivers/staging/wilc1000/Makefile
index 4aa5f6764df4..13e3ed8ef31e 100644
--- a/drivers/staging/wilc1000/Makefile
+++ b/drivers/staging/wilc1000/Makefile
@@ -32,9 +32,3 @@ wilc1000-objs := wilc_wfi_netdevice.o wilc_wfi_cfgoperations.o linux_wlan.o linu
 
 wilc1000-$(CONFIG_WILC1000_SDIO) += linux_wlan_sdio.o
 wilc1000-$(CONFIG_WILC1000_SPI) += linux_wlan_spi.o
-
-WILC1000_SRC_VERSION = 10.0
-PATCHLEVEL = 2
-WILC1000_FW_VERSION = 0
-
-ccflags-y += -D__DRIVER_VERSION__=\"$(WILC1000_SRC_VERSION).$(PATCHLEVEL)\"
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 3f8b3c54f196..2a74441af09e 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -2747,7 +2747,7 @@ static int __init init_wilc_driver(void)
 #endif
 
 	printk("IN INIT FUNCTION\n");
-	printk("*** WILC1000 driver VERSION=[%s] FW_VER=[%s] ***\n", __DRIVER_VERSION__, __DRIVER_VERSION__);
+	printk("*** WILC1000 driver VERSION=[10.2] FW_VER=[10.2] ***\n");
 
 	linux_wlan_device_power(1);
 	msleep(100);
-- 
2.1.0.rc2


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 05/16] staging: wilc1000: remove time wrapper
  2015-05-29 20:52 [PATCH 00/16] wilc1000: dead code removal and other cleanup Arnd Bergmann
                   ` (3 preceding siblings ...)
  2015-05-29 20:52 ` [PATCH 04/16] staging: wilc1000: remove __DRIVER_VERSION__ macro Arnd Bergmann
@ 2015-05-29 20:52 ` Arnd Bergmann
  2015-05-30  6:39   ` Sudip Mukherjee
  2015-05-29 20:52 ` [PATCH 06/16] staging: wilc1000: remove unused string functions Arnd Bergmann
                   ` (10 subsequent siblings)
  15 siblings, 1 reply; 21+ messages in thread
From: Arnd Bergmann @ 2015-05-29 20:52 UTC (permalink / raw)
  To: Greg KH
  Cc: Rachel Kim, Dean Lee, Chris Park, devel, nicolas.ferre,
	Johnny Kim, linux-kernel, Arnd Bergmann

The abstraction for time in this driver is completely
unused, so remove it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/wilc1000/wilc_osconfig.h  |   1 -
 drivers/staging/wilc1000/wilc_oswrapper.h |   5 -
 drivers/staging/wilc1000/wilc_platform.h  |  12 --
 drivers/staging/wilc1000/wilc_time.c      | 163 ------------------------
 drivers/staging/wilc1000/wilc_time.h      | 205 ------------------------------
 5 files changed, 386 deletions(-)
 delete mode 100644 drivers/staging/wilc1000/wilc_time.c
 delete mode 100644 drivers/staging/wilc1000/wilc_time.h

diff --git a/drivers/staging/wilc1000/wilc_osconfig.h b/drivers/staging/wilc1000/wilc_osconfig.h
index aa98ea5b423f..f3d3108de876 100644
--- a/drivers/staging/wilc1000/wilc_osconfig.h
+++ b/drivers/staging/wilc1000/wilc_osconfig.h
@@ -27,7 +27,6 @@
 /* #define CONFIG_WILC_FILE_OPERATIONS_FEATURE */
 /* #define CONFIG_WILC_FILE_OPERATIONS_STRING_API */
 /* #define CONFIG_WILC_FILE_OPERATIONS_PATH_API */
-#define CONFIG_WILC_TIME_FEATURE
 /* #define CONFIG_WILC_EVENT_FEATURE */
 /* #define CONFIG_WILC_EVENT_TIMEOUT */
 /* #define CONFIG_WILC_SOCKET_FEATURE */
diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h
index 03a1ecf90625..728ce7cac85a 100644
--- a/drivers/staging/wilc1000/wilc_oswrapper.h
+++ b/drivers/staging/wilc1000/wilc_oswrapper.h
@@ -89,11 +89,6 @@ typedef WILC_Uint16 WILC_WideChar;
 #include "wilc_fileops.h"
 #endif
 
-/* Time operations */
-#ifdef CONFIG_WILC_TIME_FEATURE
-#include "wilc_time.h"
-#endif
-
 /* Event support */
 #ifdef CONFIG_WILC_EVENT_FEATURE
 #include "wilc_event.h"
diff --git a/drivers/staging/wilc1000/wilc_platform.h b/drivers/staging/wilc1000/wilc_platform.h
index 87e4eedcc914..35d9f8a917ce 100644
--- a/drivers/staging/wilc1000/wilc_platform.h
+++ b/drivers/staging/wilc1000/wilc_platform.h
@@ -73,18 +73,6 @@
 #error This feature is not supported by this OS
 #endif
 
-/* CONFIG_WILC_TIME_FEATURE is implemented */
-
-/* remove the following block when implementing its feature */
-#ifdef CONFIG_WILC_TIME_UTC_SINCE_1970
-#error This feature is not supported by this OS
-#endif
-
-/* remove the following block when implementing its feature */
-#ifdef CONFIG_WILC_TIME_CALENDER
-#error This feature is not supported by this OS
-#endif
-
 /* remove the following block when implementing its feature */
 #ifdef CONFIG_WILC_EVENT_FEATURE
 #error This feature is not supported by this OS
diff --git a/drivers/staging/wilc1000/wilc_time.c b/drivers/staging/wilc1000/wilc_time.c
deleted file mode 100644
index 27c252b462ac..000000000000
--- a/drivers/staging/wilc1000/wilc_time.c
+++ /dev/null
@@ -1,163 +0,0 @@
-
-#define _CRT_SECURE_NO_DEPRECATE
-#include "wilc_oswrapper.h"
-
-#ifdef CONFIG_WILC_TIME_FEATURE
-
-
-WILC_Uint32 WILC_TimeMsec(void)
-{
-	WILC_Uint32 u32Time = 0;
-	struct timespec current_time;
-
-	current_time = current_kernel_time();
-	u32Time = current_time.tv_sec * 1000;
-	u32Time += current_time.tv_nsec / 1000000;
-
-
-	return u32Time;
-}
-
-
-#ifdef CONFIG_WILC_EXTENDED_TIME_OPERATIONS
-
-/**
- *  @brief
- *  @details    function returns the implementation's best approximation to the
- *                              processor time used by the process since the beginning of an
- *                              implementation-dependent time related only to the process invocation.
- *  @return             WILC_Uint32
- *  @note
- *  @author		remil
- *  @date		11 Nov 2010
- *  @version		1.0
- */
-WILC_Uint32 WILC_Clock()
-{
-
-}
-
-
-/**
- *  @brief
- *  @details    The difftime() function computes the difference between two calendar
- *                              times (as returned by WILC_GetTime()): time1 - time0.
- *  @param[in]  WILC_Time time1
- *  @param[in]  WILC_Time time0
- *  @return             WILC_Double
- *  @note
- *  @author		remil
- *  @date		11 Nov 2010
- *  @version		1.0
- */
-WILC_Double WILC_DiffTime(WILC_Time time1, WILC_Time time0)
-{
-
-}
-
-
-
-/**
- *  @brief
- *  @details    The gmtime() function converts the time in seconds since
- *                              the Epoch pointed to by timer into a broken-down time,
- *                              expressed as Coordinated Universal Time (UTC).
- *  @param[in]  const WILC_Time* timer
- *  @return             WILC_tm*
- *  @note
- *  @author		remil
- *  @date		11 Nov 2010
- *  @version		1.0
- */
-WILC_tm *WILC_GmTime(const WILC_Time *timer)
-{
-
-}
-
-
-/**
- *  @brief
- *  @details    The localtime() function converts the time in seconds since
- *                              the Epoch pointed to by timer into a broken-down time, expressed
- *                              as a local time. The function corrects for the timezone and any
- *                              seasonal time adjustments. Local timezone information is used as
- *                              though localtime() calls tzset().
- *  @param[in]  const WILC_Time* timer
- *  @return             WILC_tm*
- *  @note
- *  @author		remil
- *  @date		11 Nov 2010
- *  @version		1.0
- */
-WILC_tm *WILC_LocalTime(const WILC_Time *timer)
-{
-
-}
-
-
-/**
- *  @brief
- *  @details    The mktime() function converts the broken-down time,
- *                              expressed as local time, in the structure pointed to by timeptr,
- *                              into a time since the Epoch value with the same encoding as that
- *                              of the values returned by time(). The original values of the tm_wday
- *                              and tm_yday components of the structure are ignored, and the original
- *                              values of the other components are not restricted to the ranges described
- *                              in the <time.h> entry.
- *  @param[in]  WILC_tm* timer
- *  @return             WILC_Time
- *  @note
- *  @author		remil
- *  @date		11 Nov 2010
- *  @version		1.0
- */
-WILC_Time WILC_MkTime(WILC_tm *timer)
-{
-
-}
-
-
-/**
- *  @brief
- *  @details    The strftime() function places bytes into the array
- *                              pointed to by s as controlled by the string pointed to by format.
- *  @param[in]  WILC_Char* s
- *  @param[in]	WILC_Uint32 maxSize
- *  @param[in]	const WILC_Char* format
- *  @param[in]	const WILC_tm* timptr
- *  @return             WILC_Uint32
- *  @note
- *  @author		remil
- *  @date		11 Nov 2010
- *  @version		1.0
- */
-WILC_Uint32 WILC_StringFormatTime(WILC_Char *s,
-				  WILC_Uint32 maxSize,
-				  const WILC_Char *format,
-				  const WILC_tm *timptr)
-{
-
-}
-
-
-/**
- *  @brief              The WILC_GetTime() function returns the value of time in seconds since the Epoch.
- *  @details    The tloc argument points to an area where the return value is also stored.
- *                              If tloc is a null pointer, no value is stored.
- *  @param[in]  WILC_Time* tloc
- *  @return             WILC_Time
- *  @note
- *  @author		remil
- *  @date		11 Nov 2010
- *  @version		1.0
- */
-WILC_Time WILC_GetTime(WILC_Time *tloc)
-{
-
-}
-
-
-#endif
-#endif
-
-
diff --git a/drivers/staging/wilc1000/wilc_time.h b/drivers/staging/wilc1000/wilc_time.h
deleted file mode 100644
index 787df7ded75c..000000000000
--- a/drivers/staging/wilc1000/wilc_time.h
+++ /dev/null
@@ -1,205 +0,0 @@
-#ifndef __WILC_TIME_H__
-#define __WILC_TIME_H__
-
-/*!
-*  @file		wilc_time.h
-*  @brief		Time retrival functionality
-*  @author		syounan
-*  @sa			wilc_oswrapper.h top level OS wrapper file
-*  @date		2 Sep 2010
-*  @version		1.0
-*/
-
-#ifndef CONFIG_WILC_TIME_FEATURE
-#error the feature CONFIG_WILC_TIME_FEATURE must be supported to include this file
-#endif
-
-/*!
-*  @struct 		WILC_ThreadAttrs
-*  @brief		Thread API options
-*  @author		syounan
-*  @date		2 Sep 2010
-*  @version		1.0
-*/
-typedef struct {
-	/* a dummy type to prevent compile errors on empty structure*/
-	WILC_Uint8 dummy;
-} tstrWILC_TimeAttrs;
-
-typedef struct {
-	/*!< current year */
-	WILC_Uint16	u16Year;
-	/*!< current month */
-	WILC_Uint8	u8Month;
-	/*!< current day */
-	WILC_Uint8	u8Day;
-
-	/*!< current hour (in 24H format) */
-	WILC_Uint8	u8Hour;
-	/*!< current minute */
-	WILC_Uint8	u8Miute;
-	/*!< current second */
-	WILC_Uint8	u8Second;
-
-} tstrWILC_TimeCalender;
-
-/*!
-*  @brief		returns the number of msec elapsed since system start up
-*  @return		number of msec elapsed singe system start up
-*  @note		since this returned value is 32 bit, the caller must handle
-				wraparounds in values every about 49 of continous operations
-*  @author		syounan
-*  @date		2 Sep 2010
-*  @version		1.0
-*/
-WILC_Uint32 WILC_TimeMsec(void);
-
-
-
-#ifdef CONFIG_WILC_EXTENDED_TIME_OPERATIONS
-/**
-*  @brief
-*  @details 	function returns the implementation's best approximation to the
-				processor time used by the process since the beginning of an
-				implementation-dependent time related only to the process invocation.
-*  @return 		WILC_Uint32
-*  @note
-*  @author		remil
-*  @date		11 Nov 2010
-*  @version		1.0
-*/
-WILC_Uint32 WILC_Clock();
-
-/**
-*  @brief
-*  @details 	The difftime() function computes the difference between two calendar
-				times (as returned by WILC_GetTime()): time1 - time0.
-*  @param[in] 	WILC_Time time1
-*  @param[in] 	WILC_Time time0
-*  @return 		WILC_Double
-*  @note
-*  @author		remil
-*  @date		11 Nov 2010
-*  @version		1.0
-*/
-WILC_Double WILC_DiffTime(WILC_Time time1, WILC_Time time0);
-
-/**
-*  @brief
-*  @details 	The gmtime() function converts the time in seconds since
-				the Epoch pointed to by timer into a broken-down time,
-				expressed as Coordinated Universal Time (UTC).
-*  @param[in] 	const WILC_Time* timer
-*  @return 		WILC_tm*
-*  @note
-*  @author		remil
-*  @date		11 Nov 2010
-*  @version		1.0
-*/
-WILC_tm *WILC_GmTime(const WILC_Time *timer);
-
-
-/**
-*  @brief
-*  @details 	The localtime() function converts the time in seconds since
-				the Epoch pointed to by timer into a broken-down time, expressed
-				as a local time. The function corrects for the timezone and any
-				seasonal time adjustments. Local timezone information is used as
-				though localtime() calls tzset().
-*  @param[in] 	const WILC_Time* timer
-*  @return 		WILC_tm*
-*  @note
-*  @author		remil
-*  @date		11 Nov 2010
-*  @version		1.0
-*/
-WILC_tm *WILC_LocalTime(const WILC_Time *timer);
-
-
-/**
-*  @brief
-*  @details 	The mktime() function converts the broken-down time,
-				expressed as local time, in the structure pointed to by timeptr,
-				into a time since the Epoch value with the same encoding as that
-				of the values returned by time(). The original values of the tm_wday
-				and tm_yday components of the structure are ignored, and the original
-				values of the other components are not restricted to the ranges described
-				in the <time.h> entry.
-*  @param[in] 	WILC_tm* timer
-*  @return 		WILC_Time
-*  @note
-*  @author		remil
-*  @date		11 Nov 2010
-*  @version		1.0
-*/
-WILC_Time WILC_MkTime(WILC_tm *timer);
-
-
-/**
-*  @brief
-*  @details 	The strftime() function places bytes into the array
-				pointed to by s as controlled by the string pointed to by format.
-*  @param[in] 	WILC_Char* s
-*  @param[in]	WILC_Uint32 maxSize
-*  @param[in]	const WILC_Char* format
-*  @param[in]	const WILC_tm* timptr
-*  @return 		WILC_Uint32
-*  @note
-*  @author		remil
-*  @date		11 Nov 2010
-*  @version		1.0
-*/
-WILC_Uint32 WILC_StringFormatTime(WILC_Char *s,
-								WILC_Uint32 maxSize,
-								const WILC_Char *format,
-								const WILC_tm *timptr);
-
-
-/**
-*  @brief 		The WILC_GetTime() function returns the value of time in seconds since the Epoch.
-*  @details 	The tloc argument points to an area where the return value is also stored.
-				If tloc is a null pointer, no value is stored.
-*  @param[in] 	WILC_Time* tloc
-*  @return 		WILC_Time
-*  @note
-*  @author		remil
-*  @date		11 Nov 2010
-*  @version		1.0
-*/
-WILC_Time WILC_GetTime(WILC_Time *tloc);
-
-#endif
-
-#ifdef CONFIG_WILC_TIME_UTC_SINCE_1970
-
-/*!
-*  @brief		returns the number of seconds elapsed since 1970 (in UTC)
-*  @param[in]	pstrAttrs Optional attributes, NULL for default
-*  @return		number of seconds elapsed since 1970 (in UTC)
-*  @sa			tstrWILC_TimeAttrs
-*  @author		syounan
-*  @date		2 Sep 2010
-*  @version		1.0
-*/
-WILC_Uint32 WILC_TimeUtcSince1970(tstrWILC_TimeAttrs *pstrAttrs);
-
-#endif
-
-#ifdef CONFIG_WILC_TIME_CALENDER
-
-/*!
-*  @brief		gets the current calender time
-*  @return		number of seconds elapsed since 1970 (in UTC)
-*  @param[out]	ptstrCalender calender structure to be filled with time
-*  @param[in]	pstrAttrs Optional attributes, NULL for default
-*  @sa			WILC_ThreadAttrs
-*  @author		syounan
-*  @date		2 Sep 2010
-*  @version		1.0
-*/
-WILC_ErrNo WILC_TimeCalender(tstrWILC_TimeCalender *ptstrCalender,
-	tstrWILC_TimeAttrs *pstrAttrs);
-
-#endif
-
-#endif
-- 
2.1.0.rc2


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 06/16] staging: wilc1000: remove unused string functions
  2015-05-29 20:52 [PATCH 00/16] wilc1000: dead code removal and other cleanup Arnd Bergmann
                   ` (4 preceding siblings ...)
  2015-05-29 20:52 ` [PATCH 05/16] staging: wilc1000: remove time wrapper Arnd Bergmann
@ 2015-05-29 20:52 ` Arnd Bergmann
  2015-05-29 20:52 ` [PATCH 07/16] staging: wilc1000: simplify msgqueue code Arnd Bergmann
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 21+ messages in thread
From: Arnd Bergmann @ 2015-05-29 20:52 UTC (permalink / raw)
  To: Greg KH
  Cc: Rachel Kim, Dean Lee, Chris Park, devel, nicolas.ferre,
	Johnny Kim, linux-kernel, Arnd Bergmann

The driver provides wrappers for a lot of string operations.
Some of them are unused, while others should be replaced
with normal kernel functions.

This replaces the unused ones for now, and leaves the other
ones for a later cleanup.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/wilc1000/wilc_osconfig.h  |   2 -
 drivers/staging/wilc1000/wilc_oswrapper.h |   2 -
 drivers/staging/wilc1000/wilc_platform.h  |   4 -
 drivers/staging/wilc1000/wilc_strutils.c  | 351 ------------------------------
 drivers/staging/wilc1000/wilc_strutils.h  | 282 ------------------------
 5 files changed, 641 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_osconfig.h b/drivers/staging/wilc1000/wilc_osconfig.h
index f3d3108de876..f18615e09400 100644
--- a/drivers/staging/wilc1000/wilc_osconfig.h
+++ b/drivers/staging/wilc1000/wilc_osconfig.h
@@ -20,7 +20,6 @@
 /* #define CONFIG_WILC_MEMORY_POOLS 1 */
 /* #define CONFIG_WILC_MEMORY_DEBUG 1 */
 /* #define CONFIG_WILC_ASSERTION_SUPPORT 1 */
-#define CONFIG_WILC_STRING_UTILS 1
 #define CONFIG_WILC_MSG_QUEUE_FEATURE
 /* #define CONFIG_WILC_MSG_QUEUE_IPC_NAME */
 /* #define CONFIG_WILC_MSG_QUEUE_TIMEOUT */
@@ -32,5 +31,4 @@
 /* #define CONFIG_WILC_SOCKET_FEATURE */
 /* #define CONFIG_WILC_MATH_OPERATIONS_FEATURE */
 /* #define CONFIG_WILC_EXTENDED_FILE_OPERATIONS */
-/* #define CONFIG_WILC_EXTENDED_STRING_OPERATIONS */
 /* #define CONFIG_WILC_EXTENDED_TIME_OPERATIONS */
diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h
index 728ce7cac85a..c4e97ae03ae0 100644
--- a/drivers/staging/wilc1000/wilc_oswrapper.h
+++ b/drivers/staging/wilc1000/wilc_oswrapper.h
@@ -75,9 +75,7 @@ typedef WILC_Uint16 WILC_WideChar;
 #endif
 
 /* String Utilities */
-#ifdef CONFIG_WILC_STRING_UTILS
 #include "wilc_strutils.h"
-#endif
 
 /* Message Queue */
 #ifdef CONFIG_WILC_MSG_QUEUE_FEATURE
diff --git a/drivers/staging/wilc1000/wilc_platform.h b/drivers/staging/wilc1000/wilc_platform.h
index 35d9f8a917ce..b20bbb839e5a 100644
--- a/drivers/staging/wilc1000/wilc_platform.h
+++ b/drivers/staging/wilc1000/wilc_platform.h
@@ -50,8 +50,6 @@
 #error This feature is not supported by this OS
 #endif
 
-/* CONFIG_WILC_STRING_UTILS is implemented */
-
 /* CONFIG_WILC_MSG_QUEUE_FEATURE is implemented */
 
 /* remove the following block when implementing its feature */
@@ -87,8 +85,6 @@
 
 /* CONFIG_WILC_EXTENDED_FILE_OPERATIONS is implemented */
 
-/* CONFIG_WILC_EXTENDED_STRING_OPERATIONS is implemented */
-
 /* CONFIG_WILC_EXTENDED_TIME_OPERATIONS is implemented */
 
 /* remove the following block when implementing its feature */
diff --git a/drivers/staging/wilc1000/wilc_strutils.c b/drivers/staging/wilc1000/wilc_strutils.c
index 9e525d56feb8..f452fc57f71d 100644
--- a/drivers/staging/wilc1000/wilc_strutils.c
+++ b/drivers/staging/wilc1000/wilc_strutils.c
@@ -3,8 +3,6 @@
 
 #include "wilc_oswrapper.h"
 
-#ifdef CONFIG_WILC_STRING_UTILS
-
 
 /*!
  *  @author	syounan
@@ -42,50 +40,12 @@ void *WILC_memset(void *pvTarget, WILC_Uint8 u8SetValue, WILC_Uint32 u32Count)
  *  @date	18 Aug 2010
  *  @version	1.0
  */
-WILC_Char *WILC_strncat(WILC_Char *pcTarget, const WILC_Char *pcSource,
-			WILC_Uint32 u32Count)
-{
-	return strncat(pcTarget, pcSource, u32Count);
-}
-
-/*!
- *  @author	syounan
- *  @date	18 Aug 2010
- *  @version	1.0
- */
 WILC_Char *WILC_strncpy(WILC_Char *pcTarget, const WILC_Char *pcSource,
 			WILC_Uint32 u32Count)
 {
 	return strncpy(pcTarget, pcSource, u32Count);
 }
 
-/*!
- *  @author	syounan
- *  @date	18 Aug 2010
- *  @version	1.0
- */
-WILC_Sint32 WILC_strcmp(const WILC_Char *pcStr1, const WILC_Char *pcStr2)
-{
-	WILC_Sint32 s32Result;
-
-	if (pcStr1 == WILC_NULL && pcStr2 == WILC_NULL)	{
-		s32Result = 0;
-	} else if (pcStr1 == WILC_NULL)	   {
-		s32Result = -1;
-	} else if (pcStr2 == WILC_NULL)	   {
-		s32Result = 1;
-	} else {
-		s32Result = strcmp(pcStr1, pcStr2);
-		if (s32Result < 0) {
-			s32Result = -1;
-		} else if (s32Result > 0)    {
-			s32Result = 1;
-		}
-	}
-
-	return s32Result;
-}
-
 WILC_Sint32 WILC_strncmp(const WILC_Char *pcStr1, const WILC_Char *pcStr2,
 			 WILC_Uint32 u32Count)
 {
@@ -109,108 +69,6 @@ WILC_Sint32 WILC_strncmp(const WILC_Char *pcStr1, const WILC_Char *pcStr2,
 	return s32Result;
 }
 
-/*
- *  @author	syounan
- *  @date	1 Nov 2010
- *  @version	2.0
- */
-WILC_Sint32 WILC_strcmp_IgnoreCase(const WILC_Char *pcStr1, const WILC_Char *pcStr2)
-{
-	WILC_Sint32 s32Result;
-
-	if (pcStr1 == WILC_NULL && pcStr2 == WILC_NULL)	{
-		s32Result = 0;
-	} else if (pcStr1 == WILC_NULL)	   {
-		s32Result = -1;
-	} else if (pcStr2 == WILC_NULL)	   {
-		s32Result = 1;
-	} else {
-		WILC_Char cTestedChar1, cTestedChar2;
-		do {
-			cTestedChar1 = *pcStr1;
-			if ((*pcStr1 >= 'a') && (*pcStr1 <= 'z')) {
-				/* turn a lower case character to an upper case one */
-				cTestedChar1 -= 32;
-			}
-
-			cTestedChar2 = *pcStr2;
-			if ((*pcStr2 >= 'a') && (*pcStr2 <= 'z')) {
-				/* turn a lower case character to an upper case one */
-				cTestedChar2 -= 32;
-			}
-
-			pcStr1++;
-			pcStr2++;
-
-		} while ((cTestedChar1 == cTestedChar2)
-			 && (cTestedChar1 != 0)
-			 && (cTestedChar2 != 0));
-
-		if (cTestedChar1 > cTestedChar2) {
-			s32Result = 1;
-		} else if (cTestedChar1 < cTestedChar2)	   {
-			s32Result = -1;
-		} else {
-			s32Result = 0;
-		}
-	}
-
-	return s32Result;
-}
-
-/*!
- *  @author	aabozaeid
- *  @date	8 Dec 2010
- *  @version	1.0
- */
-WILC_Sint32 WILC_strncmp_IgnoreCase(const WILC_Char *pcStr1, const WILC_Char *pcStr2,
-				    WILC_Uint32 u32Count)
-{
-	WILC_Sint32 s32Result;
-
-	if (pcStr1 == WILC_NULL && pcStr2 == WILC_NULL)	{
-		s32Result = 0;
-	} else if (pcStr1 == WILC_NULL)	   {
-		s32Result = -1;
-	} else if (pcStr2 == WILC_NULL)	   {
-		s32Result = 1;
-	} else {
-		WILC_Char cTestedChar1, cTestedChar2;
-		do {
-			cTestedChar1 = *pcStr1;
-			if ((*pcStr1 >= 'a') && (*pcStr1 <= 'z')) {
-				/* turn a lower case character to an upper case one */
-				cTestedChar1 -= 32;
-			}
-
-			cTestedChar2 = *pcStr2;
-			if ((*pcStr2 >= 'a') && (*pcStr2 <= 'z')) {
-				/* turn a lower case character to an upper case one */
-				cTestedChar2 -= 32;
-			}
-
-			pcStr1++;
-			pcStr2++;
-			u32Count--;
-
-		} while ((u32Count > 0)
-			 && (cTestedChar1 == cTestedChar2)
-			 && (cTestedChar1 != 0)
-			 && (cTestedChar2 != 0));
-
-		if (cTestedChar1 > cTestedChar2) {
-			s32Result = 1;
-		} else if (cTestedChar1 < cTestedChar2)	   {
-			s32Result = -1;
-		} else {
-			s32Result = 0;
-		}
-	}
-
-	return s32Result;
-
-}
-
 /*!
  *  @author	syounan
  *  @date	18 Aug 2010
@@ -220,212 +78,3 @@ WILC_Uint32 WILC_strlen(const WILC_Char *pcStr)
 {
 	return (WILC_Uint32)strlen(pcStr);
 }
-
-/*!
- *  @author	bfahmy
- *  @date	28 Aug 2010
- *  @version	1.0
- */
-WILC_Sint32 WILC_strtoint(const WILC_Char *pcStr)
-{
-	return (WILC_Sint32)(simple_strtol(pcStr, NULL, 10));
-}
-
-/*
- *  @author	syounan
- *  @date	1 Nov 2010
- *  @version	2.0
- */
-WILC_ErrNo WILC_snprintf(WILC_Char *pcTarget, WILC_Uint32 u32Size,
-			 const WILC_Char *pcFormat, ...)
-{
-	va_list argptr;
-	va_start(argptr, pcFormat);
-	if (vsnprintf(pcTarget, u32Size, pcFormat, argptr) < 0)	{
-		/* if turncation happens windows does not properly terminate strings */
-		pcTarget[u32Size - 1] = 0;
-	}
-	va_end(argptr);
-
-	/* I find no sane way of detecting errors in windows, so let it all succeed ! */
-	return WILC_SUCCESS;
-}
-
-#ifdef CONFIG_WILC_EXTENDED_STRING_OPERATIONS
-
-/**
- *  @brief
- *  @details    Searches for the first occurrence of the character c in the first n bytes
- *                              of the string pointed to by the argument str.
- *                              Returns a pointer pointing to the first matching character,
- *                              or null if no match was found.
- *  @param[in]
- *  @return
- *  @note
- *  @author		remil
- *  @date		3 Nov 2010
- *  @version		1.0
- */
-WILC_Char *WILC_memchr(const void *str, WILC_Char c, WILC_Sint32 n)
-{
-	return (WILC_Char *) memchr(str, c, (size_t)n);
-}
-
-/**
- *  @brief
- *  @details    Searches for the first occurrence of the character c (an unsigned char)
- *                              in the string pointed to by the argument str.
- *                              The terminating null character is considered to be part of the string.
- *                              Returns a pointer pointing to the first matching character,
- *                              or null if no match was found.
- *  @param[in]
- *  @return
- *  @note
- *  @author		remil
- *  @date		3 Nov 2010
- *  @version		1.0
- */
-WILC_Char *WILC_strchr(const WILC_Char *str, WILC_Char c)
-{
-	return strchr(str, c);
-}
-
-/**
- *  @brief
- *  @details    Appends the string pointed to by str2 to the end of the string pointed to by str1.
- *                              The terminating null character of str1 is overwritten.
- *                              Copying stops once the terminating null character of str2 is copied. If overlapping occurs, the result is undefined.
- *                              The argument str1 is returned.
- *  @param[in]  WILC_Char* str1,
- *  @param[in]  WILC_Char* str2,
- *  @return             WILC_Char*
- *  @note
- *  @author		remil
- *  @date		3 Nov 2010
- *  @version		1.0
- */
-WILC_Char *WILC_strcat(WILC_Char *str1, const WILC_Char *str2)
-{
-	return strcat(str1, str2);
-}
-
-/**
- *  @brief
- *  @details    Copy pcSource to pcTarget
- *  @param[in]  WILC_Char* pcTarget
- *  @param[in]  const WILC_Char* pcSource
- *  @return             WILC_Char*
- *  @note
- *  @author		remil
- *  @date		3 Nov 2010
- *  @version		1.0
- */
-WILC_Char *WILC_strcpy(WILC_Char *pcTarget, const WILC_Char *pcSource)
-{
-	return strncpy(pcTarget, pcSource, strlen(pcSource));
-}
-
-/**
- *  @brief
- *  @details    Finds the first sequence of characters in the string str1 that
- *                              does not contain any character specified in str2.
- *                              Returns the length of this first sequence of characters found that
- *                              do not match with str2.
- *  @param[in]  const WILC_Char *str1
- *  @param[in]  const WILC_Char *str2
- *  @return             WILC_Uint32
- *  @note
- *  @author		remil
- *  @date		3 Nov 2010
- *  @version		1.0
- */
-WILC_Uint32 WILC_strcspn(const WILC_Char *str1, const WILC_Char *str2)
-{
-	return (WILC_Uint32)strcspn(str1, str2);
-}
-#if 0
-/**
- *  @brief
- *  @details    Searches an internal array for the error number errnum and returns a pointer
- *                              to an error message string.
- *                              Returns a pointer to an error message string.
- *  @param[in]  WILC_Sint32 errnum
- *  @return             WILC_Char*
- *  @note
- *  @author		remil
- *  @date		3 Nov 2010
- *  @version		1.0
- */
-WILC_Char *WILC_strerror(WILC_Sint32 errnum)
-{
-	return strerror(errnum);
-}
-#endif
-
-/**
- *  @brief
- *  @details    Finds the first occurrence of the entire string str2
- *                              (not including the terminating null character) which appears in the string str1.
- *                              Returns a pointer to the first occurrence of str2 in str1.
- *                              If no match was found, then a null pointer is returned.
- *                              If str2 points to a string of zero length, then the argument str1 is returned.
- *  @param[in]  const WILC_Char *str1
- *  @param[in]  const WILC_Char *str2
- *  @return             WILC_Char*
- *  @note
- *  @author		remil
- *  @date		3 Nov 2010
- *  @version		1.0
- */
-WILC_Char *WILC_strstr(const WILC_Char *str1, const WILC_Char *str2)
-{
-	return strstr(str1, str2);
-}
-#if 0
-/**
- *  @brief
- *  @details    Parses the C string str interpreting its content as a floating point
- *                              number and returns its value as a double.
- *                              If endptr is not a null pointer, the function also sets the value pointed
- *                              by endptr to point to the first character after the number.
- *  @param[in]  const WILC_Char* str
- *  @param[in]  WILC_Char** endptr
- *  @return             WILC_Double
- *  @note
- *  @author		remil
- *  @date		11 Nov 2010
- *  @version		1.0
- */
-WILC_Double WILC_StringToDouble(const WILC_Char *str, WILC_Char **endptr)
-{
-	return strtod (str, endptr);
-}
-#endif
-
-/**
- *  @brief              Parses the C string str interpreting its content as an unsigned integral
- *                              number of the specified base, which is returned as an unsigned long int value.
- *  @details    The function first discards as many whitespace characters as necessary
- *                              until the first non-whitespace character is found.
- *                              Then, starting from this character, takes as many characters as possible
- *                              that are valid following a syntax that depends on the base parameter,
- *                              and interprets them as a numerical value.
- *                              Finally, a pointer to the first character following the integer
- *                              representation in str is stored in the object pointed by endptr.
- *  @param[in]  const WILC_Char *str
- *  @param[in]	WILC_Char **endptr
- *  @param[in]	WILC_Sint32 base
- *  @return             WILC_Uint32
- *  @note
- *  @author		remil
- *  @date		11 Nov 2010
- *  @version		1.0
- */
-WILC_Uint32 WILC_StringToUint32(const WILC_Char *str, WILC_Char **endptr, WILC_Sint32 base)
-{
-	return simple_strtoul(str, endptr, base);
-}
-
-#endif
-
-#endif
diff --git a/drivers/staging/wilc1000/wilc_strutils.h b/drivers/staging/wilc1000/wilc_strutils.h
index 3a973a5ec61b..62bd1af9e039 100644
--- a/drivers/staging/wilc1000/wilc_strutils.h
+++ b/drivers/staging/wilc1000/wilc_strutils.h
@@ -10,10 +10,6 @@
  *  @version	1.0
  */
 
-#ifndef CONFIG_WILC_STRING_UTILS
-#error the feature CONFIG_WILC_STRING_UTILS must be supported to include this file
-#endif
-
 /*!
  *  @brief	Compares two memory buffers
  *  @param[in]	pvArg1 pointer to the first memory location
@@ -85,22 +81,6 @@ static WILC_ErrNo WILC_memcpy(void *pvTarget, const void *pvSource, WILC_Uint32
 void *WILC_memset(void *pvTarget, WILC_Uint8 u8SetValue, WILC_Uint32 u32Count);
 
 /*!
- *  @brief	Concatenates the contents of 2 strings up to a given count
- *  @param[in]	pcTarget the target string, its null character will be overwritten
- *              and contents of pcSource will be concatentaed to it
- *  @param[in]	pcSource the source string the will be concatentaed
- *  @param[in]	u32Count copying will proceed until a null character in pcSource
- *              is encountered or u32Count of bytes copied
- *  @return	value of pcTarget
- *  @note	this function repeats the functionality of standard strncat
- *  @author	syounan
- *  @date	18 Aug 2010
- *  @version	1.0
- */
-WILC_Char *WILC_strncat(WILC_Char *pcTarget, const WILC_Char *pcSource,
-			WILC_Uint32 u32Count);
-
-/*!
  *  @brief	copies the contents of source string into the target string
  *  @param[in]	pcTarget the target string buffer
  *  @param[in]	pcSource the source string the will be copied
@@ -116,24 +96,6 @@ WILC_Char *WILC_strncpy(WILC_Char *pcTarget, const WILC_Char *pcSource,
 			WILC_Uint32 u32Count);
 
 /*!
- *  @brief	Compares two strings
- *  @details	Compares 2 strings reporting which is bigger, WILC_NULL is considered
- *              the smallest string, then a zero length string then all other
- *              strings depending on thier ascii characters order
- *  @param[in]	pcStr1 the first string, WILC_NULL is valid and considered smaller
- *              than any other non-NULL string (incliding zero lenght strings)
- *  @param[in]	pcStr2 the second string, WILC_NULL is valid and considered smaller
- *              than any other non-NULL string (incliding zero lenght strings)
- *  @return	0 if the 2 strings are equal, 1 if pcStr1 is bigger than pcStr2,
- *              -1 if pcStr1 smaller than pcStr2
- *  @note	this function repeats the functionality of standard strcmp
- *  @author	syounan
- *  @date	18 Aug 2010
- *  @version	1.0
- */
-WILC_Sint32 WILC_strcmp(const WILC_Char *pcStr1, const WILC_Char *pcStr2);
-
-/*!
  *  @brief	Compares two strings up to u32Count characters
  *  @details	Compares 2 strings reporting which is bigger, WILC_NULL is considered
  *              the smallest string, then a zero length string then all other
@@ -155,46 +117,6 @@ WILC_Sint32 WILC_strncmp(const WILC_Char *pcStr1, const WILC_Char *pcStr2,
 			 WILC_Uint32 u32Count);
 
 /*!
- *  @brief	Compares two strings ignoring the case of its latin letters
- *  @details	Compares 2 strings reporting which is bigger, WILC_NULL is considered
- *              the smallest string, then a zero length string then all other
- *              strings depending on thier ascii characters order with small case
- *              converted to uppder case
- *  @param[in]	pcStr1 the first string, WILC_NULL is valid and considered smaller
- *              than any other non-NULL string (incliding zero lenght strings)
- *  @param[in]	pcStr2 the second string, WILC_NULL is valid and considered smaller
- *              than any other non-NULL string (incliding zero lenght strings)
- *  @return	0 if the 2 strings are equal, 1 if pcStr1 is bigger than pcStr2,
- *              -1 if pcStr1 smaller than pcStr2
- *  @author	syounan
- *  @date	1 Nov 2010
- *  @version	2.0
- */
-WILC_Sint32 WILC_strcmp_IgnoreCase(const WILC_Char *pcStr1, const WILC_Char *pcStr2);
-
-/*!
- *  @brief	Compares two strings ignoring the case of its latin letters up to
- *		u32Count characters
- *  @details	Compares 2 strings reporting which is bigger, WILC_NULL is considered
- *              the smallest string, then a zero length string then all other
- *              strings depending on thier ascii characters order with small case
- *              converted to uppder case
- *  @param[in]	pcStr1 the first string, WILC_NULL is valid and considered smaller
- *              than any other non-NULL string (incliding zero lenght strings)
- *  @param[in]	pcStr2 the second string, WILC_NULL is valid and considered smaller
- *              than any other non-NULL string (incliding zero lenght strings)
- *  @param[in]	u32Count copying will proceed until a null character in pcStr1 or
- *              pcStr2 is encountered or u32Count of bytes copied
- *  @return	0 if the 2 strings are equal, 1 if pcStr1 is bigger than pcStr2,
- *              -1 if pcStr1 smaller than pcStr2
- *  @author	aabozaeid
- *  @date	7 Dec 2010
- *  @version	1.0
- */
-WILC_Sint32 WILC_strncmp_IgnoreCase(const WILC_Char *pcStr1, const WILC_Char *pcStr2,
-				    WILC_Uint32 u32Count);
-
-/*!
  *  @brief	gets the length of a string
  *  @param[in]	pcStr the string
  *  @return	the length
@@ -205,208 +127,4 @@ WILC_Sint32 WILC_strncmp_IgnoreCase(const WILC_Char *pcStr1, const WILC_Char *pc
  */
 WILC_Uint32 WILC_strlen(const WILC_Char *pcStr);
 
-/*!
- *  @brief	convert string to integer
- *  @param[in]	pcStr the string
- *  @return	the value of string
- *  @note	this function repeats the functionality of the libc atoi
- *  @author	bfahmy
- *  @date	28 Aug 2010
- *  @version	1.0
- */
-WILC_Sint32 WILC_strtoint(const WILC_Char *pcStr);
-
-/*!
- *  @brief	print a formatted string into a buffer
- *  @param[in]	pcTarget the buffer where the resulting string is written
- *  @param[in]	u32Size size of the output beffer including the \0 terminating
- *              character
- *  @param[in]	pcFormat format of the string
- *  @return	number of character written or would have been written if the
- *              string were not truncated
- *  @note	this function repeats the functionality of standard snprintf
- *  @author	syounan
- *  @date	1 Nov 2010
- *  @version	2.0
- */
-WILC_Sint32 WILC_snprintf(WILC_Char *pcTarget, WILC_Uint32 u32Size,
-			  const WILC_Char *pcFormat, ...);
-
-
-#ifdef CONFIG_WILC_EXTENDED_STRING_OPERATIONS
-
-
-/**
- *  @brief
- *  @details    Searches for the first occurrence of the character c in the first n bytes
- *                              of the string pointed to by the argument str.
- *                              Returns a pointer pointing to the first matching character,
- *                              or null if no match was found.
- *  @param[in]
- *  @return
- *  @note
- *  @author		remil
- *  @date		3 Nov 2010
- *  @version		1.0
- */
-WILC_Char *WILC_memchr(const void *str, WILC_Char c, WILC_Sint32 n);
-
-/**
- *  @brief
- *  @details    Searches for the first occurrence of the character c (an unsigned char)
- *                              in the string pointed to by the argument str.
- *                              The terminating null character is considered to be part of the string.
- *                              Returns a pointer pointing to the first matching character,
- *                              or null if no match was found.
- *  @param[in]
- *  @return
- *  @note
- *  @author		remil
- *  @date		3 Nov 2010
- *  @version		1.0
- */
-WILC_Char *WILC_strchr(const WILC_Char *str, WILC_Char c);
-
-/**
- *  @brief
- *  @details    Appends the string pointed to by str2 to the end of the string pointed to by str1.
- *                              The terminating null character of str1 is overwritten.
- *                              Copying stops once the terminating null character of str2 is copied. If overlapping occurs, the result is undefined.
- *                              The argument str1 is returned.
- *  @param[in]  WILC_Char* str1,
- *  @param[in]  WILC_Char* str2,
- *  @return             WILC_Char*
- *  @note
- *  @author		remil
- *  @date		3 Nov 2010
- *  @version		1.0
- */
-WILC_Char *WILC_strcat(WILC_Char *str1, const WILC_Char *str2);
-
-
-/**
- *  @brief
- *  @details    Copy pcSource to pcTarget
- *  @param[in]  WILC_Char* pcTarget
- *  @param[in]  const WILC_Char* pcSource
- *  @return             WILC_Char*
- *  @note
- *  @author		remil
- *  @date		3 Nov 2010
- *  @version		1.0
- */
-WILC_Char *WILC_strcpy(WILC_Char *pcTarget, const WILC_Char *pcSource);
-
-
-
-/**
- *  @brief
- *  @details    Finds the first sequence of characters in the string str1 that
- *                              does not contain any character specified in str2.
- *                              Returns the length of this first sequence of characters found that
- *                              do not match with str2.
- *  @param[in]  const WILC_Char *str1
- *  @param[in]  const WILC_Char *str2
- *  @return             WILC_Uint32
- *  @note
- *  @author		remil
- *  @date		3 Nov 2010
- *  @version		1.0
- */
-WILC_Uint32 WILC_strcspn(const WILC_Char *str1, const WILC_Char *str2);
-
-
-/**
- *  @brief
- *  @details    Searches an internal array for the error number errnum and returns a pointer
- *                              to an error message string.
- *                              Returns a pointer to an error message string.
- *  @param[in]  WILC_Sint32 errnum
- *  @return             WILC_Char*
- *  @note
- *  @author		remil
- *  @date		3 Nov 2010
- *  @version		1.0
- */
-WILC_Char *WILC_strerror(WILC_Sint32 errnum);
-
-/**
- *  @brief
- *  @details    Finds the first occurrence of the entire string str2
- *                              (not including the terminating null character) which appears in the string str1.
- *                              Returns a pointer to the first occurrence of str2 in str1.
- *                              If no match was found, then a null pointer is returned.
- *                              If str2 points to a string of zero length, then the argument str1 is returned.
- *  @param[in]  const WILC_Char *str1
- *  @param[in]  const WILC_Char *str2
- *  @return             WILC_Char*
- *  @note
- *  @author		remil
- *  @date		3 Nov 2010
- *  @version		1.0
- */
-WILC_Char *WILC_strstr(const WILC_Char *str1, const WILC_Char *str2);
-
-/**
- *  @brief
- *  @details    Searches for the first occurrence of the character c (an unsigned char)
- *                              in the string pointed to by the argument str.
- *                              The terminating null character is considered to be part of the string.
- *                              Returns a pointer pointing to the first matching character,
- *                              or null if no match was found.
- *  @param[in]
- *  @return
- *  @note
- *  @author		remil
- *  @date		3 Nov 2010
- *  @version		1.0
- */
-WILC_Char *WILC_strchr(const WILC_Char *str, WILC_Char c);
-
-
-/**
- *  @brief
- *  @details    Parses the C string str interpreting its content as a floating point
- *                              number and returns its value as a double.
- *                              If endptr is not a null pointer, the function also sets the value pointed
- *                              by endptr to point to the first character after the number.
- *  @param[in]  const WILC_Char* str
- *  @param[in]  WILC_Char** endptr
- *  @return             WILC_Double
- *  @note
- *  @author		remil
- *  @date		11 Nov 2010
- *  @version		1.0
- */
-WILC_Double WILC_StringToDouble(const WILC_Char *str,
-				WILC_Char **endptr);
-
-
-/**
- *  @brief              Parses the C string str interpreting its content as an unsigned integral
- *                              number of the specified base, which is returned as an unsigned long int value.
- *  @details    The function first discards as many whitespace characters as necessary
- *                              until the first non-whitespace character is found.
- *                              Then, starting from this character, takes as many characters as possible
- *                              that are valid following a syntax that depends on the base parameter,
- *                              and interprets them as a numerical value.
- *                              Finally, a pointer to the first character following the integer
- *                              representation in str is stored in the object pointed by endptr.
- *  @param[in]  const WILC_Char *str
- *  @param[in]	WILC_Char **endptr
- *  @param[in]	WILC_Sint32 base
- *  @return             WILC_Uint32
- *  @note
- *  @author		remil
- *  @date		11 Nov 2010
- *  @version		1.0
- */
-WILC_Uint32 WILC_StringToUint32(const WILC_Char *str,
-				WILC_Char **endptr,
-				WILC_Sint32 base);
-
-
-
-#endif
-
 #endif
-- 
2.1.0.rc2


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 07/16] staging: wilc1000: simplify msgqueue code
  2015-05-29 20:52 [PATCH 00/16] wilc1000: dead code removal and other cleanup Arnd Bergmann
                   ` (5 preceding siblings ...)
  2015-05-29 20:52 ` [PATCH 06/16] staging: wilc1000: remove unused string functions Arnd Bergmann
@ 2015-05-29 20:52 ` Arnd Bergmann
  2015-05-29 20:52 ` [PATCH 08/16] staging: wilc1000: remove unused memory handling code Arnd Bergmann
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 21+ messages in thread
From: Arnd Bergmann @ 2015-05-29 20:52 UTC (permalink / raw)
  To: Greg KH
  Cc: Rachel Kim, Dean Lee, Chris Park, devel, nicolas.ferre,
	Johnny Kim, linux-kernel, Arnd Bergmann

The driver contains an abstraction for message queues, with
optional unused features, while the driver requires the main
feature.

This makes the msgqueue code unconditional as it's required
but removes the unused parts.

A later cleanup should remove the entire msgqueue code
and replace it with some normal kernel API.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/wilc1000/wilc_msgqueue.c  |  9 ---------
 drivers/staging/wilc1000/wilc_msgqueue.h  | 30 ------------------------------
 drivers/staging/wilc1000/wilc_osconfig.h  |  3 ---
 drivers/staging/wilc1000/wilc_oswrapper.h |  2 --
 drivers/staging/wilc1000/wilc_platform.h  | 12 ------------
 5 files changed, 56 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c
index c1d0dabed479..1113092398d1 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -1,8 +1,6 @@
 
 #include "wilc_oswrapper.h"
 #include <linux/spinlock.h>
-#ifdef CONFIG_WILC_MSG_QUEUE_FEATURE
-
 
 /*!
  *  @author		syounan
@@ -154,11 +152,6 @@ WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
 	spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
 
 	WILC_SemaphoreFillDefault(&strSemAttrs);
-	#ifdef CONFIG_WILC_MSG_QUEUE_TIMEOUT
-	if (pstrAttrs != WILC_NULL) {
-		strSemAttrs.u32TimeOut = pstrAttrs->u32Timeout;
-	}
-	#endif
 	s32RetStatus = WILC_SemaphoreAcquire(&(pHandle->hSem), &strSemAttrs);
 	if (s32RetStatus == WILC_TIMEOUT) {
 		/* timed out, just exit without consumeing the message */
@@ -207,5 +200,3 @@ WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
 
 	return s32RetStatus;
 }
-
-#endif
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h b/drivers/staging/wilc1000/wilc_msgqueue.h
index a48be533aad9..84157368335d 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -10,10 +10,6 @@
  *  @version	1.0
  */
 
-#ifndef CONFIG_WILC_MSG_QUEUE_FEATURE
-#error the feature CONFIG_WILC_MSG_QUEUE_FEATURE must be supported to include this file
-#endif
-
 /*!
  *  @struct             tstrWILC_MsgQueueAttrs
  *  @brief		Message Queue API options
@@ -22,38 +18,12 @@
  *  @version		1.0
  */
 typedef struct {
-	#ifdef CONFIG_WILC_MSG_QUEUE_IPC_NAME
-	WILC_Char *pcName;
-	#endif
-
-	#ifdef CONFIG_WILC_MSG_QUEUE_TIMEOUT
-	WILC_Uint32 u32Timeout;
-	#endif
-
 	/* a dummy member to avoid compiler errors*/
 	WILC_Uint8 dummy;
 
 } tstrWILC_MsgQueueAttrs;
 
 /*!
- *  @brief		Fills the MsgQueueAttrs with default parameters
- *  @param[out]	pstrAttrs structure to be filled
- *  @sa			WILC_TimerAttrs
- *  @author		syounan
- *  @date		30 Aug 2010
- *  @version		1.0
- */
-static void WILC_MsgQueueFillDefault(tstrWILC_MsgQueueAttrs *pstrAttrs)
-{
-	#ifdef CONFIG_WILC_MSG_QUEUE_IPC_NAME
-	pstrAttrs->pcName = WILC_NULL;
-	#endif
-
-	#ifdef CONFIG_WILC_MSG_QUEUE_TIMEOUT
-	pstrAttrs->u32Timeout = WILC_OS_INFINITY;
-	#endif
-}
-/*!
  *  @brief		Creates a new Message queue
  *  @details		Creates a new Message queue, if the feature
  *                              CONFIG_WILC_MSG_QUEUE_IPC_NAME is enabled and pstrAttrs->pcName
diff --git a/drivers/staging/wilc1000/wilc_osconfig.h b/drivers/staging/wilc1000/wilc_osconfig.h
index f18615e09400..d89864c7697c 100644
--- a/drivers/staging/wilc1000/wilc_osconfig.h
+++ b/drivers/staging/wilc1000/wilc_osconfig.h
@@ -20,9 +20,6 @@
 /* #define CONFIG_WILC_MEMORY_POOLS 1 */
 /* #define CONFIG_WILC_MEMORY_DEBUG 1 */
 /* #define CONFIG_WILC_ASSERTION_SUPPORT 1 */
-#define CONFIG_WILC_MSG_QUEUE_FEATURE
-/* #define CONFIG_WILC_MSG_QUEUE_IPC_NAME */
-/* #define CONFIG_WILC_MSG_QUEUE_TIMEOUT */
 /* #define CONFIG_WILC_FILE_OPERATIONS_FEATURE */
 /* #define CONFIG_WILC_FILE_OPERATIONS_STRING_API */
 /* #define CONFIG_WILC_FILE_OPERATIONS_PATH_API */
diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h
index c4e97ae03ae0..8b4c3dced981 100644
--- a/drivers/staging/wilc1000/wilc_oswrapper.h
+++ b/drivers/staging/wilc1000/wilc_oswrapper.h
@@ -78,9 +78,7 @@ typedef WILC_Uint16 WILC_WideChar;
 #include "wilc_strutils.h"
 
 /* Message Queue */
-#ifdef CONFIG_WILC_MSG_QUEUE_FEATURE
 #include "wilc_msgqueue.h"
-#endif
 
 /* File operations */
 #ifdef CONFIG_WILC_FILE_OPERATIONS_FEATURE
diff --git a/drivers/staging/wilc1000/wilc_platform.h b/drivers/staging/wilc1000/wilc_platform.h
index b20bbb839e5a..2f6484989565 100644
--- a/drivers/staging/wilc1000/wilc_platform.h
+++ b/drivers/staging/wilc1000/wilc_platform.h
@@ -50,18 +50,6 @@
 #error This feature is not supported by this OS
 #endif
 
-/* CONFIG_WILC_MSG_QUEUE_FEATURE is implemented */
-
-/* remove the following block when implementing its feature */
-#ifdef CONFIG_WILC_MSG_QUEUE_IPC_NAME
-#error This feature is not supported by this OS
-#endif
-
-/* remove the following block when implementing its feature */
-/*#ifdef CONFIG_WILC_MSG_QUEUE_TIMEOUT
- * #error This feature is not supported by this OS
- #endif*/
-
 /* CONFIG_WILC_FILE_OPERATIONS_FEATURE is implemented */
 
 /* CONFIG_WILC_FILE_OPERATIONS_STRING_API is implemented */
-- 
2.1.0.rc2


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 08/16] staging: wilc1000: remove unused memory handling code
  2015-05-29 20:52 [PATCH 00/16] wilc1000: dead code removal and other cleanup Arnd Bergmann
                   ` (6 preceding siblings ...)
  2015-05-29 20:52 ` [PATCH 07/16] staging: wilc1000: simplify msgqueue code Arnd Bergmann
@ 2015-05-29 20:52 ` Arnd Bergmann
  2015-05-29 20:52 ` [PATCH 09/16] staging: wilc1000: simplify semaphore wrapper Arnd Bergmann
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 21+ messages in thread
From: Arnd Bergmann @ 2015-05-29 20:52 UTC (permalink / raw)
  To: Greg KH
  Cc: Rachel Kim, Dean Lee, Chris Park, devel, nicolas.ferre,
	Johnny Kim, linux-kernel, Arnd Bergmann

The driver contains its own abstraction for memory allocation,
most of it unused. This removes the unused parts, but the
rest should also be removed later.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/wilc1000/wilc_memory.c    |  5 --
 drivers/staging/wilc1000/wilc_memory.h    | 93 -------------------------------
 drivers/staging/wilc1000/wilc_osconfig.h  |  3 -
 drivers/staging/wilc1000/wilc_oswrapper.h |  2 -
 drivers/staging/wilc1000/wilc_platform.h  | 13 -----
 5 files changed, 116 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_memory.c b/drivers/staging/wilc1000/wilc_memory.c
index cf0976b443b8..fbba38da19bc 100644
--- a/drivers/staging/wilc1000/wilc_memory.c
+++ b/drivers/staging/wilc1000/wilc_memory.c
@@ -1,9 +1,6 @@
 
 #include "wilc_oswrapper.h"
 
-#ifdef CONFIG_WILC_MEMORY_FEATURE
-
-
 /*!
  *  @author	syounan
  *  @date	18 Aug 2010
@@ -59,5 +56,3 @@ void WILC_MemoryFree(void *pvBlock, tstrWILC_MemoryAttrs *strAttrs,
 {
 	kfree(pvBlock);
 }
-
-#endif
diff --git a/drivers/staging/wilc1000/wilc_memory.h b/drivers/staging/wilc1000/wilc_memory.h
index 1e45641af454..012f03cae0c8 100644
--- a/drivers/staging/wilc1000/wilc_memory.h
+++ b/drivers/staging/wilc1000/wilc_memory.h
@@ -10,10 +10,6 @@
  *  @version	1.0
  */
 
-#ifndef CONFIG_WILC_MEMORY_FEATURE
-#error the feature CONFIG_WILC_MEMORY_FEATURE must be supported to include this file
-#endif
-
 /*!
  *  @struct             tstrWILC_MemoryAttrs
  *  @brief		Memory API options
@@ -22,33 +18,9 @@
  *  @version		1.0
  */
 typedef struct {
-	#ifdef CONFIG_WILC_MEMORY_POOLS
-	/*!< the allocation pool to use for this memory, NULL for system
-	 * allocation. Default is NULL
-	 */
-	WILC_MemoryPoolHandle *pAllocationPool;
-	#endif
-
-	/* a dummy member to avoid compiler errors*/
-	WILC_Uint8 dummy;
 } tstrWILC_MemoryAttrs;
 
 /*!
- *  @brief	Fills the tstrWILC_MemoryAttrs with default parameters
- *  @param[out]	pstrAttrs structure to be filled
- *  @sa		tstrWILC_MemoryAttrs
- *  @author	syounan
- *  @date	16 Aug 2010
- *  @version	1.0
- */
-static void WILC_MemoryFillDefault(tstrWILC_MemoryAttrs *pstrAttrs)
-{
-	#ifdef CONFIG_WILC_MEMORY_POOLS
-	pstrAttrs->pAllocationPool = WILC_NULL;
-	#endif
-}
-
-/*!
  *  @brief	Allocates a given size of bytes
  *  @param[in]	u32Size size of memory in bytes to be allocated
  *  @param[in]	strAttrs Optional attributes, NULL for default
@@ -145,69 +117,6 @@ void WILC_MemoryFree(void *pvBlock, tstrWILC_MemoryAttrs *strAttrs,
 			WILC_Char *pcFileName, WILC_Uint32 u32LineNo);
 
 /*!
- *  @brief	Creates a new memory pool
- *  @param[out]	pHandle the handle to the new Pool
- *  @param[in]	u32PoolSize The pool size in bytes
- *  @param[in]	strAttrs Optional attributes, NULL for default
- *  @return	Error code indicating sucess/failure
- *  @sa		sttrWILC_MemoryAttrs
- *  @author	syounan
- *  @date	16 Aug 2010
- *  @version	1.0
- */
-WILC_ErrNo WILC_MemoryNewPool(WILC_MemoryPoolHandle *pHandle, WILC_Uint32 u32PoolSize,
-			      tstrWILC_MemoryAttrs *strAttrs);
-
-/*!
- *  @brief	Deletes a memory pool, freeing all memory allocated from it as well
- *  @param[in]	pHandle the handle to the deleted Pool
- *  @param[in]	strAttrs Optional attributes, NULL for default
- *  @return	Error code indicating sucess/failure
- *  @sa		sttrWILC_MemoryAttrs
- *  @author	syounan
- *  @date	16 Aug 2010
- *  @version	1.0
- */
-WILC_ErrNo WILC_MemoryDelPool(WILC_MemoryPoolHandle *pHandle, tstrWILC_MemoryAttrs *strAttrs);
-
-
-#ifdef CONFIG_WILC_MEMORY_DEBUG
-
-/*!
- * @brief	standrad malloc wrapper with custom attributes
- */
-	#define WILC_MALLOC_EX(__size__, __attrs__) \
-	(WILC_MemoryAlloc( \
-		 (__size__), __attrs__,	\
-		 (WILC_Char *)__WILC_FILE__, (WILC_Uint32)__WILC_LINE__))
-
-/*!
- * @brief	standrad calloc wrapper with custom attributes
- */
-	#define WILC_CALLOC_EX(__size__, __attrs__) \
-	(WILC_MemoryCalloc( \
-		 (__size__), __attrs__,	\
-		 (WILC_Char *)__WILC_FILE__, (WILC_Uint32)__WILC_LINE__))
-
-/*!
- * @brief	standrad realloc wrapper with custom attributes
- */
-	#define WILC_REALLOC_EX(__ptr__, __new_size__, __attrs__) \
-	(WILC_MemoryRealloc( \
-		 (__ptr__), (__new_size__), __attrs__, \
-		 (WILC_Char *)__WILC_FILE__, (WILC_Uint32)__WILC_LINE__))
-
-/*!
- * @brief	standrad free wrapper with custom attributes
- */
-	#define WILC_FREE_EX(__ptr__, __attrs__) \
-	(WILC_MemoryFree( \
-		 (__ptr__), __attrs__, \
-		 (WILC_Char *)__WILC_FILE__, (WILC_Uint32)__WILC_LINE__))
-
-#else
-
-/*!
  * @brief	standrad malloc wrapper with custom attributes
  */
 	#define WILC_MALLOC_EX(__size__, __attrs__) \
@@ -234,8 +143,6 @@ WILC_ErrNo WILC_MemoryDelPool(WILC_MemoryPoolHandle *pHandle, tstrWILC_MemoryAtt
 	(WILC_MemoryFree( \
 		 (__ptr__), __attrs__, WILC_NULL, 0))
 
-#endif
-
 /*!
  * @brief	Allocates a block (with custom attributes) of given type and number of
  * elements
diff --git a/drivers/staging/wilc1000/wilc_osconfig.h b/drivers/staging/wilc1000/wilc_osconfig.h
index d89864c7697c..eec93b351f14 100644
--- a/drivers/staging/wilc1000/wilc_osconfig.h
+++ b/drivers/staging/wilc1000/wilc_osconfig.h
@@ -16,9 +16,6 @@
 #define CONFIG_WILC_SLEEP_HI_RES 1
 #define CONFIG_WILC_TIMER_FEATURE 1
 /* #define CONFIG_WILC_TIMER_PERIODIC 1 */
-#define CONFIG_WILC_MEMORY_FEATURE 1
-/* #define CONFIG_WILC_MEMORY_POOLS 1 */
-/* #define CONFIG_WILC_MEMORY_DEBUG 1 */
 /* #define CONFIG_WILC_ASSERTION_SUPPORT 1 */
 /* #define CONFIG_WILC_FILE_OPERATIONS_FEATURE */
 /* #define CONFIG_WILC_FILE_OPERATIONS_STRING_API */
diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h
index 8b4c3dced981..fd5dd3c6316e 100644
--- a/drivers/staging/wilc1000/wilc_oswrapper.h
+++ b/drivers/staging/wilc1000/wilc_oswrapper.h
@@ -70,9 +70,7 @@ typedef WILC_Uint16 WILC_WideChar;
 #endif
 
 /* Memory support */
-#ifdef CONFIG_WILC_MEMORY_FEATURE
 #include "wilc_memory.h"
-#endif
 
 /* String Utilities */
 #include "wilc_strutils.h"
diff --git a/drivers/staging/wilc1000/wilc_platform.h b/drivers/staging/wilc1000/wilc_platform.h
index 2f6484989565..36e2e707354b 100644
--- a/drivers/staging/wilc1000/wilc_platform.h
+++ b/drivers/staging/wilc1000/wilc_platform.h
@@ -33,18 +33,6 @@
 
 /* CONFIG_WILC_TIMER_PERIODIC is implemented */
 
-/* CONFIG_WILC_MEMORY_FEATURE is implemented */
-
-/* remove the following block when implementing its feature */
-#ifdef CONFIG_WILC_MEMORY_POOLS
-#error This feature is not supported by this OS
-#endif
-
-/* remove the following block when implementing its feature */
-#ifdef CONFIG_WILC_MEMORY_DEBUG
-#error This feature is not supported by this OS
-#endif
-
 /* remove the following block when implementing its feature */
 #ifdef CONFIG_WILC_ASSERTION_SUPPORT
 #error This feature is not supported by this OS
@@ -100,7 +88,6 @@
  *      OS specific types
  *******************************************************************/
 
-typedef void *WILC_MemoryPoolHandle;
 typedef struct semaphore WILC_SemaphoreHandle;
 
 typedef struct timer_list WILC_TimerHandle;
-- 
2.1.0.rc2


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 09/16] staging: wilc1000: simplify semaphore wrapper
  2015-05-29 20:52 [PATCH 00/16] wilc1000: dead code removal and other cleanup Arnd Bergmann
                   ` (7 preceding siblings ...)
  2015-05-29 20:52 ` [PATCH 08/16] staging: wilc1000: remove unused memory handling code Arnd Bergmann
@ 2015-05-29 20:52 ` Arnd Bergmann
  2015-05-29 20:52 ` [PATCH 10/16] staging: wilc1000: clean up sleep wrapper Arnd Bergmann
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 21+ messages in thread
From: Arnd Bergmann @ 2015-05-29 20:52 UTC (permalink / raw)
  To: Greg KH
  Cc: Rachel Kim, Dean Lee, Chris Park, devel, nicolas.ferre,
	Johnny Kim, linux-kernel, Arnd Bergmann

The driver has its own API for semaphores. This should
be replaced with mutexes and completions, but for the moment
we can start by removing the obviously unused parts.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/wilc1000/wilc_osconfig.h  |  1 -
 drivers/staging/wilc1000/wilc_oswrapper.h |  2 --
 drivers/staging/wilc1000/wilc_semaphore.c | 14 --------------
 drivers/staging/wilc1000/wilc_semaphore.h | 18 +-----------------
 4 files changed, 1 insertion(+), 34 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_osconfig.h b/drivers/staging/wilc1000/wilc_osconfig.h
index eec93b351f14..d0bf08f89906 100644
--- a/drivers/staging/wilc1000/wilc_osconfig.h
+++ b/drivers/staging/wilc1000/wilc_osconfig.h
@@ -10,7 +10,6 @@
 
 /* OS features supported */
 
-#define CONFIG_WILC_SEMAPHORE_FEATURE 1
 /* #define CONFIG_WILC_SEMAPHORE_TIMEOUT 1 */
 #define CONFIG_WILC_SLEEP_FEATURE 1
 #define CONFIG_WILC_SLEEP_HI_RES 1
diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h
index fd5dd3c6316e..32fe48a6034b 100644
--- a/drivers/staging/wilc1000/wilc_oswrapper.h
+++ b/drivers/staging/wilc1000/wilc_oswrapper.h
@@ -55,9 +55,7 @@ typedef WILC_Uint16 WILC_WideChar;
 #include "wilc_errorsupport.h"
 
 /* Semaphore support */
-#ifdef CONFIG_WILC_SEMAPHORE_FEATURE
 #include "wilc_semaphore.h"
-#endif
 
 /* Sleep support */
 #ifdef CONFIG_WILC_SLEEP_FEATURE
diff --git a/drivers/staging/wilc1000/wilc_semaphore.c b/drivers/staging/wilc1000/wilc_semaphore.c
index 637107bfb877..f09a88ca6ae4 100644
--- a/drivers/staging/wilc1000/wilc_semaphore.c
+++ b/drivers/staging/wilc1000/wilc_semaphore.c
@@ -1,7 +1,5 @@
 
 #include "wilc_oswrapper.h"
-#ifdef CONFIG_WILC_SEMAPHORE_FEATURE
-
 
 WILC_ErrNo WILC_SemaphoreCreate(WILC_SemaphoreHandle *pHandle,
 				tstrWILC_SemaphoreAttrs *pstrAttrs)
@@ -33,19 +31,9 @@ WILC_ErrNo WILC_SemaphoreAcquire(WILC_SemaphoreHandle *pHandle,
 {
 	WILC_ErrNo s32RetStatus = WILC_SUCCESS;
 
-	#ifndef CONFIG_WILC_SEMAPHORE_TIMEOUT
 	while (down_interruptible(pHandle))
 		;
 
-	#else
-	if (pstrAttrs == WILC_NULL) {
-		down(pHandle);
-	} else {
-
-		s32RetStatus = down_timeout(pHandle, msecs_to_jiffies(pstrAttrs->u32TimeOut));
-	}
-	#endif
-
 	if (s32RetStatus == 0) {
 		return WILC_SUCCESS;
 	} else if (s32RetStatus == -ETIME)   {
@@ -66,5 +54,3 @@ WILC_ErrNo WILC_SemaphoreRelease(WILC_SemaphoreHandle *pHandle,
 	return WILC_SUCCESS;
 
 }
-
-#endif
diff --git a/drivers/staging/wilc1000/wilc_semaphore.h b/drivers/staging/wilc1000/wilc_semaphore.h
index 3006f9f20c4d..3c0ecc326fb3 100644
--- a/drivers/staging/wilc1000/wilc_semaphore.h
+++ b/drivers/staging/wilc1000/wilc_semaphore.h
@@ -10,11 +10,6 @@
  *  @version		1.0
  */
 
-
-#ifndef CONFIG_WILC_SEMAPHORE_FEATURE
-#error the feature WILC_OS_FEATURE_SEMAPHORE must be supported to include this file
-#endif
-
 /*!
  *  @struct             WILC_SemaphoreAttrs
  *  @brief		Semaphore API options
@@ -28,14 +23,6 @@ typedef struct {
 	 */
 	WILC_Uint32 u32InitCount;
 
-	#ifdef CONFIG_WILC_SEMAPHORE_TIMEOUT
-	/*!<
-	 * Timeout for use with WILC_SemaphoreAcquire, 0 to return immediately and
-	 * WILC_OS_INFINITY to wait forever. default is WILC_OS_INFINITY
-	 */
-	WILC_Uint32 u32TimeOut;
-	#endif
-
 } tstrWILC_SemaphoreAttrs;
 
 
@@ -47,12 +34,9 @@ typedef struct {
  *  @date	10 Aug 2010
  *  @version	1.0
  */
-static void WILC_SemaphoreFillDefault(tstrWILC_SemaphoreAttrs *pstrAttrs)
+static inline void WILC_SemaphoreFillDefault(tstrWILC_SemaphoreAttrs *pstrAttrs)
 {
 	pstrAttrs->u32InitCount = 1;
-	#ifdef CONFIG_WILC_SEMAPHORE_TIMEOUT
-	pstrAttrs->u32TimeOut = WILC_OS_INFINITY;
-	#endif
 }
 /*!
  *  @brief	Creates a new Semaphore object
-- 
2.1.0.rc2


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 10/16] staging: wilc1000: clean up sleep wrapper
  2015-05-29 20:52 [PATCH 00/16] wilc1000: dead code removal and other cleanup Arnd Bergmann
                   ` (8 preceding siblings ...)
  2015-05-29 20:52 ` [PATCH 09/16] staging: wilc1000: simplify semaphore wrapper Arnd Bergmann
@ 2015-05-29 20:52 ` Arnd Bergmann
  2015-05-29 20:52 ` [PATCH 11/16] staging: wilc1000: clean up timer feature Arnd Bergmann
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 21+ messages in thread
From: Arnd Bergmann @ 2015-05-29 20:52 UTC (permalink / raw)
  To: Greg KH
  Cc: Rachel Kim, Dean Lee, Chris Park, devel, nicolas.ferre,
	Johnny Kim, linux-kernel, Arnd Bergmann

The driver has a simple wrapper around msleep, as well as
a more advanced sleep function that is unused. This removes
the unused code and the options to turn the feature on or
off.

A follow-up should rework the code to use msleep directly.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/wilc1000/wilc_osconfig.h  |  2 --
 drivers/staging/wilc1000/wilc_oswrapper.h |  2 --
 drivers/staging/wilc1000/wilc_platform.h  |  6 ------
 drivers/staging/wilc1000/wilc_sleep.c     | 10 ----------
 drivers/staging/wilc1000/wilc_sleep.h     | 30 +-----------------------------
 5 files changed, 1 insertion(+), 49 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_osconfig.h b/drivers/staging/wilc1000/wilc_osconfig.h
index d0bf08f89906..6da42c837928 100644
--- a/drivers/staging/wilc1000/wilc_osconfig.h
+++ b/drivers/staging/wilc1000/wilc_osconfig.h
@@ -11,8 +11,6 @@
 /* OS features supported */
 
 /* #define CONFIG_WILC_SEMAPHORE_TIMEOUT 1 */
-#define CONFIG_WILC_SLEEP_FEATURE 1
-#define CONFIG_WILC_SLEEP_HI_RES 1
 #define CONFIG_WILC_TIMER_FEATURE 1
 /* #define CONFIG_WILC_TIMER_PERIODIC 1 */
 /* #define CONFIG_WILC_ASSERTION_SUPPORT 1 */
diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h
index 32fe48a6034b..2af32fff84aa 100644
--- a/drivers/staging/wilc1000/wilc_oswrapper.h
+++ b/drivers/staging/wilc1000/wilc_oswrapper.h
@@ -58,9 +58,7 @@ typedef WILC_Uint16 WILC_WideChar;
 #include "wilc_semaphore.h"
 
 /* Sleep support */
-#ifdef CONFIG_WILC_SLEEP_FEATURE
 #include "wilc_sleep.h"
-#endif
 
 /* Timer support */
 #ifdef CONFIG_WILC_TIMER_FEATURE
diff --git a/drivers/staging/wilc1000/wilc_platform.h b/drivers/staging/wilc1000/wilc_platform.h
index 36e2e707354b..2c66c3f3a2c5 100644
--- a/drivers/staging/wilc1000/wilc_platform.h
+++ b/drivers/staging/wilc1000/wilc_platform.h
@@ -22,12 +22,6 @@
  * #error This feature is not supported by this OS
  #endif*/
 
-/* CONFIG_WILC_SLEEP_FEATURE is implemented */
-
-/* remove the following block when implementing its feature */
-/* #ifdef CONFIG_WILC_SLEEP_HI_RES */
-/* #error This feature is not supported by this OS */
-/* #endif */
 
 /* CONFIG_WILC_TIMER_FEATURE is implemented */
 
diff --git a/drivers/staging/wilc1000/wilc_sleep.c b/drivers/staging/wilc1000/wilc_sleep.c
index b8f45146956b..98a079f3d6c9 100644
--- a/drivers/staging/wilc1000/wilc_sleep.c
+++ b/drivers/staging/wilc1000/wilc_sleep.c
@@ -1,8 +1,6 @@
 
 #include "wilc_oswrapper.h"
 
-#ifdef CONFIG_WILC_SLEEP_FEATURE
-
 /*
  *  @author	mdaftedar
  *  @date	10 Aug 2010
@@ -18,11 +16,3 @@ void WILC_Sleep(WILC_Uint32 u32TimeMilliSec)
 	}
 
 }
-#endif
-
-/* #ifdef CONFIG_WILC_SLEEP_HI_RES */
-void WILC_SleepMicrosec(WILC_Uint32 u32TimeMicoSec)
-{
-	usleep_range(u32TimeMicoSec, u32TimeMicoSec);
-}
-/* #endif */
diff --git a/drivers/staging/wilc1000/wilc_sleep.h b/drivers/staging/wilc1000/wilc_sleep.h
index d640fb553aca..2865c8e44346 100644
--- a/drivers/staging/wilc1000/wilc_sleep.h
+++ b/drivers/staging/wilc1000/wilc_sleep.h
@@ -2,19 +2,6 @@
 #define __WILC_SLEEP_H__
 
 /*!
- *  @file		wilc_sleep.h
- *  @brief		Sleep OS Wrapper functionality
- *  @author		syounan
- *  @sa			wilc_oswrapper.h top level OS wrapper file
- *  @date		10 Aug 2010
- *  @version		1.0
- */
-
-#ifndef CONFIG_WILC_SLEEP_FEATURE
-#error the feature WILC_OS_FEATURE_SLEEP must be supported to include this file
-#endif
-
-/*!
  *  @brief	forces the current thread to sleep until the given time has elapsed
  *  @param[in]	u32TimeMilliSec Time to sleep in Milli seconds
  *  @sa		WILC_SleepMicrosec
@@ -24,22 +11,7 @@
  *  @note	This function offers a relatively innacurate and low resolution
  *              sleep, for accurate high resolution sleep use u32TimeMicoSec
  */
+/* TODO: remove and open-code in callers */
 void WILC_Sleep(WILC_Uint32 u32TimeMilliSec);
 
-#ifdef CONFIG_WILC_SLEEP_HI_RES
-/*!
- *  @brief	forces the current thread to sleep until the given time has elapsed
- *  @param[in]	u32TimeMicoSec Time to sleep in Micro seconds
- *  @sa		WILC_Sleep
- *  @author	syounan
- *  @date	10 Aug 2010
- *  @version	1.0
- *  @note	This function offers an acurare high resolution sleep, depends on
- *              the feature WILC_OS_FEATURE_SLEEP_HI_RES and may not be supported
- *              on all Operating Systems
- */
-void WILC_SleepMicrosec(WILC_Uint32 u32TimeMicoSec);
-#endif
-
-
 #endif
-- 
2.1.0.rc2


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 11/16] staging: wilc1000: clean up timer feature
  2015-05-29 20:52 [PATCH 00/16] wilc1000: dead code removal and other cleanup Arnd Bergmann
                   ` (9 preceding siblings ...)
  2015-05-29 20:52 ` [PATCH 10/16] staging: wilc1000: clean up sleep wrapper Arnd Bergmann
@ 2015-05-29 20:52 ` Arnd Bergmann
  2015-05-29 20:52 ` [PATCH 12/16] staging: wilc1000: remove unused OS abstraction features Arnd Bergmann
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 21+ messages in thread
From: Arnd Bergmann @ 2015-05-29 20:52 UTC (permalink / raw)
  To: Greg KH
  Cc: Rachel Kim, Dean Lee, Chris Park, devel, nicolas.ferre,
	Johnny Kim, linux-kernel, Arnd Bergmann

The driver has a simple wrapper around timer_list, and an
optional but unused feature to make the timer periodic.

This removes support for the periodic timer and simplifies
the code around timers.

A follow-up should replace the remaining wrapper with
open-coded timers.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/wilc1000/wilc_osconfig.h  |  2 --
 drivers/staging/wilc1000/wilc_oswrapper.h |  2 --
 drivers/staging/wilc1000/wilc_platform.h  |  4 ----
 drivers/staging/wilc1000/wilc_timer.c     |  6 ------
 drivers/staging/wilc1000/wilc_timer.h     | 27 ---------------------------
 5 files changed, 41 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_osconfig.h b/drivers/staging/wilc1000/wilc_osconfig.h
index 6da42c837928..639160d1fa4e 100644
--- a/drivers/staging/wilc1000/wilc_osconfig.h
+++ b/drivers/staging/wilc1000/wilc_osconfig.h
@@ -11,8 +11,6 @@
 /* OS features supported */
 
 /* #define CONFIG_WILC_SEMAPHORE_TIMEOUT 1 */
-#define CONFIG_WILC_TIMER_FEATURE 1
-/* #define CONFIG_WILC_TIMER_PERIODIC 1 */
 /* #define CONFIG_WILC_ASSERTION_SUPPORT 1 */
 /* #define CONFIG_WILC_FILE_OPERATIONS_FEATURE */
 /* #define CONFIG_WILC_FILE_OPERATIONS_STRING_API */
diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h
index 2af32fff84aa..be6393cba8c2 100644
--- a/drivers/staging/wilc1000/wilc_oswrapper.h
+++ b/drivers/staging/wilc1000/wilc_oswrapper.h
@@ -61,9 +61,7 @@ typedef WILC_Uint16 WILC_WideChar;
 #include "wilc_sleep.h"
 
 /* Timer support */
-#ifdef CONFIG_WILC_TIMER_FEATURE
 #include "wilc_timer.h"
-#endif
 
 /* Memory support */
 #include "wilc_memory.h"
diff --git a/drivers/staging/wilc1000/wilc_platform.h b/drivers/staging/wilc1000/wilc_platform.h
index 2c66c3f3a2c5..d3f8fc6f2971 100644
--- a/drivers/staging/wilc1000/wilc_platform.h
+++ b/drivers/staging/wilc1000/wilc_platform.h
@@ -23,10 +23,6 @@
  #endif*/
 
 
-/* CONFIG_WILC_TIMER_FEATURE is implemented */
-
-/* CONFIG_WILC_TIMER_PERIODIC is implemented */
-
 /* remove the following block when implementing its feature */
 #ifdef CONFIG_WILC_ASSERTION_SUPPORT
 #error This feature is not supported by this OS
diff --git a/drivers/staging/wilc1000/wilc_timer.c b/drivers/staging/wilc1000/wilc_timer.c
index 477986dcff0a..7d2e6f19c00b 100644
--- a/drivers/staging/wilc1000/wilc_timer.c
+++ b/drivers/staging/wilc1000/wilc_timer.c
@@ -1,10 +1,6 @@
 
 #include "wilc_oswrapper.h"
 
-#ifdef CONFIG_WILC_TIMER_FEATURE
-
-
-
 WILC_ErrNo WILC_TimerCreate(WILC_TimerHandle *pHandle,
 	tpfWILC_TimerFunction pfCallback, tstrWILC_TimerAttrs *pstrAttrs)
 {
@@ -47,5 +43,3 @@ WILC_ErrNo WILC_TimerStop(WILC_TimerHandle *pHandle,
 
 	return s32RetStatus;
 }
-
-#endif
diff --git a/drivers/staging/wilc1000/wilc_timer.h b/drivers/staging/wilc1000/wilc_timer.h
index 1080ce24a045..41c6784ab8e1 100644
--- a/drivers/staging/wilc1000/wilc_timer.h
+++ b/drivers/staging/wilc1000/wilc_timer.h
@@ -10,10 +10,6 @@
  *  @version	1.0
  */
 
-#ifndef CONFIG_WILC_TIMER_FEATURE
-#error the feature CONFIG_WILC_TIMER_FEATURE must be supported to include this file
-#endif
-
 typedef void (*tpfWILC_TimerFunction)(void *);
 
 /*!
@@ -24,34 +20,11 @@ typedef void (*tpfWILC_TimerFunction)(void *);
  *  @version		1.0
  */
 typedef struct {
-	/*!< if set to WILC_TRUE the callback function will be called
-	 * periodically. */
-	#ifdef CONFIG_WILC_TIMER_PERIODIC
-	WILC_Bool bPeriodicTimer;
-	#endif
-
 	/* a dummy member to avoid compiler errors*/
 	WILC_Uint8 dummy;
 } tstrWILC_TimerAttrs;
 
 /*!
- *  @brief	Fills the WILC_TimerAttrs with default parameters
- *  @param[out]	pstrAttrs structure to be filled
- *  @sa		WILC_TimerAttrs
- *  @author	syounan
- *  @date	16 Aug 2010
- *  @version	1.0
- */
-
-static void WILC_TimerFillDefault(tstrWILC_TimerAttrs *pstrAttrs)
-{
-	#ifdef CONFIG_WILC_TIMER_PERIODIC
-	pstrAttrs->bPeriodicTimer = WILC_FALSE;
-	#endif
-}
-
-
-/*!
  *  @brief	Creates a new timer
  *  @details	Timers are a useful utility to execute some callback function
  *              in the future.
-- 
2.1.0.rc2


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 12/16] staging: wilc1000: remove unused OS abstraction features
  2015-05-29 20:52 [PATCH 00/16] wilc1000: dead code removal and other cleanup Arnd Bergmann
                   ` (10 preceding siblings ...)
  2015-05-29 20:52 ` [PATCH 11/16] staging: wilc1000: clean up timer feature Arnd Bergmann
@ 2015-05-29 20:52 ` Arnd Bergmann
  2015-05-29 20:52 ` [PATCH 13/16] staging: wilc1000: remove EXPORT_SYMTAB Arnd Bergmann
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 21+ messages in thread
From: Arnd Bergmann @ 2015-05-29 20:52 UTC (permalink / raw)
  To: Greg KH
  Cc: Rachel Kim, Dean Lee, Chris Park, devel, nicolas.ferre,
	Johnny Kim, linux-kernel, Arnd Bergmann

All the remaining features from the OS abstraction layer
are not used at all in the driver, so we can just remove
the remaining references to them.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/wilc1000/wilc_errorsupport.h |  17 ----
 drivers/staging/wilc1000/wilc_event.h        | 123 ---------------------------
 drivers/staging/wilc1000/wilc_osconfig.h     |  14 ---
 drivers/staging/wilc1000/wilc_oswrapper.h    |  22 -----
 drivers/staging/wilc1000/wilc_platform.h     |  62 --------------
 5 files changed, 238 deletions(-)
 delete mode 100644 drivers/staging/wilc1000/wilc_event.h

diff --git a/drivers/staging/wilc1000/wilc_errorsupport.h b/drivers/staging/wilc1000/wilc_errorsupport.h
index 6405ef8ad431..4da657d17020 100644
--- a/drivers/staging/wilc1000/wilc_errorsupport.h
+++ b/drivers/staging/wilc1000/wilc_errorsupport.h
@@ -64,21 +64,4 @@ typedef WILC_Sint32 WILC_ErrNo;
 ERRORHANDLER: \
 	if (WILC_IS_ERR(__status__)) \
 
-#ifdef CONFIG_WILC_ASSERTION_SUPPORT
-
-/**
- * @brief	prints a diagnostic message and aborts the program
- * @param[in]   pcExpression The expression that triggered the assertion
- * @param[in]   pcFileName The name of the current source file.
- * @param[in]   u32LineNumber The line number in the current source file.
- * @warning DO NOT CALL DIRECTLY. USE EQUIVALENT MACRO FUNCTION INSTEAD.
- */
-void WILC_assert_INTERNAL(WILC_Char *pcExpression, WILC_Char *pcFileName, WILC_Uint32 u32LineNumber);
-
-#define WILC_assert(__expression__) (void)(!!(__expression__) || (WILC_assert_INTERNAL((# __expression__), __WILC_FILE__, __WILC_LINE__), 0))
-
-#else
-#define WILC_assert(__expression__) ((void)0)
-#endif
-
 #endif
diff --git a/drivers/staging/wilc1000/wilc_event.h b/drivers/staging/wilc1000/wilc_event.h
deleted file mode 100644
index 94e0f7c0bed5..000000000000
--- a/drivers/staging/wilc1000/wilc_event.h
+++ /dev/null
@@ -1,123 +0,0 @@
-#ifndef __WILC_EVENT_H__
-#define __WILC_EVENT_H__
-
-/*!
- *  @file	wilc_event.h
- *  @brief	Event OS wrapper functionality
- *  @author	syounan
- *  @sa		wilc_oswrapper.h top level OS wrapper file
- *  @date	10 Oct 2010
- *  @version	1.0
- */
-
-#ifndef CONFIG_WILC_EVENT_FEATURE
-#error the feature CONFIG_WILC_EVENT_FEATURE must be supported to include this file
-#endif
-
-
-/*!
- *  @struct             tstrWILC_TimerAttrs
- *  @brief		Timer API options
- *  @author		syounan
- *  @date		10 Oct 2010
- *  @version		1.0
- */
-typedef struct {
-	/* a dummy member to avoid compiler errors*/
-	WILC_Uint8 dummy;
-
-	#ifdef CONFIG_WILC_EVENT_TIMEOUT
-	/*!<
-	 * Timeout for use with WILC_EventWait, 0 to return immediately and
-	 * WILC_OS_INFINITY to wait forever. default is WILC_OS_INFINITY
-	 */
-	WILC_Uint32 u32TimeOut;
-	#endif
-
-} tstrWILC_EventAttrs;
-
-/*!
- *  @brief	Fills the WILC_TimerAttrs with default parameters
- *  @param[out]	pstrAttrs structure to be filled
- *  @sa		WILC_TimerAttrs
- *  @author	syounan
- *  @date	10 Oct 2010
- *  @version	1.0
- */
-static void WILC_EventFillDefault(tstrWILC_EventAttrs *pstrAttrs)
-{
-	#ifdef CONFIG_WILC_EVENT_TIMEOUT
-	pstrAttrs->u32TimeOut = WILC_OS_INFINITY;
-	#endif
-}
-
-/*!
- *  @brief	Creates a new Event
- *  @details	the Event is an object that allows a thread to wait until an external
- *                      event occuers, Event objects have 2 states, either TRIGGERED or
- *                      UNTRIGGERED
- *  @param[out]	pHandle handle to the newly created event object
- *  @param[in]	pstrAttrs Optional attributes, NULL for default
- *  @return	Error code indicating sucess/failure
- *  @sa		tstrWILC_EventAttrs
- *  @author	syounan
- *  @date	10 Oct 2010
- *  @version	1.0
- */
-WILC_ErrNo WILC_EventCreate(WILC_EventHandle *pHandle, tstrWILC_EventAttrs *pstrAttrs);
-
-
-/*!
- *  @brief	Destroys a given event
- *  @details	This will destroy a given event freeing any resources used by it
- *              if there are any thread blocked by the WILC_EventWait call the the
- *              behaviour is undefined
- *  @param[in]	pHandle handle to the event object
- *  @param[in]	pstrAttrs Optional attributes, NULL for default
- *  @return	Error code indicating sucess/failure
- *  @sa		tstrWILC_EventAttrs
- *  @author	syounan
- *  @date	10 Oct 2010
- *  @version	1.0
- */
-WILC_ErrNo WILC_EventDestroy(WILC_EventHandle *pHandle,
-			     tstrWILC_EventAttrs *pstrAttrs);
-
-/*!
- *  @brief	Triggers a given event
- *  @details	This function will set the given event into the TRIGGERED state,
- *                      if the event is already in TRIGGERED, this function will have no
- *                      effect
- *  @param[in]	pHandle handle to the event object
- *  @param[in]	pstrAttrs Optional attributes, NULL for default
- *  @return	Error code indicating sucess/failure
- *  @sa		tstrWILC_EventAttrs
- *  @author	syounan
- *  @date	10 Oct 2010
- *  @version	1.0
- */
-WILC_ErrNo WILC_EventTrigger(WILC_EventHandle *pHandle,
-			     tstrWILC_EventAttrs *pstrAttrs);
-
-
-/*!
- *  @brief	waits until a given event is triggered
- *  @details	This function will block the calling thread until the event becomes
- *                      in the TRIGGERED state. the call will retun the event into the
- *                      UNTRIGGERED	state upon completion
- *                      if multible threads are waiting on the same event at the same time,
- *                      behaviour is undefined
- *  @param[in]	pHandle handle to the event object
- *  @param[in]	pstrAttrs Optional attributes, NULL for default
- *  @return	Error code indicating sucess/failure
- *  @sa		tstrWILC_EventAttrs
- *  @author	syounan
- *  @date	10 Oct 2010
- *  @version	1.0
- */
-WILC_ErrNo WILC_EventWait(WILC_EventHandle *pHandle,
-			  tstrWILC_EventAttrs *pstrAttrs);
-
-
-
-#endif
\ No newline at end of file
diff --git a/drivers/staging/wilc1000/wilc_osconfig.h b/drivers/staging/wilc1000/wilc_osconfig.h
index 639160d1fa4e..f9c25140393e 100644
--- a/drivers/staging/wilc1000/wilc_osconfig.h
+++ b/drivers/staging/wilc1000/wilc_osconfig.h
@@ -7,17 +7,3 @@
 #define WILC_LOGS_ALL              5
 
 #define WILC_LOG_VERBOSITY_LEVEL WILC_LOGS_ALL
-
-/* OS features supported */
-
-/* #define CONFIG_WILC_SEMAPHORE_TIMEOUT 1 */
-/* #define CONFIG_WILC_ASSERTION_SUPPORT 1 */
-/* #define CONFIG_WILC_FILE_OPERATIONS_FEATURE */
-/* #define CONFIG_WILC_FILE_OPERATIONS_STRING_API */
-/* #define CONFIG_WILC_FILE_OPERATIONS_PATH_API */
-/* #define CONFIG_WILC_EVENT_FEATURE */
-/* #define CONFIG_WILC_EVENT_TIMEOUT */
-/* #define CONFIG_WILC_SOCKET_FEATURE */
-/* #define CONFIG_WILC_MATH_OPERATIONS_FEATURE */
-/* #define CONFIG_WILC_EXTENDED_FILE_OPERATIONS */
-/* #define CONFIG_WILC_EXTENDED_TIME_OPERATIONS */
diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h
index be6393cba8c2..1999970635aa 100644
--- a/drivers/staging/wilc1000/wilc_oswrapper.h
+++ b/drivers/staging/wilc1000/wilc_oswrapper.h
@@ -72,26 +72,4 @@ typedef WILC_Uint16 WILC_WideChar;
 /* Message Queue */
 #include "wilc_msgqueue.h"
 
-/* File operations */
-#ifdef CONFIG_WILC_FILE_OPERATIONS_FEATURE
-#include "wilc_fileops.h"
-#endif
-
-/* Event support */
-#ifdef CONFIG_WILC_EVENT_FEATURE
-#include "wilc_event.h"
-#endif
-
-/* Socket operations */
-#ifdef CONFIG_WILC_SOCKET_FEATURE
-#include "wilc_socket.h"
-#endif
-
-/* Math operations */
-#ifdef CONFIG_WILC_MATH_OPERATIONS_FEATURE
-#include "wilc_math.h"
-#endif
-
-
-
 #endif
diff --git a/drivers/staging/wilc1000/wilc_platform.h b/drivers/staging/wilc1000/wilc_platform.h
index d3f8fc6f2971..2e0f41735df0 100644
--- a/drivers/staging/wilc1000/wilc_platform.h
+++ b/drivers/staging/wilc1000/wilc_platform.h
@@ -1,68 +1,6 @@
 #ifndef __WILC_platfrom_H__
 #define __WILC_platfrom_H__
 
-/*!
- *  @file	wilc_platform.h
- *  @brief	platform specific file for Linux port
- *  @author	syounan
- *  @sa		wilc_oswrapper.h top level OS wrapper file
- *  @date	15 Dec 2010
- *  @version	1.0
- */
-
-
-/******************************************************************
- *      Feature support checks
- *******************************************************************/
-
-/* CONFIG_WILC_SEMAPHORE_FEATURE is implemented */
-
-/* remove the following block when implementing its feature
- * #ifdef CONFIG_WILC_SEMAPHORE_TIMEOUT
- * #error This feature is not supported by this OS
- #endif*/
-
-
-/* remove the following block when implementing its feature */
-#ifdef CONFIG_WILC_ASSERTION_SUPPORT
-#error This feature is not supported by this OS
-#endif
-
-/* CONFIG_WILC_FILE_OPERATIONS_FEATURE is implemented */
-
-/* CONFIG_WILC_FILE_OPERATIONS_STRING_API is implemented */
-
-/* remove the following block when implementing its feature */
-#ifdef CONFIG_WILC_FILE_OPERATIONS_PATH_API
-#error This feature is not supported by this OS
-#endif
-
-/* remove the following block when implementing its feature */
-#ifdef CONFIG_WILC_EVENT_FEATURE
-#error This feature is not supported by this OS
-#endif
-
-/* remove the following block when implementing its feature */
-#ifdef CONFIG_WILC_EVENT_TIMEOUT
-#error This feature is not supported by this OS
-#endif
-
-/* CONFIG_WILC_MATH_OPERATIONS_FEATURE is implemented */
-
-/* CONFIG_WILC_EXTENDED_FILE_OPERATIONS is implemented */
-
-/* CONFIG_WILC_EXTENDED_TIME_OPERATIONS is implemented */
-
-/* remove the following block when implementing its feature */
-#ifdef CONFIG_WILC_SOCKET_FEATURE
-#error This feature is not supported by this OS
-#endif
-
-/******************************************************************
- *      OS specific includes
- *******************************************************************/
-#define _XOPEN_SOURCE 600
-
 #include <linux/kthread.h>
 #include <linux/semaphore.h>
 #include <linux/module.h>
-- 
2.1.0.rc2


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 13/16] staging: wilc1000: remove EXPORT_SYMTAB
  2015-05-29 20:52 [PATCH 00/16] wilc1000: dead code removal and other cleanup Arnd Bergmann
                   ` (11 preceding siblings ...)
  2015-05-29 20:52 ` [PATCH 12/16] staging: wilc1000: remove unused OS abstraction features Arnd Bergmann
@ 2015-05-29 20:52 ` Arnd Bergmann
  2015-05-29 20:52 ` [PATCH 14/16] staging: wilc1000: remove semaphore wrapper Arnd Bergmann
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 21+ messages in thread
From: Arnd Bergmann @ 2015-05-29 20:52 UTC (permalink / raw)
  To: Greg KH
  Cc: Rachel Kim, Dean Lee, Chris Park, devel, nicolas.ferre,
	Johnny Kim, linux-kernel, Arnd Bergmann

The EXPORT_SYMTAB symbol has not been used in Linux for a very
long time, the driver does not need to set it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/wilc1000/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/Makefile b/drivers/staging/wilc1000/Makefile
index 13e3ed8ef31e..4eda4cc69486 100644
--- a/drivers/staging/wilc1000/Makefile
+++ b/drivers/staging/wilc1000/Makefile
@@ -10,7 +10,7 @@ ccflags-y += -DSTA_FIRMWARE=\"atmel/wilc1000_fw.bin\" \
 		-DAP_FIRMWARE=\"atmel/wilc1000_ap_fw.bin\" \
 		-DP2P_CONCURRENCY_FIRMWARE=\"atmel/wilc1000_p2p_fw.bin\"
 
-ccflags-y += -I$(src)/ -DEXPORT_SYMTAB  -D__CHECK_ENDIAN__ -DWILC_ASIC_A0 \
+ccflags-y += -I$(src)/ -D__CHECK_ENDIAN__ -DWILC_ASIC_A0 \
 		-DPLL_WORKAROUND -DCONNECT_DIRECT  -DAGING_ALG \
 		-DWILC_PARSE_SCAN_IN_HOST -DDISABLE_PWRSAVE_AND_SCAN_DURING_IP \
 		-Wno-unused-function -DUSE_WIRELESS -DWILC_DEBUGFS
-- 
2.1.0.rc2


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 14/16] staging: wilc1000: remove semaphore wrapper
  2015-05-29 20:52 [PATCH 00/16] wilc1000: dead code removal and other cleanup Arnd Bergmann
                   ` (12 preceding siblings ...)
  2015-05-29 20:52 ` [PATCH 13/16] staging: wilc1000: remove EXPORT_SYMTAB Arnd Bergmann
@ 2015-05-29 20:52 ` Arnd Bergmann
  2015-05-30  6:46   ` Sudip Mukherjee
  2015-05-29 20:52 ` [PATCH 15/16] staging: wilc1000: fix const cast warnings Arnd Bergmann
  2015-05-29 20:52 ` [PATCH 16/16] staging: wilc1000: fix compiler warnings Arnd Bergmann
  15 siblings, 1 reply; 21+ messages in thread
From: Arnd Bergmann @ 2015-05-29 20:52 UTC (permalink / raw)
  To: Greg KH
  Cc: Rachel Kim, Dean Lee, Chris Park, devel, nicolas.ferre,
	Johnny Kim, linux-kernel, Arnd Bergmann

The various semaphore functions all directly translate into
sema_init(), down() and up(), so we can just remove the API.

This is a mostly automated conversion using simple sed scripts,
plus some manual changes to account for down() returning no
error.

As a positive side-effect, down() no longer hangs after
receiving a signal, as the original code did by looping around
down_interruptible.

The semaphores still need to be turned into mutexes as a
follow-up step.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/wilc1000/coreconfigurator.c       |  29 +---
 drivers/staging/wilc1000/fifo_buffer.c            | 108 +++++++-------
 drivers/staging/wilc1000/fifo_buffer.h            |   2 +-
 drivers/staging/wilc1000/host_interface.c         | 171 +++++++++-------------
 drivers/staging/wilc1000/host_interface.h         |  16 +-
 drivers/staging/wilc1000/wilc_msgqueue.c          |  32 ++--
 drivers/staging/wilc1000/wilc_oswrapper.h         |   3 -
 drivers/staging/wilc1000/wilc_platform.h          |   4 +-
 drivers/staging/wilc1000/wilc_semaphore.c         |  56 -------
 drivers/staging/wilc1000/wilc_semaphore.h         |  99 -------------
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  35 ++---
 drivers/staging/wilc1000/wilc_wfi_netdevice.h     |   4 +-
 12 files changed, 160 insertions(+), 399 deletions(-)
 delete mode 100644 drivers/staging/wilc1000/wilc_semaphore.c
 delete mode 100644 drivers/staging/wilc1000/wilc_semaphore.h

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index d5a076ed2426..bf444825711f 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -164,8 +164,8 @@ extern void host_int_ScanCompleteReceived(WILC_Uint8 *pu8Buffer, WILC_Uint32 u32
 /*****************************************************************************/
 /* Global Variables                                                          */
 /*****************************************************************************/
-static WILC_SemaphoreHandle SemHandleSendPkt;
-static WILC_SemaphoreHandle SemHandlePktResp;
+static struct semaphore SemHandleSendPkt;
+static struct semaphore SemHandlePktResp;
 
 static WILC_Sint8 *gps8ConfigPacket;
 
@@ -672,18 +672,10 @@ INLINE WILC_Uint16 get_asoc_id(WILC_Uint8 *data)
 WILC_Sint32 CoreConfiguratorInit(void)
 {
 	WILC_Sint32 s32Error = WILC_SUCCESS;
-	tstrWILC_SemaphoreAttrs strSemSendPktAttrs;
-	tstrWILC_SemaphoreAttrs strSemPktRespAttrs;
-
 	PRINT_D(CORECONFIG_DBG, "CoreConfiguratorInit() \n");
 
-	WILC_SemaphoreFillDefault(&strSemSendPktAttrs);
-	strSemSendPktAttrs.u32InitCount = 1;
-	WILC_SemaphoreCreate(&SemHandleSendPkt, &strSemSendPktAttrs);
-
-	WILC_SemaphoreFillDefault(&strSemPktRespAttrs);
-	strSemPktRespAttrs.u32InitCount = 0;
-	WILC_SemaphoreCreate(&SemHandlePktResp, &strSemPktRespAttrs);
+	sema_init(&SemHandleSendPkt, 1);
+	sema_init(&SemHandlePktResp, 0);
 
 	gps8ConfigPacket = (WILC_Sint8 *)WILC_MALLOC(MAX_PACKET_BUFF_SIZE);
 	if (gps8ConfigPacket == NULL) {
@@ -1931,7 +1923,7 @@ WILC_Sint32 ConfigWaitResponse(WILC_Char *pcRespBuffer, WILC_Sint32 s32MaxRespBu
 
 
 	if (gstrConfigPktInfo.bRespRequired == WILC_TRUE) {
-		WILC_SemaphoreAcquire(&SemHandlePktResp, WILC_NULL);
+		down(&SemHandlePktResp);
 
 		*ps32BytesRead = gstrConfigPktInfo.s32BytesRead;
 	}
@@ -1964,7 +1956,7 @@ WILC_Sint32 SendConfigPkt(WILC_Uint8 u8Mode, tstrWID *pstrWIDs,
 	WILC_Sint32 s32ConfigPacketLen = 0;
 	WILC_Sint32 s32RcvdRespLen = 0;
 
-	WILC_SemaphoreAcquire(&SemHandleSendPkt, WILC_NULL);
+	down(&SemHandleSendPkt);
 
 	/*set the packet mode*/
 	g_oper_mode = u8Mode;
@@ -2019,7 +2011,7 @@ WILC_Sint32 SendConfigPkt(WILC_Uint8 u8Mode, tstrWID *pstrWIDs,
 
 
 End_ConfigPkt:
-	WILC_SemaphoreRelease(&SemHandleSendPkt, WILC_NULL);
+	up(&SemHandleSendPkt);
 
 	return s32Error;
 }
@@ -2038,7 +2030,7 @@ WILC_Sint32 ConfigProvideResponse(WILC_Char *pcRespBuffer, WILC_Sint32 s32RespLe
 			PRINT_ER("BusProvideResponse() Response greater than the prepared Buffer Size \n");
 		}
 
-		WILC_SemaphoreRelease(&SemHandlePktResp, WILC_NULL);
+		up(&SemHandlePktResp);
 	}
 
 	return s32Error;
@@ -2107,11 +2099,6 @@ WILC_Sint32 CoreConfiguratorDeInit(void)
 
 	PRINT_D(CORECONFIG_DBG, "CoreConfiguratorDeInit() \n");
 
-
-	WILC_SemaphoreDestroy(&SemHandleSendPkt, WILC_NULL);
-	WILC_SemaphoreDestroy(&SemHandlePktResp, WILC_NULL);
-
-
 	if (gps8ConfigPacket != NULL) {
 
 		WILC_FREE(gps8ConfigPacket);
diff --git a/drivers/staging/wilc1000/fifo_buffer.c b/drivers/staging/wilc1000/fifo_buffer.c
index 733d81f2eeca..e23d11130728 100644
--- a/drivers/staging/wilc1000/fifo_buffer.c
+++ b/drivers/staging/wilc1000/fifo_buffer.c
@@ -13,13 +13,10 @@ WILC_Uint32 FIFO_InitBuffer(tHANDLE *hBuffer, WILC_Uint32 u32BufferLength)
 		WILC_memset (pstrFifoHandler, 0, sizeof (tstrFifoHandler));
 		pstrFifoHandler->pu8Buffer = WILC_MALLOC (u32BufferLength);
 		if (pstrFifoHandler->pu8Buffer)	{
-			tstrWILC_SemaphoreAttrs strSemBufferAttrs;
 			pstrFifoHandler->u32BufferLength = u32BufferLength;
 			WILC_memset (pstrFifoHandler->pu8Buffer, 0, u32BufferLength);
 			/* create semaphore */
-			WILC_SemaphoreFillDefault (&strSemBufferAttrs);
-			strSemBufferAttrs.u32InitCount = 1;
-			WILC_SemaphoreCreate(&pstrFifoHandler->SemBuffer, &strSemBufferAttrs);
+			sema_init(&pstrFifoHandler->SemBuffer, 1);
 			*hBuffer = pstrFifoHandler;
 		} else {
 			*hBuffer = NULL;
@@ -41,8 +38,6 @@ WILC_Uint32 FIFO_DeInit(tHANDLE hFifo)
 			u32Error = 1;
 		}
 
-		WILC_SemaphoreDestroy (&pstrFifoHandler->SemBuffer, WILC_NULL);
-
 		WILC_FREE (pstrFifoHandler);
 	} else {
 		u32Error = 1;
@@ -56,34 +51,32 @@ WILC_Uint32 FIFO_ReadBytes(tHANDLE hFifo, WILC_Uint8 *pu8Buffer, WILC_Uint32 u32
 	tstrFifoHandler *pstrFifoHandler = (tstrFifoHandler *) hFifo;
 	if (pstrFifoHandler && pu32BytesRead) {
 		if (pstrFifoHandler->u32TotalBytes) {
-			if (WILC_SemaphoreAcquire(&pstrFifoHandler->SemBuffer, WILC_NULL) == WILC_SUCCESS) {
-				if (u32BytesToRead > pstrFifoHandler->u32TotalBytes) {
-					*pu32BytesRead = pstrFifoHandler->u32TotalBytes;
-				} else {
-					*pu32BytesRead = u32BytesToRead;
-				}
-				if ((pstrFifoHandler->u32ReadOffset + u32BytesToRead) <= pstrFifoHandler->u32BufferLength) {
-					WILC_memcpy(pu8Buffer, pstrFifoHandler->pu8Buffer + pstrFifoHandler->u32ReadOffset,
-						    *pu32BytesRead);
-					/* update read offset and total bytes */
-					pstrFifoHandler->u32ReadOffset += u32BytesToRead;
-					pstrFifoHandler->u32TotalBytes -= u32BytesToRead;
+			down(&pstrFifoHandler->SemBuffer);
 
-				} else {
-					WILC_Uint32 u32FirstPart =
-						pstrFifoHandler->u32BufferLength - pstrFifoHandler->u32ReadOffset;
-					WILC_memcpy(pu8Buffer, pstrFifoHandler->pu8Buffer + pstrFifoHandler->u32ReadOffset,
-						    u32FirstPart);
-					WILC_memcpy(pu8Buffer + u32FirstPart, pstrFifoHandler->pu8Buffer,
-						    u32BytesToRead - u32FirstPart);
-					/* update read offset and total bytes */
-					pstrFifoHandler->u32ReadOffset = u32BytesToRead - u32FirstPart;
-					pstrFifoHandler->u32TotalBytes -= u32BytesToRead;
-				}
-				WILC_SemaphoreRelease (&pstrFifoHandler->SemBuffer, WILC_NULL);
+			if (u32BytesToRead > pstrFifoHandler->u32TotalBytes) {
+				*pu32BytesRead = pstrFifoHandler->u32TotalBytes;
 			} else {
-				u32Error = 1;
+				*pu32BytesRead = u32BytesToRead;
 			}
+			if ((pstrFifoHandler->u32ReadOffset + u32BytesToRead) <= pstrFifoHandler->u32BufferLength) {
+				WILC_memcpy(pu8Buffer, pstrFifoHandler->pu8Buffer + pstrFifoHandler->u32ReadOffset,
+					    *pu32BytesRead);
+				/* update read offset and total bytes */
+				pstrFifoHandler->u32ReadOffset += u32BytesToRead;
+				pstrFifoHandler->u32TotalBytes -= u32BytesToRead;
+
+			} else {
+				WILC_Uint32 u32FirstPart =
+					pstrFifoHandler->u32BufferLength - pstrFifoHandler->u32ReadOffset;
+				WILC_memcpy(pu8Buffer, pstrFifoHandler->pu8Buffer + pstrFifoHandler->u32ReadOffset,
+					    u32FirstPart);
+				WILC_memcpy(pu8Buffer + u32FirstPart, pstrFifoHandler->pu8Buffer,
+					    u32BytesToRead - u32FirstPart);
+				/* update read offset and total bytes */
+				pstrFifoHandler->u32ReadOffset = u32BytesToRead - u32FirstPart;
+				pstrFifoHandler->u32TotalBytes -= u32BytesToRead;
+			}
+			up(&pstrFifoHandler->SemBuffer);
 		} else {
 			u32Error = 1;
 		}
@@ -101,34 +94,33 @@ WILC_Uint32 FIFO_WriteBytes(tHANDLE hFifo, WILC_Uint8 *pu8Buffer, WILC_Uint32 u3
 		if (u32BytesToWrite < pstrFifoHandler->u32BufferLength)	{
 			if ((pstrFifoHandler->u32TotalBytes + u32BytesToWrite) <= pstrFifoHandler->u32BufferLength ||
 			    bForceOverWrite) {
-				if (WILC_SemaphoreAcquire(&pstrFifoHandler->SemBuffer, WILC_NULL) == WILC_SUCCESS) {
-					if ((pstrFifoHandler->u32WriteOffset + u32BytesToWrite) <= pstrFifoHandler->u32BufferLength) {
-						WILC_memcpy(pstrFifoHandler->pu8Buffer + pstrFifoHandler->u32WriteOffset, pu8Buffer,
-							    u32BytesToWrite);
-						/* update read offset and total bytes */
-						pstrFifoHandler->u32WriteOffset += u32BytesToWrite;
-						pstrFifoHandler->u32TotalBytes  += u32BytesToWrite;
+				down(&pstrFifoHandler->SemBuffer);
+				if ((pstrFifoHandler->u32WriteOffset + u32BytesToWrite) <= pstrFifoHandler->u32BufferLength) {
+					WILC_memcpy(pstrFifoHandler->pu8Buffer + pstrFifoHandler->u32WriteOffset, pu8Buffer,
+						    u32BytesToWrite);
+					/* update read offset and total bytes */
+					pstrFifoHandler->u32WriteOffset += u32BytesToWrite;
+					pstrFifoHandler->u32TotalBytes  += u32BytesToWrite;
 
-					} else {
-						WILC_Uint32 u32FirstPart =
-							pstrFifoHandler->u32BufferLength - pstrFifoHandler->u32WriteOffset;
-						WILC_memcpy(pstrFifoHandler->pu8Buffer + pstrFifoHandler->u32WriteOffset, pu8Buffer,
-							    u32FirstPart);
-						WILC_memcpy(pstrFifoHandler->pu8Buffer, pu8Buffer + u32FirstPart,
-							    u32BytesToWrite - u32FirstPart);
-						/* update read offset and total bytes */
-						pstrFifoHandler->u32WriteOffset = u32BytesToWrite - u32FirstPart;
-						pstrFifoHandler->u32TotalBytes += u32BytesToWrite;
-					}
-					/* if data overwriten */
-					if (pstrFifoHandler->u32TotalBytes > pstrFifoHandler->u32BufferLength) {
-						/* adjust read offset to the oldest data available */
-						pstrFifoHandler->u32ReadOffset = pstrFifoHandler->u32WriteOffset;
-						/* data availabe is the buffer length */
-						pstrFifoHandler->u32TotalBytes = pstrFifoHandler->u32BufferLength;
-					}
-					WILC_SemaphoreRelease(&pstrFifoHandler->SemBuffer, WILC_NULL);
+				} else {
+					WILC_Uint32 u32FirstPart =
+						pstrFifoHandler->u32BufferLength - pstrFifoHandler->u32WriteOffset;
+					WILC_memcpy(pstrFifoHandler->pu8Buffer + pstrFifoHandler->u32WriteOffset, pu8Buffer,
+						    u32FirstPart);
+					WILC_memcpy(pstrFifoHandler->pu8Buffer, pu8Buffer + u32FirstPart,
+						    u32BytesToWrite - u32FirstPart);
+					/* update read offset and total bytes */
+					pstrFifoHandler->u32WriteOffset = u32BytesToWrite - u32FirstPart;
+					pstrFifoHandler->u32TotalBytes += u32BytesToWrite;
 				}
+				/* if data overwriten */
+				if (pstrFifoHandler->u32TotalBytes > pstrFifoHandler->u32BufferLength) {
+					/* adjust read offset to the oldest data available */
+					pstrFifoHandler->u32ReadOffset = pstrFifoHandler->u32WriteOffset;
+					/* data availabe is the buffer length */
+					pstrFifoHandler->u32TotalBytes = pstrFifoHandler->u32BufferLength;
+				}
+				up(&pstrFifoHandler->SemBuffer);
 			} else {
 				u32Error = 1;
 			}
@@ -139,4 +131,4 @@ WILC_Uint32 FIFO_WriteBytes(tHANDLE hFifo, WILC_Uint8 *pu8Buffer, WILC_Uint32 u3
 		u32Error = 1;
 	}
 	return u32Error;
-}
\ No newline at end of file
+}
diff --git a/drivers/staging/wilc1000/fifo_buffer.h b/drivers/staging/wilc1000/fifo_buffer.h
index 0700e7929c00..c7e140be8fab 100644
--- a/drivers/staging/wilc1000/fifo_buffer.h
+++ b/drivers/staging/wilc1000/fifo_buffer.h
@@ -10,7 +10,7 @@ typedef struct {
 	WILC_Uint32 u32WriteOffset;
 	WILC_Uint32 u32ReadOffset;
 	WILC_Uint32 u32TotalBytes;
-	WILC_SemaphoreHandle SemBuffer;
+	struct semaphore SemBuffer;
 } tstrFifoHandler;
 
 
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 7c764a2ba573..8f7adc760500 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -545,11 +545,11 @@ WILC_Bool g_obtainingIP = WILC_FALSE;
 WILC_Uint8 P2P_LISTEN_STATE;
 static struct task_struct *HostIFthreadHandler;
 static WILC_MsgQueueHandle gMsgQHostIF;
-static WILC_SemaphoreHandle hSemHostIFthrdEnd;
+static struct semaphore hSemHostIFthrdEnd;
 
-WILC_SemaphoreHandle hSemDeinitDrvHandle;
-static WILC_SemaphoreHandle hWaitResponse;
-WILC_SemaphoreHandle hSemHostIntDeinit;
+struct semaphore hSemDeinitDrvHandle;
+static struct semaphore hWaitResponse;
+struct semaphore hSemHostIntDeinit;
 WILC_TimerHandle g_hPeriodicRSSI;
 
 
@@ -663,7 +663,7 @@ static WILC_Sint32 Handle_SetWfiDrvHandler(tstrHostIfSetDrvHandler *pstrHostIfSe
 
 
 	if ((pstrHostIfSetDrvHandler->u32Address) == (WILC_Uint32)NULL) {
-		WILC_SemaphoreRelease(&hSemDeinitDrvHandle, WILC_NULL);
+		up(&hSemDeinitDrvHandle);
 	}
 
 
@@ -709,7 +709,7 @@ static WILC_Sint32 Handle_SetOperationMode(void *drvHandler, tstrHostIfSetOperat
 
 
 	if ((pstrHostIfSetOperationMode->u32Mode) == (WILC_Uint32)NULL) {
-		WILC_SemaphoreRelease(&hSemDeinitDrvHandle, WILC_NULL);
+		up(&hSemDeinitDrvHandle);
 	}
 
 
@@ -906,7 +906,7 @@ static WILC_Sint32 Handle_GetMacAddress(void *drvHandler, tstrHostIfGetMacAddres
 	{
 
 	}
-	WILC_SemaphoreRelease(&hWaitResponse, NULL);
+	up(&hWaitResponse);
 
 	return s32Error;
 }
@@ -929,7 +929,7 @@ static WILC_Sint32 Handle_CfgParam(void *drvHandler, tstrHostIFCfgParamAttr *str
 	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
 
 
-	WILC_SemaphoreAcquire(&(pstrWFIDrv->gtOsCfgValuesSem), NULL);
+	down(&(pstrWFIDrv->gtOsCfgValuesSem));
 
 
 	PRINT_D(HOSTINF_DBG, "Setting CFG params\n");
@@ -1214,7 +1214,7 @@ static WILC_Sint32 Handle_CfgParam(void *drvHandler, tstrHostIFCfgParamAttr *str
 	WILC_CATCH(s32Error)
 	{
 	}
-	WILC_SemaphoreRelease(&(pstrWFIDrv->gtOsCfgValuesSem), NULL);
+	up(&(pstrWFIDrv->gtOsCfgValuesSem));
 	return s32Error;
 }
 
@@ -1232,7 +1232,7 @@ static WILC_Sint32 Handle_wait_msg_q_empty(void)
 {
 	WILC_Sint32 s32Error = WILC_SUCCESS;
 	g_wilc_initialized = 0;
-	WILC_SemaphoreRelease(&hWaitResponse, NULL);
+	up(&hWaitResponse);
 	return s32Error;
 }
 
@@ -2818,7 +2818,7 @@ static int Handle_Key(void *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
 
 			s32Error = SendConfigPkt(SET_CFG, &strWID, 1, WILC_TRUE, (WILC_Uint32)pstrWFIDrv);
 		}
-		WILC_SemaphoreRelease(&(pstrWFIDrv->hSemTestKeyBlock), WILC_NULL);
+		up(&(pstrWFIDrv->hSemTestKeyBlock));
 		break;
 
 	case WPARxGtk:
@@ -2867,7 +2867,7 @@ static int Handle_Key(void *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
 			WILC_FREE(pu8keybuf);
 
 			/* ////////////////////////// */
-			WILC_SemaphoreRelease(&(pstrWFIDrv->hSemTestKeyBlock), WILC_NULL);
+			up(&(pstrWFIDrv->hSemTestKeyBlock));
 			/* ///////////////////////// */
 		}
 
@@ -2914,7 +2914,7 @@ static int Handle_Key(void *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
 			WILC_FREE(pu8keybuf);
 
 			/* ////////////////////////// */
-			WILC_SemaphoreRelease(&(pstrWFIDrv->hSemTestKeyBlock), WILC_NULL);
+			up(&(pstrWFIDrv->hSemTestKeyBlock));
 			/* ///////////////////////// */
 		}
 _WPARxGtk_end_case_:
@@ -2970,7 +2970,7 @@ _WPARxGtk_end_case_:
 			WILC_FREE(pu8keybuf);
 
 			/* ////////////////////////// */
-			WILC_SemaphoreRelease(&(pstrWFIDrv->hSemTestKeyBlock), WILC_NULL);
+			up(&(pstrWFIDrv->hSemTestKeyBlock));
 			/* ///////////////////////// */
 		}
 		#endif
@@ -3011,7 +3011,7 @@ _WPARxGtk_end_case_:
 			WILC_FREE(pu8keybuf);
 
 			/* ////////////////////////// */
-			WILC_SemaphoreRelease(&(pstrWFIDrv->hSemTestKeyBlock), WILC_NULL);
+			up(&(pstrWFIDrv->hSemTestKeyBlock));
 			/* ///////////////////////// */
 		}
 
@@ -3176,7 +3176,7 @@ static void Handle_Disconnect(void *drvHandler)
 	}
 
 	/* ////////////////////////// */
-	WILC_SemaphoreRelease(&(pstrWFIDrv->hSemTestDisconnectBlock), WILC_NULL);
+	up(&(pstrWFIDrv->hSemTestDisconnectBlock));
 	/* ///////////////////////// */
 
 }
@@ -3264,7 +3264,7 @@ static WILC_Sint32 Handle_GetChnl(void *drvHandler)
 	{
 
 	}
-	WILC_SemaphoreRelease(&(pstrWFIDrv->hSemGetCHNL), WILC_NULL);
+	up(&(pstrWFIDrv->hSemGetCHNL));
 
 	return s32Error;
 
@@ -3306,7 +3306,7 @@ static void Handle_GetRssi(void *drvHandler)
 	{
 
 	}
-	WILC_SemaphoreRelease(&(pstrWFIDrv->hSemGetRSSI), WILC_NULL);
+	up(&(pstrWFIDrv->hSemGetRSSI));
 
 
 }
@@ -3337,7 +3337,7 @@ static void Handle_GetLinkspeed(void *drvHandler)
 	{
 
 	}
-	WILC_SemaphoreRelease(&(pstrWFIDrv->hSemGetLINKSPEED), WILC_NULL);
+	up(&(pstrWFIDrv->hSemGetLINKSPEED));
 
 
 }
@@ -3383,7 +3383,7 @@ WILC_Sint32 Handle_GetStatistics(void *drvHandler, tstrStatistics *pstrStatistic
 		PRINT_ER("Failed to send scan paramters config packet\n");
 		/* WILC_ERRORREPORT(s32Error, s32Error); */
 	}
-	WILC_SemaphoreRelease(&hWaitResponse, NULL);
+	up(&hWaitResponse);
 	return 0;
 
 }
@@ -3449,7 +3449,7 @@ static WILC_Sint32 Handle_Get_InActiveTime(void *drvHandler, tstrHostIfStaInacti
 
 	PRINT_D(CFG80211_DBG, "Getting inactive time : %d\n", gu32InactiveTime);
 
-	WILC_SemaphoreRelease(&(pstrWFIDrv->hSemInactiveTime), WILC_NULL);
+	up(&(pstrWFIDrv->hSemInactiveTime));
 	WILC_CATCH(s32Error)
 	{
 
@@ -3730,7 +3730,7 @@ static void Handle_DelAllSta(void *drvHandler, tstrHostIFDelAllSta *pstrDelAllSt
 	}
 	WILC_FREE_IF_TRUE(strWID.ps8WidVal);
 
-	WILC_SemaphoreRelease(&hWaitResponse, NULL);
+	up(&hWaitResponse);
 }
 
 
@@ -4301,7 +4301,7 @@ static WILC_Sint32 Handle_DelBASession(void *drvHandler, tstrHostIfBASessionInfo
 		WILC_FREE(strWID.ps8WidVal);
 
 	/*BugID_5222*/
-	WILC_SemaphoreRelease(&hWaitResponse, NULL);
+	up(&hWaitResponse);
 
 	return s32Error;
 
@@ -4355,7 +4355,7 @@ static WILC_Sint32 Handle_DelAllRxBASessions(void *drvHandler, tstrHostIfBASessi
 		WILC_FREE(strWID.ps8WidVal);
 
 	/*BugID_5222*/
-	WILC_SemaphoreRelease(&hWaitResponse, NULL);
+	up(&hWaitResponse);
 
 	return s32Error;
 
@@ -4590,7 +4590,7 @@ static int hostIFthread(void *pvArg)
 	}
 
 	PRINT_D(HOSTINF_DBG, "Releasing thread exit semaphore\n");
-	WILC_SemaphoreRelease(&hSemHostIFthrdEnd, WILC_NULL);
+	up(&hSemHostIFthrdEnd);
 	return 0;
 }
 
@@ -4692,7 +4692,7 @@ WILC_Sint32 host_int_remove_wep_key(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 u8keyI
 	s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), WILC_NULL);
 	if (s32Error)
 		PRINT_ER("Error in sending message queue : Request to remove WEP key \n");
-	WILC_SemaphoreAcquire(&(pstrWFIDrv->hSemTestKeyBlock), NULL);
+	down(&(pstrWFIDrv->hSemTestKeyBlock));
 
 	WILC_CATCH(s32Error)
 	{
@@ -4741,7 +4741,7 @@ WILC_Sint32 host_int_set_WEPDefaultKeyID(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 u
 	s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), WILC_NULL);
 	if (s32Error)
 		PRINT_ER("Error in sending message queue : Default key index\n");
-	WILC_SemaphoreAcquire(&(pstrWFIDrv->hSemTestKeyBlock), NULL);
+	down(&(pstrWFIDrv->hSemTestKeyBlock));
 
 	WILC_CATCH(s32Error)
 	{
@@ -4809,7 +4809,7 @@ WILC_Sint32 host_int_add_wep_key_bss_sta(WILC_WFIDrvHandle hWFIDrv, const WILC_U
 	s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), WILC_NULL);
 	if (s32Error)
 		PRINT_ER("Error in sending message queue :WEP Key\n");
-	WILC_SemaphoreAcquire(&(pstrWFIDrv->hSemTestKeyBlock), NULL);
+	down(&(pstrWFIDrv->hSemTestKeyBlock));
 
 	WILC_CATCH(s32Error)
 	{
@@ -4886,7 +4886,7 @@ WILC_Sint32 host_int_add_wep_key_bss_ap(WILC_WFIDrvHandle hWFIDrv, const WILC_Ui
 
 	if (s32Error)
 		PRINT_ER("Error in sending message queue :WEP Key\n");
-	WILC_SemaphoreAcquire(&(pstrWFIDrv->hSemTestKeyBlock), NULL);
+	down(&(pstrWFIDrv->hSemTestKeyBlock));
 
 	WILC_CATCH(s32Error)
 	{
@@ -4989,7 +4989,7 @@ WILC_Sint32 host_int_add_ptk(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *pu8Ptk, WILC
 		PRINT_ER("Error in sending message queue:  PTK Key\n");
 
 	/* ////////////// */
-	WILC_SemaphoreAcquire(&(pstrWFIDrv->hSemTestKeyBlock), NULL);
+	down(&(pstrWFIDrv->hSemTestKeyBlock));
 	/* WILC_Sleep(100); */
 	/* /////// */
 
@@ -5093,7 +5093,7 @@ WILC_Sint32 host_int_add_rx_gtk(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *pu8RxGtk,
 	if (s32Error)
 		PRINT_ER("Error in sending message queue:  RX GTK\n");
 	/* ////////////// */
-	WILC_SemaphoreAcquire(&(pstrWFIDrv->hSemTestKeyBlock), NULL);
+	down(&(pstrWFIDrv->hSemTestKeyBlock));
 	/* WILC_Sleep(100); */
 	/* /////// */
 
@@ -5151,7 +5151,7 @@ WILC_Sint32 host_int_add_tx_gtk(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 u8KeyLen,
 		PRINT_ER("Error in sending message queue: TX GTK\n");
 
 	/* ////////////// */
-	WILC_SemaphoreAcquire(&hSemTestKeyBlock, NULL);
+	down(&hSemTestKeyBlock);
 	WILC_Sleep(100);
 	/* /////// */
 
@@ -5322,7 +5322,7 @@ WILC_Sint32 host_int_get_MacAddress(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *pu8Ma
 		return WILC_FAIL;
 	}
 
-	WILC_SemaphoreAcquire(&hWaitResponse, NULL);
+	down(&hWaitResponse);
 	return s32Error;
 }
 
@@ -5703,7 +5703,7 @@ WILC_Sint32 host_int_disconnect(WILC_WFIDrvHandle hWFIDrv, WILC_Uint16 u16Reason
 	if (s32Error)
 		PRINT_ER("Failed to send message queue: disconnect\n");
 	/* ////////////// */
-	WILC_SemaphoreAcquire(&(pstrWFIDrv->hSemTestDisconnectBlock), NULL);
+	down(&(pstrWFIDrv->hSemTestDisconnectBlock));
 	/* /////// */
 
 	WILC_CATCH(s32Error)
@@ -5922,7 +5922,7 @@ WILC_Sint32 host_int_wait_msg_queue_idle(void)
 	}
 
 	/* wait untill MSG Q is empty */
-	WILC_SemaphoreAcquire(&hWaitResponse, NULL);
+	down(&hWaitResponse);
 
 	return s32Error;
 
@@ -6018,7 +6018,7 @@ WILC_Sint32 host_int_get_host_chnl_num(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *pu
 	s32Error =	WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), WILC_NULL);
 	if (s32Error)
 		PRINT_ER("Failed to send get host channel param's message queue ");
-	WILC_SemaphoreAcquire(&(pstrWFIDrv->hSemGetCHNL), NULL);
+	down(&(pstrWFIDrv->hSemGetCHNL));
 	/* gu8Chnl = 11; */
 
 	*pu8ChNo = gu8Chnl;
@@ -6115,7 +6115,7 @@ WILC_Sint32 host_int_get_inactive_time(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *ma
 	if (s32Error)
 		PRINT_ER("Failed to send get host channel param's message queue ");
 
-	WILC_SemaphoreAcquire(&(pstrWFIDrv->hSemInactiveTime), NULL);
+	down(&(pstrWFIDrv->hSemInactiveTime));
 
 	*pu32InactiveTime = gu32InactiveTime;
 
@@ -6205,7 +6205,7 @@ WILC_Sint32 host_int_get_rssi(WILC_WFIDrvHandle hWFIDrv, WILC_Sint8 *ps8Rssi)
 		return WILC_FAIL;
 	}
 
-	WILC_SemaphoreAcquire(&(pstrWFIDrv->hSemGetRSSI), NULL);
+	down(&(pstrWFIDrv->hSemGetRSSI));
 
 
 	if (ps8Rssi == NULL) {
@@ -6242,7 +6242,7 @@ WILC_Sint32 host_int_get_link_speed(WILC_WFIDrvHandle hWFIDrv, WILC_Sint8 *ps8ln
 		return WILC_FAIL;
 	}
 
-	WILC_SemaphoreAcquire(&(pstrWFIDrv->hSemGetLINKSPEED), NULL);
+	down(&(pstrWFIDrv->hSemGetLINKSPEED));
 
 
 	if (ps8lnkspd == NULL) {
@@ -6276,7 +6276,7 @@ WILC_Sint32 host_int_get_statistics(WILC_WFIDrvHandle hWFIDrv, tstrStatistics *p
 		return WILC_FAIL;
 	}
 
-	WILC_SemaphoreAcquire(&hWaitResponse, NULL);
+	down(&hWaitResponse);
 	return s32Error;
 }
 
@@ -6418,7 +6418,7 @@ WILC_Sint32 hif_get_cfg(WILC_WFIDrvHandle hWFIDrv, WILC_Uint16 u16WID, WILC_Uint
 	WILC_Sint32 s32Error = WILC_SUCCESS;
 	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
 
-	WILC_SemaphoreAcquire(&(pstrWFIDrv->gtOsCfgValuesSem), NULL);
+	down(&(pstrWFIDrv->gtOsCfgValuesSem));
 
 	if (pstrWFIDrv == WILC_NULL) {
 		PRINT_ER("Driver not initialized: pstrWFIDrv = NULL \n");
@@ -6503,7 +6503,7 @@ WILC_Sint32 hif_get_cfg(WILC_WFIDrvHandle hWFIDrv, WILC_Uint16 u16WID, WILC_Uint
 		break;
 	}
 
-	WILC_SemaphoreRelease(&(pstrWFIDrv->gtOsCfgValuesSem), NULL);
+	up(&(pstrWFIDrv->gtOsCfgValuesSem));
 
 	WILC_CATCH(s32Error)
 	{
@@ -6598,8 +6598,6 @@ WILC_Sint32 host_int_init(WILC_WFIDrvHandle *phWFIDrv)
 {
 	WILC_Sint32 s32Error = WILC_SUCCESS;
 	tstrWILC_WFIDrv *pstrWFIDrv;
-	tstrWILC_SemaphoreAttrs strSemaphoreAttrs;
-
 
 	/*if(u32Intialized == 1)
 	 * {
@@ -6611,11 +6609,7 @@ WILC_Sint32 host_int_init(WILC_WFIDrvHandle *phWFIDrv)
 
 	gbScanWhileConnected = WILC_FALSE;
 
-	WILC_SemaphoreFillDefault(&strSemaphoreAttrs);
-
-
-	strSemaphoreAttrs.u32InitCount = 0;
-	WILC_SemaphoreCreate(&hWaitResponse, &strSemaphoreAttrs);
+	sema_init(&hWaitResponse, 0);
 
 
 
@@ -6640,29 +6634,18 @@ WILC_Sint32 host_int_init(WILC_WFIDrvHandle *phWFIDrv)
 	PRINT_D(HOSTINF_DBG, "Global handle pointer value=%x\n", (WILC_Uint32)pstrWFIDrv);
 	/* /////////////////////////////////////// */
 	if (clients_count == 0)	{
-		strSemaphoreAttrs.u32InitCount = 0;
-		WILC_SemaphoreCreate(&hSemHostIFthrdEnd, &strSemaphoreAttrs);
-
-		strSemaphoreAttrs.u32InitCount = 0;
-		WILC_SemaphoreCreate(&hSemDeinitDrvHandle, &strSemaphoreAttrs);
-
+		sema_init(&hSemHostIFthrdEnd, 0);
+		sema_init(&hSemDeinitDrvHandle, 0);
 		/*BugID_5348*/
-		strSemaphoreAttrs.u32InitCount = 1;
-		WILC_SemaphoreCreate(&hSemHostIntDeinit, &strSemaphoreAttrs);
-	}
-
-	strSemaphoreAttrs.u32InitCount = 0;
-	WILC_SemaphoreCreate(&(pstrWFIDrv->hSemTestKeyBlock), &strSemaphoreAttrs);
-	strSemaphoreAttrs.u32InitCount = 0;
-	WILC_SemaphoreCreate(&(pstrWFIDrv->hSemTestDisconnectBlock), &strSemaphoreAttrs);
-	strSemaphoreAttrs.u32InitCount = 0;
-	WILC_SemaphoreCreate(&(pstrWFIDrv->hSemGetRSSI), &strSemaphoreAttrs);
-	strSemaphoreAttrs.u32InitCount = 0;
-	WILC_SemaphoreCreate(&(pstrWFIDrv->hSemGetLINKSPEED), &strSemaphoreAttrs);
-	strSemaphoreAttrs.u32InitCount = 0;
-	WILC_SemaphoreCreate(&(pstrWFIDrv->hSemGetCHNL), &strSemaphoreAttrs);
-	strSemaphoreAttrs.u32InitCount = 0;
-	WILC_SemaphoreCreate(&(pstrWFIDrv->hSemInactiveTime), &strSemaphoreAttrs);
+		sema_init(&hSemHostIntDeinit, 1);
+	}
+
+	sema_init(&(pstrWFIDrv->hSemTestKeyBlock), 0);
+	sema_init(&(pstrWFIDrv->hSemTestDisconnectBlock), 0);
+	sema_init(&(pstrWFIDrv->hSemGetRSSI), 0);
+	sema_init(&(pstrWFIDrv->hSemGetLINKSPEED), 0);
+	sema_init(&(pstrWFIDrv->hSemGetCHNL), 0);
+	sema_init(&(pstrWFIDrv->hSemInactiveTime), 0);
 
 	/* /////////////////////////////////////// */
 
@@ -6718,8 +6701,8 @@ WILC_Sint32 host_int_init(WILC_WFIDrvHandle *phWFIDrv)
 	}
 	#endif
 
-	WILC_SemaphoreCreate(&(pstrWFIDrv->gtOsCfgValuesSem), NULL);
-	WILC_SemaphoreAcquire(&(pstrWFIDrv->gtOsCfgValuesSem), NULL);
+	sema_init(&(pstrWFIDrv->gtOsCfgValuesSem), 1);
+	down(&(pstrWFIDrv->gtOsCfgValuesSem));
 
 
 
@@ -6752,7 +6735,7 @@ WILC_Sint32 host_int_init(WILC_WFIDrvHandle *phWFIDrv)
 		   pstrWFIDrv->strCfgValues.curr_tx_rate);
 
 
-	WILC_SemaphoreRelease(&(pstrWFIDrv->gtOsCfgValuesSem), NULL);
+	up(&(pstrWFIDrv->gtOsCfgValuesSem));
 
 	/*TODO Code to setup simulation to be removed later*/
 	/*Intialize configurator module*/
@@ -6781,7 +6764,7 @@ _fail_timer_3:
 	WILC_TimerDestroy(&(pstrWFIDrv->hRemainOnChannel), WILC_NULL);
 #endif
 _fail_timer_2:
-	WILC_SemaphoreRelease(&(pstrWFIDrv->gtOsCfgValuesSem), NULL);
+	up(&(pstrWFIDrv->gtOsCfgValuesSem));
 	WILC_TimerDestroy(&(pstrWFIDrv->hConnectTimer), WILC_NULL);
 _fail_timer_1:
 	WILC_TimerDestroy(&(pstrWFIDrv->hScanTimer), WILC_NULL);
@@ -6825,7 +6808,7 @@ WILC_Sint32 host_int_deinit(WILC_WFIDrvHandle hWFIDrv)
 		return 0;
 	}
 
-	WILC_SemaphoreAcquire(&hSemHostIntDeinit, NULL);
+	down(&hSemHostIntDeinit);
 
 	terminated_handle = pstrWFIDrv;
 	PRINT_D(HOSTINF_DBG, "De-initializing host interface for client %d\n", clients_count);
@@ -6855,7 +6838,7 @@ WILC_Sint32 host_int_deinit(WILC_WFIDrvHandle hWFIDrv)
 	#endif
 
 	host_int_set_wfi_drv_handler((WILC_Uint32)WILC_NULL);
-	WILC_SemaphoreAcquire(&hSemDeinitDrvHandle, NULL);
+	down(&hSemDeinitDrvHandle);
 
 
 	/*Calling the CFG80211 scan done function with the abort flag set to true*/
@@ -6894,29 +6877,15 @@ WILC_Sint32 host_int_deinit(WILC_WFIDrvHandle hWFIDrv)
 			PRINT_ER("Error in sending deinit's message queue message function: Error(%d)\n", s32Error);
 		}
 
-		WILC_SemaphoreAcquire(&hSemHostIFthrdEnd, NULL);
+		down(&hSemHostIFthrdEnd);
 
 
 
 		WILC_MsgQueueDestroy(&gMsgQHostIF, WILC_NULL);
 		msgQ_created = 0;
-
-
-		WILC_SemaphoreDestroy(&hSemHostIFthrdEnd, NULL);
-		WILC_SemaphoreDestroy(&hSemDeinitDrvHandle, NULL);
-
 	}
 
-	WILC_SemaphoreDestroy(&(pstrWFIDrv->hSemTestKeyBlock), NULL);
-	WILC_SemaphoreDestroy(&(pstrWFIDrv->hSemTestDisconnectBlock), NULL);
-	WILC_SemaphoreDestroy(&(pstrWFIDrv->hSemGetRSSI), NULL);
-	WILC_SemaphoreDestroy(&(pstrWFIDrv->hSemGetLINKSPEED), NULL);
-	WILC_SemaphoreDestroy(&(pstrWFIDrv->hSemGetCHNL), NULL);
-	WILC_SemaphoreDestroy(&(pstrWFIDrv->hSemInactiveTime), NULL);
-	WILC_SemaphoreDestroy(&hWaitResponse, NULL);
-
-	WILC_SemaphoreAcquire(&(pstrWFIDrv->gtOsCfgValuesSem), NULL);
-	WILC_SemaphoreDestroy(&(pstrWFIDrv->gtOsCfgValuesSem), NULL);
+	down(&(pstrWFIDrv->gtOsCfgValuesSem));
 
 	/*Setting the gloabl driver handler with NULL*/
 	u32Intialized = 0;
@@ -6929,7 +6898,7 @@ WILC_Sint32 host_int_deinit(WILC_WFIDrvHandle hWFIDrv)
 
 	clients_count--; /* Decrease number of created entities */
 	terminated_handle = WILC_NULL;
-	WILC_SemaphoreRelease(&hSemHostIntDeinit, NULL);
+	up(&hSemHostIntDeinit);
 	return s32Error;
 }
 
@@ -7003,7 +6972,7 @@ void GnrlAsyncInfoReceived(WILC_Uint8 *pu8Buffer, WILC_Uint32 u32Length)
 	tstrWILC_WFIDrv *pstrWFIDrv = WILC_NULL;
 
 	/*BugID_5348*/
-	WILC_SemaphoreAcquire(&hSemHostIntDeinit, NULL);
+	down(&hSemHostIntDeinit);
 
 	drvHandler = ((pu8Buffer[u32Length - 4]) | (pu8Buffer[u32Length - 3] << 8) | (pu8Buffer[u32Length - 2] << 16) | (pu8Buffer[u32Length - 1] << 24));
 	pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -7013,7 +6982,7 @@ void GnrlAsyncInfoReceived(WILC_Uint8 *pu8Buffer, WILC_Uint32 u32Length)
 	if (pstrWFIDrv == NULL || pstrWFIDrv == terminated_handle) {
 		PRINT_D(HOSTINF_DBG, "Wifi driver handler is equal to NULL\n");
 		/*BugID_5348*/
-		WILC_SemaphoreRelease(&hSemHostIntDeinit, NULL);
+		up(&hSemHostIntDeinit);
 		return;
 	}
 
@@ -7021,7 +6990,7 @@ void GnrlAsyncInfoReceived(WILC_Uint8 *pu8Buffer, WILC_Uint32 u32Length)
 		/* received mac status is not needed when there is no current Connect Request */
 		PRINT_ER("Received mac status is not needed when there is no current Connect Reques\n");
 		/*BugID_5348*/
-		WILC_SemaphoreRelease(&hSemHostIntDeinit, NULL);
+		up(&hSemHostIntDeinit);
 		return;
 	}
 
@@ -7045,7 +7014,7 @@ void GnrlAsyncInfoReceived(WILC_Uint8 *pu8Buffer, WILC_Uint32 u32Length)
 	}
 
 	/*BugID_5348*/
-	WILC_SemaphoreRelease(&hSemHostIntDeinit, NULL);
+	up(&hSemHostIntDeinit);
 	return;
 }
 
@@ -7517,7 +7486,7 @@ WILC_Sint32 host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 pu8Mac
 	{
 
 	}
-	WILC_SemaphoreAcquire(&hWaitResponse, NULL);
+	down(&hWaitResponse);
 
 	return s32Error;
 
@@ -7945,7 +7914,7 @@ WILC_Sint32 host_int_delBASession(WILC_WFIDrvHandle hWFIDrv, char *pBSSID, char
 	}
 
 	/*BugID_5222*/
-	WILC_SemaphoreAcquire(&hWaitResponse, NULL);
+	down(&hWaitResponse);
 
 	return s32Error;
 }
@@ -7980,7 +7949,7 @@ WILC_Sint32 host_int_del_All_Rx_BASession(WILC_WFIDrvHandle hWFIDrv, char *pBSSI
 	}
 
 	/*BugID_5222*/
-	WILC_SemaphoreAcquire(&hWaitResponse, NULL);
+	down(&hWaitResponse);
 
 	return s32Error;
 }
diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h
index f2a348506a8b..9c06db12b7ea 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -422,14 +422,14 @@ typedef struct {
 	WILC_Uint8 au8AssociatedBSSID[ETH_ALEN];
 	tstrCfgParamVal strCfgValues;
 /* semaphores */
-	WILC_SemaphoreHandle gtOsCfgValuesSem;
-	WILC_SemaphoreHandle hSemTestKeyBlock;
-
-	WILC_SemaphoreHandle hSemTestDisconnectBlock;
-	WILC_SemaphoreHandle hSemGetRSSI;
-	WILC_SemaphoreHandle hSemGetLINKSPEED;
-	WILC_SemaphoreHandle hSemGetCHNL;
-	WILC_SemaphoreHandle hSemInactiveTime;
+	struct semaphore gtOsCfgValuesSem;
+	struct semaphore hSemTestKeyBlock;
+
+	struct semaphore hSemTestDisconnectBlock;
+	struct semaphore hSemGetRSSI;
+	struct semaphore hSemGetLINKSPEED;
+	struct semaphore hSemGetCHNL;
+	struct semaphore hSemInactiveTime;
 /* timer handlers */
 	WILC_TimerHandle hScanTimer;
 	WILC_TimerHandle hConnectTimer;
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c
index 1113092398d1..ebbba8b24de0 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -11,21 +11,12 @@
 WILC_ErrNo WILC_MsgQueueCreate(WILC_MsgQueueHandle *pHandle,
 			       tstrWILC_MsgQueueAttrs *pstrAttrs)
 {
-	tstrWILC_SemaphoreAttrs strSemAttrs;
-	WILC_SemaphoreFillDefault(&strSemAttrs);
-	strSemAttrs.u32InitCount = 0;
-
 	spin_lock_init(&pHandle->strCriticalSection);
-	if ((WILC_SemaphoreCreate(&pHandle->hSem, &strSemAttrs) == WILC_SUCCESS)) {
-
-		pHandle->pstrMessageList = NULL;
-		pHandle->u32ReceiversCount = 0;
-		pHandle->bExiting = WILC_FALSE;
-
-		return WILC_SUCCESS;
-	} else {
-		return WILC_FAIL;
-	}
+	sema_init(&pHandle->hSem, 0);
+	pHandle->pstrMessageList = NULL;
+	pHandle->u32ReceiversCount = 0;
+	pHandle->bExiting = WILC_FALSE;
+	return WILC_SUCCESS;
 }
 
 /*!
@@ -42,12 +33,10 @@ WILC_ErrNo WILC_MsgQueueDestroy(WILC_MsgQueueHandle *pHandle,
 
 	/* Release any waiting receiver thread. */
 	while (pHandle->u32ReceiversCount > 0) {
-		WILC_SemaphoreRelease(&(pHandle->hSem), WILC_NULL);
+		up(&(pHandle->hSem));
 		pHandle->u32ReceiversCount--;
 	}
 
-	WILC_SemaphoreDestroy(&pHandle->hSem, WILC_NULL);
-
 	while (pHandle->pstrMessageList != NULL) {
 		Message *pstrMessge = pHandle->pstrMessageList->pstrNext;
 		WILC_FREE(pHandle->pstrMessageList);
@@ -104,7 +93,7 @@ WILC_ErrNo WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
 
 	spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
 
-	WILC_SemaphoreRelease(&pHandle->hSem, WILC_NULL);
+	up(&pHandle->hSem);
 
 	WILC_CATCH(s32RetStatus)
 	{
@@ -136,7 +125,6 @@ WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
 
 	Message *pstrMessage;
 	WILC_ErrNo s32RetStatus = WILC_SUCCESS;
-	tstrWILC_SemaphoreAttrs strSemAttrs;
 	unsigned long flags;
 	if ((pHandle == NULL) || (u32RecvBufferSize == 0)
 	    || (pvRecvBuffer == NULL) || (pu32ReceivedLength == NULL)) {
@@ -151,8 +139,8 @@ WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
 	pHandle->u32ReceiversCount++;
 	spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
 
-	WILC_SemaphoreFillDefault(&strSemAttrs);
-	s32RetStatus = WILC_SemaphoreAcquire(&(pHandle->hSem), &strSemAttrs);
+	down(&(pHandle->hSem));
+
 	if (s32RetStatus == WILC_TIMEOUT) {
 		/* timed out, just exit without consumeing the message */
 		spin_lock_irqsave(&pHandle->strCriticalSection, flags);
@@ -176,7 +164,7 @@ WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
 		/* check buffer size */
 		if (u32RecvBufferSize < pstrMessage->u32Length)	{
 			spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
-			WILC_SemaphoreRelease(&pHandle->hSem, WILC_NULL);
+			up(&pHandle->hSem);
 			WILC_ERRORREPORT(s32RetStatus, WILC_BUFFER_OVERFLOW);
 		}
 
diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h
index 1999970635aa..7375ec44cc42 100644
--- a/drivers/staging/wilc1000/wilc_oswrapper.h
+++ b/drivers/staging/wilc1000/wilc_oswrapper.h
@@ -54,9 +54,6 @@ typedef WILC_Uint16 WILC_WideChar;
 /* Error reporting and handling support */
 #include "wilc_errorsupport.h"
 
-/* Semaphore support */
-#include "wilc_semaphore.h"
-
 /* Sleep support */
 #include "wilc_sleep.h"
 
diff --git a/drivers/staging/wilc1000/wilc_platform.h b/drivers/staging/wilc1000/wilc_platform.h
index 2e0f41735df0..ae42bbcbd5eb 100644
--- a/drivers/staging/wilc1000/wilc_platform.h
+++ b/drivers/staging/wilc1000/wilc_platform.h
@@ -16,8 +16,6 @@
  *      OS specific types
  *******************************************************************/
 
-typedef struct semaphore WILC_SemaphoreHandle;
-
 typedef struct timer_list WILC_TimerHandle;
 
 
@@ -30,7 +28,7 @@ typedef struct __Message_struct {
 } Message;
 
 typedef struct __MessageQueue_struct {
-	WILC_SemaphoreHandle hSem;
+	struct semaphore hSem;
 	spinlock_t strCriticalSection;
 	WILC_Bool bExiting;
 	WILC_Uint32 u32ReceiversCount;
diff --git a/drivers/staging/wilc1000/wilc_semaphore.c b/drivers/staging/wilc1000/wilc_semaphore.c
deleted file mode 100644
index f09a88ca6ae4..000000000000
--- a/drivers/staging/wilc1000/wilc_semaphore.c
+++ /dev/null
@@ -1,56 +0,0 @@
-
-#include "wilc_oswrapper.h"
-
-WILC_ErrNo WILC_SemaphoreCreate(WILC_SemaphoreHandle *pHandle,
-				tstrWILC_SemaphoreAttrs *pstrAttrs)
-{
-	tstrWILC_SemaphoreAttrs strDefaultAttrs;
-	if (pstrAttrs == WILC_NULL) {
-		WILC_SemaphoreFillDefault(&strDefaultAttrs);
-		pstrAttrs = &strDefaultAttrs;
-	}
-
-	sema_init(pHandle, pstrAttrs->u32InitCount);
-	return WILC_SUCCESS;
-
-}
-
-
-WILC_ErrNo WILC_SemaphoreDestroy(WILC_SemaphoreHandle *pHandle,
-				 tstrWILC_SemaphoreAttrs *pstrAttrs)
-{
-	/* nothing to be done ! */
-
-	return WILC_SUCCESS;
-
-}
-
-
-WILC_ErrNo WILC_SemaphoreAcquire(WILC_SemaphoreHandle *pHandle,
-				 tstrWILC_SemaphoreAttrs *pstrAttrs)
-{
-	WILC_ErrNo s32RetStatus = WILC_SUCCESS;
-
-	while (down_interruptible(pHandle))
-		;
-
-	if (s32RetStatus == 0) {
-		return WILC_SUCCESS;
-	} else if (s32RetStatus == -ETIME)   {
-		return WILC_TIMEOUT;
-	} else {
-		return WILC_FAIL;
-	}
-
-	return WILC_SUCCESS;
-
-}
-
-WILC_ErrNo WILC_SemaphoreRelease(WILC_SemaphoreHandle *pHandle,
-				 tstrWILC_SemaphoreAttrs *pstrAttrs)
-{
-
-	up(pHandle);
-	return WILC_SUCCESS;
-
-}
diff --git a/drivers/staging/wilc1000/wilc_semaphore.h b/drivers/staging/wilc1000/wilc_semaphore.h
deleted file mode 100644
index 3c0ecc326fb3..000000000000
--- a/drivers/staging/wilc1000/wilc_semaphore.h
+++ /dev/null
@@ -1,99 +0,0 @@
-#ifndef __WILC_SEMAPHORE_H__
-#define __WILC_SEMAPHORE_H__
-
-/*!
- *  @file		wilc_semaphore.h
- *  @brief		Semaphore OS Wrapper functionality
- *  @author		syounan
- *  @sa			wilc_oswrapper.h top level OS wrapper file
- *  @date		10 Aug 2010
- *  @version		1.0
- */
-
-/*!
- *  @struct             WILC_SemaphoreAttrs
- *  @brief		Semaphore API options
- *  @author		syounan
- *  @date		10 Aug 2010
- *  @version		1.0
- */
-typedef struct {
-	/*!<
-	 * Initial count when the semaphore is created. default is 1
-	 */
-	WILC_Uint32 u32InitCount;
-
-} tstrWILC_SemaphoreAttrs;
-
-
-/*!
- *  @brief	Fills the WILC_SemaphoreAttrs with default parameters
- *  @param[out]	pstrAttrs structure to be filled
- *  @sa		WILC_SemaphoreAttrs
- *  @author	syounan
- *  @date	10 Aug 2010
- *  @version	1.0
- */
-static inline void WILC_SemaphoreFillDefault(tstrWILC_SemaphoreAttrs *pstrAttrs)
-{
-	pstrAttrs->u32InitCount = 1;
-}
-/*!
- *  @brief	Creates a new Semaphore object
- *  @param[out]	pHandle handle to the newly created semaphore
- *  @param[in]	pstrAttrs Optional attributes, NULL for defaults
- *                              pstrAttrs->u32InitCount controls the initial count
- *  @return	Error code indicating success/failure
- *  @sa		WILC_SemaphoreAttrs
- *  @author	syounan
- *  @date	10 Aug 2010
- *  @version	1.0
- */
-WILC_ErrNo WILC_SemaphoreCreate(WILC_SemaphoreHandle *pHandle,
-				tstrWILC_SemaphoreAttrs *pstrAttrs);
-
-/*!
- *  @brief	Destroyes an existing Semaphore, releasing any resources
- *  @param[in]	pHandle handle to the semaphore object
- *  @param[in]	pstrAttrs Optional attributes, NULL for defaults
- *  @return	Error code indicating success/failure
- *  @sa		WILC_SemaphoreAttrs
- *  @todo	need to define behaviour if the semaphore delayed while it is pending
- *  @author	syounan
- *  @date	10 Aug 2010
- *  @version	1.0
- */
-WILC_ErrNo WILC_SemaphoreDestroy(WILC_SemaphoreHandle *pHandle,
-				 tstrWILC_SemaphoreAttrs *pstrAttrs);
-
-/*!
- *  @brief	Acquire the Semaphore object
- *  @details	This function will block until it can Acquire the given
- *		semaphore, if the feature WILC_OS_FEATURE_SEMAPHORE_TIMEOUT is
- *		eanbled a timeout value can be passed in pstrAttrs
- *  @param[in]	pHandle handle to the semaphore object
- *  @param[in]	pstrAttrs Optional attributes, NULL for default
- *  @return	Error code indicating success/failure
- *  @sa		WILC_SemaphoreAttrs
- *  @author	syounan
- *  @date	10 Aug 2010
- *  @version	1.0
- */
-WILC_ErrNo WILC_SemaphoreAcquire(WILC_SemaphoreHandle *pHandle,
-				 tstrWILC_SemaphoreAttrs *pstrAttrs);
-
-/*!
- *  @brief	Release the Semaphore object
- *  @param[in]	pHandle handle to the semaphore object
- *  @param[in]	pstrAttrs Optional attributes, NULL for default
- *  @return	Error code indicating sucess/failure
- *  @sa		WILC_SemaphoreAttrs
- *  @author	syounan
- *  @date	10 Aug 2010
- *  @version	1.0
- */
-WILC_ErrNo WILC_SemaphoreRelease(WILC_SemaphoreHandle *pHandle,
-				 tstrWILC_SemaphoreAttrs *pstrAttrs);
-
-
-#endif
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index c1d511825147..d8ca75cf73f6 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -462,7 +462,7 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, tstrNetworkInfo *pstrNetwo
 				PRINT_D(CFG80211_DBG, "No networks found \n");
 			}
 
-			WILC_SemaphoreAcquire(&(priv->hSemScanReq), NULL);
+			down(&(priv->hSemScanReq));
 
 			if (priv->pstrScanReq != WILC_NULL) {
 				cfg80211_scan_done(priv->pstrScanReq, WILC_FALSE);
@@ -470,12 +470,12 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, tstrNetworkInfo *pstrNetwo
 				priv->bCfgScanning = WILC_FALSE;
 				priv->pstrScanReq = WILC_NULL;
 			}
-			WILC_SemaphoreRelease(&(priv->hSemScanReq), NULL);
+			up(&(priv->hSemScanReq));
 
 		}
 		/*Aborting any scan operation during mac close*/
 		else if (enuScanEvent == SCAN_EVENT_ABORTED) {
-			WILC_SemaphoreAcquire(&(priv->hSemScanReq), NULL);
+			down(&(priv->hSemScanReq));
 
 			PRINT_D(CFG80211_DBG, "Scan Aborted \n");
 			if (priv->pstrScanReq != WILC_NULL) {
@@ -487,7 +487,7 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, tstrNetworkInfo *pstrNetwo
 				priv->bCfgScanning = WILC_FALSE;
 				priv->pstrScanReq = WILC_NULL;
 			}
-			WILC_SemaphoreRelease(&(priv->hSemScanReq), NULL);
+			up(&(priv->hSemScanReq));
 		}
 	}
 
@@ -2839,13 +2839,13 @@ static int WILC_WFI_dump_station(struct wiphy *wiphy, struct net_device *dev,
 		STATION_INFO_RX_BYTES |
 		STATION_INFO_RX_PACKETS | STATION_INFO_SIGNAL | STATION_INFO_INACTIVE_TIME;
 
-	WILC_SemaphoreAcquire(&SemHandleUpdateStats, NULL);
+	down(&SemHandleUpdateStats);
 	sinfo->inactive_time = priv->netstats.rx_time > priv->netstats.tx_time ? jiffies_to_msecs(jiffies - priv->netstats.tx_time) : jiffies_to_msecs(jiffies - priv->netstats.rx_time);
 	sinfo->rx_bytes = priv->netstats.rx_bytes;
 	sinfo->tx_bytes = priv->netstats.tx_bytes;
 	sinfo->rx_packets = priv->netstats.rx_packets;
 	sinfo->tx_packets = priv->netstats.tx_packets;
-	WILC_SemaphoreRelease(&SemHandleUpdateStats, NULL);
+	up(&SemHandleUpdateStats);
 #endif
 	return 0;
 
@@ -3767,7 +3767,7 @@ int WILC_WFI_update_stats(struct wiphy *wiphy, u32 pktlen, u8 changed)
 	struct WILC_WFI_priv *priv;
 
 	priv = wiphy_priv(wiphy);
-	/* WILC_SemaphoreAcquire(&SemHandleUpdateStats,NULL); */
+	/* down(&SemHandleUpdateStats); */
 #if 1
 	switch (changed) {
 
@@ -3792,7 +3792,7 @@ int WILC_WFI_update_stats(struct wiphy *wiphy, u32 pktlen, u8 changed)
 	default:
 		break;
 	}
-	/* WILC_SemaphoreRelease(&SemHandleUpdateStats,NULL); */
+	/* down(&SemHandleUpdateStats); */
 #endif
 	return 0;
 }
@@ -3898,7 +3898,7 @@ struct wireless_dev *WILC_WFI_WiphyRegister(struct net_device *net)
 
 	/*Return hardware description structure (wiphy)'s priv*/
 	priv = wdev_priv(wdev);
-	WILC_SemaphoreCreate(&(priv->SemHandleUpdateStats), NULL);
+	sema_init(&(priv->SemHandleUpdateStats), 1);
 
 	/*Link the wiphy with wireless structure*/
 	priv->wdev = wdev;
@@ -3991,8 +3991,6 @@ int WILC_WFI_InitHostInt(struct net_device *net)
 
 	struct WILC_WFI_priv *priv;
 
-	tstrWILC_SemaphoreAttrs strSemaphoreAttrs;
-
 	PRINT_D(INIT_DBG, "Host[%p][%p]\n", net, net->ieee80211_ptr);
 	priv = wdev_priv(net->ieee80211_ptr);
 	if (op_ifcs == 0) {
@@ -4007,17 +4005,11 @@ int WILC_WFI_InitHostInt(struct net_device *net)
 		return s32Error;
 	}
 
-	WILC_SemaphoreFillDefault(&strSemaphoreAttrs);
-
-	/* /////////////////////////////////////// */
-	/* strSemaphoreAttrs.u32InitCount = 0; */
-
-
 	priv->gbAutoRateAdjusted = WILC_FALSE;
 
 	priv->bInP2PlistenState = WILC_FALSE;
 
-	WILC_SemaphoreCreate(&(priv->hSemScanReq), &strSemaphoreAttrs);
+	sema_init(&(priv->hSemScanReq), 1);
 	s32Error = host_int_init(&priv->hWILCWFIDrv);
 	/* s32Error = host_int_init(&priv->hWILCWFIDrv_2); */
 	if (s32Error) {
@@ -4042,13 +4034,6 @@ int WILC_WFI_DeInitHostInt(struct net_device *net)
 	struct WILC_WFI_priv *priv;
 	priv = wdev_priv(net->ieee80211_ptr);
 
-
-
-
-
-
-	WILC_SemaphoreDestroy(&(priv->hSemScanReq), NULL);
-
 	priv->gbAutoRateAdjusted = WILC_FALSE;
 
 	priv->bInP2PlistenState = WILC_FALSE;
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index 0abe653acc66..0fc383b272aa 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -165,8 +165,8 @@ struct WILC_WFI_priv {
 	struct wilc_wfi_key *wilc_ptk[MAX_NUM_STA];
 	WILC_Uint8 wilc_groupkey;
 	/* semaphores */
-	WILC_SemaphoreHandle SemHandleUpdateStats;
-	WILC_SemaphoreHandle hSemScanReq;
+	struct semaphore SemHandleUpdateStats;
+	struct semaphore hSemScanReq;
 	/*  */
 	WILC_Bool gbAutoRateAdjusted;
 
-- 
2.1.0.rc2


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 15/16] staging: wilc1000: fix const cast warnings
  2015-05-29 20:52 [PATCH 00/16] wilc1000: dead code removal and other cleanup Arnd Bergmann
                   ` (13 preceding siblings ...)
  2015-05-29 20:52 ` [PATCH 14/16] staging: wilc1000: remove semaphore wrapper Arnd Bergmann
@ 2015-05-29 20:52 ` Arnd Bergmann
  2015-05-29 20:52 ` [PATCH 16/16] staging: wilc1000: fix compiler warnings Arnd Bergmann
  15 siblings, 0 replies; 21+ messages in thread
From: Arnd Bergmann @ 2015-05-29 20:52 UTC (permalink / raw)
  To: Greg KH
  Cc: Rachel Kim, Dean Lee, Chris Park, devel, nicolas.ferre,
	Johnny Kim, linux-kernel, Arnd Bergmann

The wilc1000 driver produces a lot of warnings about invalid
casts between const and non-const variables. This reworks
the code to avoid all those warnings, by marking variables
and function arguments const.

A lot of the types use WILC_Uint8, I change them to const u8
for style reasons, as I'm touching them anyway.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/wilc1000/host_interface.c         | 32 ++++++++++++-----------
 drivers/staging/wilc1000/host_interface.h         | 24 ++++++++---------
 drivers/staging/wilc1000/linux_mon.c              |  2 +-
 drivers/staging/wilc1000/wilc_memory.c            |  2 +-
 drivers/staging/wilc1000/wilc_memory.h            |  2 +-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 12 ++++-----
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.h |  2 +-
 7 files changed, 39 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 8f7adc760500..6d9bd4983e90 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -4912,8 +4912,8 @@ WILC_Sint32 host_int_add_wep_key_bss_ap(WILC_WFIDrvHandle hWFIDrv, const WILC_Ui
  *  @date		8 March 2012
  *  @version		1.0
  */
-WILC_Sint32 host_int_add_ptk(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *pu8Ptk, WILC_Uint8 u8PtkKeylen,
-			     const WILC_Uint8 *mac_addr, WILC_Uint8 *pu8RxMic, WILC_Uint8 *pu8TxMic, WILC_Uint8 mode, WILC_Uint8 u8Ciphermode, WILC_Uint8 u8Idx)
+WILC_Sint32 host_int_add_ptk(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8Ptk, WILC_Uint8 u8PtkKeylen,
+			     const u8 *mac_addr, const u8 *pu8RxMic, const u8 *pu8TxMic, WILC_Uint8 mode, WILC_Uint8 u8Ciphermode, WILC_Uint8 u8Idx)
 {
 	WILC_Sint32 s32Error = WILC_SUCCESS;
 	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -5014,9 +5014,9 @@ WILC_Sint32 host_int_add_ptk(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *pu8Ptk, WILC
  *  @date		8 March 2012
  *  @version		1.0
  */
-WILC_Sint32 host_int_add_rx_gtk(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *pu8RxGtk, WILC_Uint8 u8GtkKeylen,
-				WILC_Uint8 u8KeyIdx, WILC_Uint32 u32KeyRSClen, WILC_Uint8 *KeyRSC,
-				WILC_Uint8 *pu8RxMic, WILC_Uint8 *pu8TxMic, WILC_Uint8 mode, WILC_Uint8 u8Ciphermode)
+WILC_Sint32 host_int_add_rx_gtk(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8RxGtk, WILC_Uint8 u8GtkKeylen,
+				WILC_Uint8 u8KeyIdx, WILC_Uint32 u32KeyRSClen, const u8 *KeyRSC,
+				const u8 *pu8RxMic, const u8 *pu8TxMic, WILC_Uint8 mode, WILC_Uint8 u8Ciphermode)
 {
 	WILC_Sint32 s32Error = WILC_SUCCESS;
 	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -5531,7 +5531,7 @@ WILC_Sint32 host_int_get_start_scan_req(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *p
  *  @version		1.0
  */
 WILC_Sint32 host_int_set_join_req(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *pu8bssid,
-				  WILC_Uint8 *pu8ssid, size_t ssidLen,
+				  const u8 *pu8ssid, size_t ssidLen,
 				  const WILC_Uint8 *pu8IEs, size_t IEsLen,
 				  tWILCpfConnectResult pfConnectResult, void *pvUserArg,
 				  WILC_Uint8 u8security, AUTHTYPE_T tenuAuth_type,
@@ -6090,7 +6090,7 @@ WILC_Sint32 host_int_test_set_int_wid(WILC_WFIDrvHandle hWFIDrv, WILC_Uint32 u32
  *  @date
  *  @version		1.0
  */
-WILC_Sint32 host_int_get_inactive_time(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *mac, WILC_Uint32 *pu32InactiveTime)
+WILC_Sint32 host_int_get_inactive_time(WILC_WFIDrvHandle hWFIDrv, const u8 *mac, WILC_Uint32 *pu32InactiveTime)
 {
 	WILC_Sint32 s32Error = WILC_SUCCESS;
 	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -7364,10 +7364,11 @@ WILC_Sint32 host_int_add_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam
 
 	WILC_memcpy(pstrAddStationMsg, pstrStaParams, sizeof(tstrWILC_AddStaParam));
 	if (pstrAddStationMsg->u8NumRates > 0) {
-		pstrAddStationMsg->pu8Rates = WILC_MALLOC(pstrAddStationMsg->u8NumRates);
-		WILC_NULLCHECK(s32Error, pstrAddStationMsg->pu8Rates);
+		u8 *rates = WILC_MALLOC(pstrAddStationMsg->u8NumRates);
+		WILC_NULLCHECK(s32Error, rates);
 
-		WILC_memcpy(pstrAddStationMsg->pu8Rates, pstrStaParams->pu8Rates, pstrAddStationMsg->u8NumRates);
+		WILC_memcpy(rates, pstrStaParams->pu8Rates, pstrAddStationMsg->u8NumRates);
+		pstrAddStationMsg->pu8Rates = rates;
 	}
 
 
@@ -7391,7 +7392,7 @@ WILC_Sint32 host_int_add_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam
  *  @date
  *  @version	1.0
  */
-WILC_Sint32 host_int_del_station(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *pu8MacAddr)
+WILC_Sint32 host_int_del_station(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8MacAddr)
 {
 	WILC_Sint32 s32Error = WILC_SUCCESS;
 	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -7437,7 +7438,7 @@ WILC_Sint32 host_int_del_station(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *pu8MacAd
  *  @date
  *  @version	1.0
  */
-WILC_Sint32 host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 pu8MacAddr[][ETH_ALEN])
+WILC_Sint32 host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv, u8 pu8MacAddr[][ETH_ALEN])
 {
 	WILC_Sint32 s32Error = WILC_SUCCESS;
 	tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -7523,9 +7524,10 @@ WILC_Sint32 host_int_edit_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaPara
 
 	WILC_memcpy(pstrAddStationMsg, pstrStaParams, sizeof(tstrWILC_AddStaParam));
 	if (pstrAddStationMsg->u8NumRates > 0) {
-		pstrAddStationMsg->pu8Rates = WILC_MALLOC(pstrAddStationMsg->u8NumRates);
-		WILC_memcpy(pstrAddStationMsg->pu8Rates, pstrStaParams->pu8Rates, pstrAddStationMsg->u8NumRates);
-		WILC_NULLCHECK(s32Error, pstrAddStationMsg->pu8Rates);
+		u8 *rates = WILC_MALLOC(pstrAddStationMsg->u8NumRates);
+		WILC_NULLCHECK(s32Error, rates);
+		WILC_memcpy(rates, pstrStaParams->pu8Rates, pstrAddStationMsg->u8NumRates);
+		pstrAddStationMsg->pu8Rates = rates;
 	}
 
 	s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), WILC_NULL);
diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h
index 9c06db12b7ea..5c17076d10f6 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -464,7 +464,7 @@ typedef struct {
 	WILC_Uint8 au8BSSID[ETH_ALEN];
 	WILC_Uint16 u16AssocID;
 	WILC_Uint8 u8NumRates;
-	WILC_Uint8 *pu8Rates;
+	const u8 *pu8Rates;
 	WILC_Bool bIsHTSupported;
 	WILC_Uint16 u16HTCapInfo;
 	WILC_Uint8 u8AmpduParams;
@@ -578,8 +578,8 @@ WILC_Sint32 host_int_add_wep_key_bss_ap(WILC_WFIDrvHandle hWFIDrv, const WILC_Ui
  *  @date		8 March 2012
  *  @version		1.0
  */
-WILC_Sint32 host_int_add_ptk(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *pu8Ptk, WILC_Uint8 u8PtkKeylen,
-			     const WILC_Uint8 *mac_addr, WILC_Uint8 *pu8RxMic, WILC_Uint8 *pu8TxMic, WILC_Uint8 mode, WILC_Uint8 u8Ciphermode, WILC_Uint8 u8Idx);
+WILC_Sint32 host_int_add_ptk(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8Ptk, WILC_Uint8 u8PtkKeylen,
+			     const u8 *mac_addr, const u8 *pu8RxMic, const u8 *pu8TxMic, WILC_Uint8 mode, WILC_Uint8 u8Ciphermode, WILC_Uint8 u8Idx);
 
 /**
  *  @brief              host_int_get_inactive_time
@@ -593,7 +593,7 @@ WILC_Sint32 host_int_add_ptk(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *pu8Ptk, WILC
  *  @date		15 April 2013
  *  @version		1.0
  */
-WILC_Sint32 host_int_get_inactive_time(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *mac, WILC_Uint32 *pu32InactiveTime);
+WILC_Sint32 host_int_get_inactive_time(WILC_WFIDrvHandle hWFIDrv, const u8 *mac, WILC_Uint32 *pu32InactiveTime);
 
 /**
  *  @brief              adds Rx GTk Key
@@ -611,9 +611,9 @@ WILC_Sint32 host_int_get_inactive_time(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *ma
  *  @date		8 March 2012
  *  @version		1.0
  */
-WILC_Sint32 host_int_add_rx_gtk(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *pu8RxGtk, WILC_Uint8 u8GtkKeylen,
-				WILC_Uint8 u8KeyIdx, WILC_Uint32 u32KeyRSClen, WILC_Uint8 *KeyRSC,
-				WILC_Uint8 *pu8RxMic, WILC_Uint8 *pu8TxMic, WILC_Uint8 mode, WILC_Uint8 u8Ciphermode);
+WILC_Sint32 host_int_add_rx_gtk(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8RxGtk, WILC_Uint8 u8GtkKeylen,
+				WILC_Uint8 u8KeyIdx, WILC_Uint32 u32KeyRSClen, const u8 *KeyRSC,
+				const u8 *pu8RxMic, const u8 *pu8TxMic, WILC_Uint8 mode, WILC_Uint8 u8Ciphermode);
 
 
 /**
@@ -836,7 +836,7 @@ WILC_Sint32 host_int_get_start_scan_req(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *p
  */
 
 WILC_Sint32 host_int_set_join_req(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *pu8bssid,
-				  WILC_Uint8 *pu8ssid, size_t ssidLen,
+				  const u8 *pu8ssid, size_t ssidLen,
 				  const WILC_Uint8 *pu8IEs, size_t IEsLen,
 				  tWILCpfConnectResult pfConnectResult, void *pvUserArg,
 				  WILC_Uint8 u8security, AUTHTYPE_T tenuAuth_type,
@@ -1157,7 +1157,7 @@ WILC_Sint32 host_int_del_beacon(WILC_WFIDrvHandle hWFIDrv);
 WILC_Sint32 host_int_add_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam *pstrStaParams);
 
 /*!
- *  @fn		WILC_Sint32 host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8* pu8MacAddr)
+ *  @fn		WILC_Sint32 host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv, const u8* pu8MacAddr)
  *  @brief		Deauthenticates clients when group is terminating
  *  @details
  *  @param[in,out]	hWFIDrv		handle to the wifi driver
@@ -1169,10 +1169,10 @@ WILC_Sint32 host_int_add_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam
  *  @date		09 April 2014
  *  @version		1.0 Description
  */
-WILC_Sint32 host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 pu8MacAddr[][ETH_ALEN]);
+WILC_Sint32 host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv, u8 pu8MacAddr[][ETH_ALEN]);
 
 /*!
- *  @fn		WILC_Sint32 host_int_del_station(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8* pu8MacAddr)
+ *  @fn		WILC_Sint32 host_int_del_station(WILC_WFIDrvHandle hWFIDrv, u8* pu8MacAddr)
  *  @brief		Notifies the firmware with a new deleted station
  *  @details
  *  @param[in,out]	hWFIDrv		handle to the wifi driver
@@ -1184,7 +1184,7 @@ WILC_Sint32 host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 pu8Mac
  *  @date		15 July 2012
  *  @version		1.0 Description
  */
-WILC_Sint32 host_int_del_station(WILC_WFIDrvHandle hWFIDrv, WILC_Uint8 *pu8MacAddr);
+WILC_Sint32 host_int_del_station(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8MacAddr);
 
 /*!
  *  @fn		WILC_Sint32 host_int_edit_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam strStaParams)
diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c
index a19be45b5897..f0a20a98774d 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -522,7 +522,7 @@ static void WILC_WFI_mon_setup(struct net_device *dev)
  *  @date	12 JUL 2012
  *  @version	1.0
  */
-struct net_device *WILC_WFI_init_mon_interface(char *name, struct net_device *real_dev)
+struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_device *real_dev)
 {
 
 
diff --git a/drivers/staging/wilc1000/wilc_memory.c b/drivers/staging/wilc1000/wilc_memory.c
index fbba38da19bc..f5f4b7acc993 100644
--- a/drivers/staging/wilc1000/wilc_memory.c
+++ b/drivers/staging/wilc1000/wilc_memory.c
@@ -51,7 +51,7 @@ void *WILC_MemoryRealloc(void *pvOldBlock, WILC_Uint32 u32NewSize,
  *  @date	18 Aug 2010
  *  @version	1.0
  */
-void WILC_MemoryFree(void *pvBlock, tstrWILC_MemoryAttrs *strAttrs,
+void WILC_MemoryFree(const void *pvBlock, tstrWILC_MemoryAttrs *strAttrs,
 		     WILC_Char *pcFileName, WILC_Uint32 u32LineNo)
 {
 	kfree(pvBlock);
diff --git a/drivers/staging/wilc1000/wilc_memory.h b/drivers/staging/wilc1000/wilc_memory.h
index 012f03cae0c8..4038e1f3e30b 100644
--- a/drivers/staging/wilc1000/wilc_memory.h
+++ b/drivers/staging/wilc1000/wilc_memory.h
@@ -113,7 +113,7 @@ void *WILC_MemoryRealloc(void *pvOldBlock, WILC_Uint32 u32NewSize,
  *  @date	16 Aug 2010
  *  @version	1.0
  */
-void WILC_MemoryFree(void *pvBlock, tstrWILC_MemoryAttrs *strAttrs,
+void WILC_MemoryFree(const void *pvBlock, tstrWILC_MemoryAttrs *strAttrs,
 			WILC_Char *pcFileName, WILC_Uint32 u32LineNo);
 
 /*!
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index d8ca75cf73f6..e9ab2cb35381 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1159,8 +1159,8 @@ static int WILC_WFI_add_key(struct wiphy *wiphy, struct net_device *netdev, u8 k
 	WILC_Sint32 s32Error = WILC_SUCCESS, KeyLen = params->key_len;
 	WILC_Uint32 i;
 	struct WILC_WFI_priv *priv;
-	WILC_Uint8 *pu8RxMic = NULL;
-	WILC_Uint8 *pu8TxMic = NULL;
+	const u8 *pu8RxMic = NULL;
+	const u8 *pu8TxMic = NULL;
 	WILC_Uint8 u8mode = NO_ENCRYPT;
 	#ifdef WILC_AP_EXTERNAL_MLME
 	WILC_Uint8 u8gmode = NO_ENCRYPT;
@@ -1662,7 +1662,7 @@ static int WILC_WFI_dump_survey(struct wiphy *wiphy, struct net_device *netdev,
 
 extern uint32_t Statisitcs_totalAcks, Statisitcs_DroppedAcks;
 static int WILC_WFI_get_station(struct wiphy *wiphy, struct net_device *dev,
-				u8 *mac, struct station_info *sinfo)
+				const u8 *mac, struct station_info *sinfo)
 {
 	WILC_Sint32 s32Error = WILC_SUCCESS;
 	struct WILC_WFI_priv *priv;
@@ -3431,7 +3431,7 @@ static int  WILC_WFI_stop_ap(struct wiphy *wiphy, struct net_device *dev)
  *  @version	1.0
  */
 static int  WILC_WFI_add_station(struct wiphy *wiphy, struct net_device *dev,
-				 u8 *mac, struct station_parameters *params)
+				 const u8 *mac, struct station_parameters *params)
 {
 	WILC_Sint32 s32Error = WILC_SUCCESS;
 	struct WILC_WFI_priv *priv;
@@ -3518,7 +3518,7 @@ static int  WILC_WFI_add_station(struct wiphy *wiphy, struct net_device *dev,
 static int WILC_WFI_del_station(struct wiphy *wiphy, struct net_device *dev,
 				struct station_del_parameters *params)
 {
-	u8 *mac = params->mac;
+	const u8 *mac = params->mac;
 	WILC_Sint32 s32Error = WILC_SUCCESS;
 	struct WILC_WFI_priv *priv;
 	perInterface_wlan_t *nic;
@@ -3564,7 +3564,7 @@ static int WILC_WFI_del_station(struct wiphy *wiphy, struct net_device *dev,
  *  @version	1.0
  */
 static int WILC_WFI_change_station(struct wiphy *wiphy, struct net_device *dev,
-				   u8 *mac, struct station_parameters *params)
+				   const u8 *mac, struct station_parameters *params)
 {
 	WILC_Sint32 s32Error = WILC_SUCCESS;
 	struct WILC_WFI_priv *priv;
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
index 508db6a3f6dd..256da8078e68 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
@@ -118,7 +118,7 @@ int WILC_WFI_DeInitHostInt(struct net_device *net);
 int WILC_WFI_InitHostInt(struct net_device *net);
 void WILC_WFI_monitor_rx(uint8_t *buff, uint32_t size);
 int WILC_WFI_deinit_mon_interface(void);
-struct net_device *WILC_WFI_init_mon_interface(char *name, struct net_device *real_dev);
+struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_device *real_dev);
 
 #ifdef TCP_ENHANCEMENTS
 #define TCP_ACK_FILTER_LINK_SPEED_THRESH 54
-- 
2.1.0.rc2


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 16/16] staging: wilc1000: fix compiler warnings
  2015-05-29 20:52 [PATCH 00/16] wilc1000: dead code removal and other cleanup Arnd Bergmann
                   ` (14 preceding siblings ...)
  2015-05-29 20:52 ` [PATCH 15/16] staging: wilc1000: fix const cast warnings Arnd Bergmann
@ 2015-05-29 20:52 ` Arnd Bergmann
  15 siblings, 0 replies; 21+ messages in thread
From: Arnd Bergmann @ 2015-05-29 20:52 UTC (permalink / raw)
  To: Greg KH
  Cc: Rachel Kim, Dean Lee, Chris Park, devel, nicolas.ferre,
	Johnny Kim, linux-kernel, Arnd Bergmann

This avoids the remaining warnings that one gets on a normal
build: unused variables, unused labels, and invalid printk
format strings.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/staging/wilc1000/linux_wlan.c     | 8 ++++++--
 drivers/staging/wilc1000/linux_wlan_spi.c | 3 ---
 drivers/staging/wilc1000/wilc_spi.c       | 4 ++--
 drivers/staging/wilc1000/wilc_wlan.c      | 6 ++----
 4 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 2a74441af09e..46c7e4f3471d 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1025,7 +1025,6 @@ int repeat_power_cycle(perInterface_wlan_t *nic);
 static int linux_wlan_start_firmware(perInterface_wlan_t *nic)
 {
 
-	static int timeout = 5;
 	int ret = 0;
 	/* start firmware */
 	PRINT_D(INIT_DBG, "Starting Firmware ...\n");
@@ -1040,6 +1039,7 @@ static int linux_wlan_start_firmware(perInterface_wlan_t *nic)
 	ret = linux_wlan_lock_timeout(&g_linux_wlan->sync_event, 5000);
 	if (ret) {
 #ifdef COMPLEMENT_BOOT
+		static int timeout = 5;
 
 		if (timeout--) {
 			PRINT_D(INIT_DBG, "repeat power cycle[%d]", timeout);
@@ -1675,7 +1675,9 @@ _fail_2:
 	linux_wlan_unlock(&g_linux_wlan->rxq_event);
 	kthread_stop(g_linux_wlan->rxq_thread);
 
+#ifndef TCP_ENHANCEMENTS
 _fail_1:
+#endif
 	#if (RX_BH_TYPE == RX_BH_KTHREAD)
 	/*De-Initialize 1st thread*/
 	g_linux_wlan->close = 1;
@@ -1999,8 +2001,8 @@ _fail_fw_start_:
 _fail_irq_enable_:
 #if (defined WILC_SDIO) && (!defined WILC_SDIO_IRQ_GPIO)
 		disable_sdio_interrupt();
-#endif
 _fail_irq_init_:
+#endif
 #if (!defined WILC_SDIO) || (defined WILC_SDIO_IRQ_GPIO)
 		deinit_irq(g_linux_wlan);
 
@@ -2522,8 +2524,10 @@ void frmw_to_linux(uint8_t *buff, uint32_t size, uint32_t pkt_offset)
 	int stats;
 	unsigned char *buff_to_send = NULL;
 	struct sk_buff *skb;
+#ifndef TCP_ENHANCEMENTS
 	char *pu8UdpBuffer;
 	struct iphdr *ih;
+#endif
 	struct net_device *wilc_netdev;
 	perInterface_wlan_t *nic;
 
diff --git a/drivers/staging/wilc1000/linux_wlan_spi.c b/drivers/staging/wilc1000/linux_wlan_spi.c
index 0c30bbb5fa65..e5d794590f00 100644
--- a/drivers/staging/wilc1000/linux_wlan_spi.c
+++ b/drivers/staging/wilc1000/linux_wlan_spi.c
@@ -102,9 +102,6 @@ int linux_spi_init(void *vp)
 
 	if (called == 0) {
 		called++;
-		if (&wilc_bus == NULL) {
-			PRINT_ER("wilc_bus address is NULL\n");
-		}
 		ret = spi_register_driver(&wilc_bus);
 	}
 
diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c
index 2f38ddabc654..d0e761080ca5 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -1194,10 +1194,10 @@ static int spi_init(wilc_wlan_inp_t *inp, wilc_debug_func func)
 		/* Read failed. Try with CRC off. This might happen when module
 		 * is removed but chip isn't reset*/
 		g_spi.crc_off = 1;
-		PRINT_ER("[wilc spi]: Failed internal read protocol with CRC on, retyring with CRC off...\n", __LINE__);
+		PRINT_ER("[wilc spi]: Failed internal read protocol with CRC on, retyring with CRC off...\n");
 		if (!spi_internal_read(WILC_SPI_PROTOCOL_OFFSET, &reg)) {
 			/* Reaad failed with both CRC on and off, something went bad */
-			PRINT_ER("[wilc spi]: Failed internal read protocol...\n", __LINE__);
+			PRINT_ER("[wilc spi]: Failed internal read protocol...\n");
 			return 0;
 		}
 	}
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 92ed42ad49ac..badc8743dd1a 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -894,8 +894,6 @@ INLINE void chip_wakeup(void)
 #endif
 void chip_sleep_manually(WILC_Uint32 u32SleepTime)
 {
-	uint32_t val32;
-
 	if (genuChipPSstate != CHIP_WAKEDUP) {
 		/* chip is already sleeping. Do nothing */
 		return;
@@ -2302,7 +2300,7 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t *oup)
 #else
 		g_wlan.tx_buffer = (uint8_t *)g_wlan.os_func.os_malloc(g_wlan.tx_buffer_size);
 #endif
-	PRINT_D(TX_DBG, "g_wlan.tx_buffer = 0x%x\n", g_wlan.tx_buffer);
+	PRINT_D(TX_DBG, "g_wlan.tx_buffer = %p\n", g_wlan.tx_buffer);
 
 	if (g_wlan.tx_buffer == WILC_NULL) {
 		/* ENOBUFS	105 */
@@ -2319,7 +2317,7 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t *oup)
   #else
 		g_wlan.rx_buffer = (uint8_t *)g_wlan.os_func.os_malloc(g_wlan.rx_buffer_size);
   #endif
-	PRINT_D(TX_DBG, "g_wlan.rx_buffer =0x%x\n", g_wlan.rx_buffer);
+	PRINT_D(TX_DBG, "g_wlan.rx_buffer =%p\n", g_wlan.rx_buffer);
 	if (g_wlan.rx_buffer == WILC_NULL) {
 		/* ENOBUFS	105 */
 		ret = -105;
-- 
2.1.0.rc2


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH 05/16] staging: wilc1000: remove time wrapper
  2015-05-29 20:52 ` [PATCH 05/16] staging: wilc1000: remove time wrapper Arnd Bergmann
@ 2015-05-30  6:39   ` Sudip Mukherjee
  2015-05-30 23:58     ` Greg KH
  0 siblings, 1 reply; 21+ messages in thread
From: Sudip Mukherjee @ 2015-05-30  6:39 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Greg KH, Rachel Kim, Dean Lee, Chris Park, devel, nicolas.ferre,
	Johnny Kim, linux-kernel

On Fri, May 29, 2015 at 10:52:16PM +0200, Arnd Bergmann wrote:
> The abstraction for time in this driver is completely
> unused, so remove it.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/staging/wilc1000/wilc_osconfig.h  |   1 -
>  drivers/staging/wilc1000/wilc_oswrapper.h |   5 -
>  drivers/staging/wilc1000/wilc_platform.h  |  12 --
>  drivers/staging/wilc1000/wilc_time.c      | 163 ------------------------
>  drivers/staging/wilc1000/wilc_time.h      | 205 ------------------------------
>  5 files changed, 386 deletions(-)
>  delete mode 100644 drivers/staging/wilc1000/wilc_time.c
>  delete mode 100644 drivers/staging/wilc1000/wilc_time.h
after this patch I am getting:
"WARNING: could not open drivers/staging/wilc1000/wilc_time.c: No such file or directory"

wilc_time is mentioned in the Makefile, it should have been removed from
there also.

regards
sudip

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 14/16] staging: wilc1000: remove semaphore wrapper
  2015-05-29 20:52 ` [PATCH 14/16] staging: wilc1000: remove semaphore wrapper Arnd Bergmann
@ 2015-05-30  6:46   ` Sudip Mukherjee
  0 siblings, 0 replies; 21+ messages in thread
From: Sudip Mukherjee @ 2015-05-30  6:46 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Greg KH, Rachel Kim, Dean Lee, Chris Park, devel, nicolas.ferre,
	Johnny Kim, linux-kernel

On Fri, May 29, 2015 at 10:52:25PM +0200, Arnd Bergmann wrote:
> The various semaphore functions all directly translate into
> sema_init(), down() and up(), so we can just remove the API.
> 
> This is a mostly automated conversion using simple sed scripts,
> plus some manual changes to account for down() returning no
> error.
> 
> As a positive side-effect, down() no longer hangs after
> receiving a signal, as the original code did by looping around
> down_interruptible.
> 
> The semaphores still need to be turned into mutexes as a
> follow-up step.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/staging/wilc1000/coreconfigurator.c       |  29 +---
>  drivers/staging/wilc1000/fifo_buffer.c            | 108 +++++++-------
>  drivers/staging/wilc1000/fifo_buffer.h            |   2 +-
>  drivers/staging/wilc1000/host_interface.c         | 171 +++++++++-------------
>  drivers/staging/wilc1000/host_interface.h         |  16 +-
>  drivers/staging/wilc1000/wilc_msgqueue.c          |  32 ++--
>  drivers/staging/wilc1000/wilc_oswrapper.h         |   3 -
>  drivers/staging/wilc1000/wilc_platform.h          |   4 +-
>  drivers/staging/wilc1000/wilc_semaphore.c         |  56 -------
>  drivers/staging/wilc1000/wilc_semaphore.h         |  99 -------------
>  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  35 ++---
>  drivers/staging/wilc1000/wilc_wfi_netdevice.h     |   4 +-
>  12 files changed, 160 insertions(+), 399 deletions(-)
>  delete mode 100644 drivers/staging/wilc1000/wilc_semaphore.c
>  delete mode 100644 drivers/staging/wilc1000/wilc_semaphore.h
wilc_semaphore still remains in the Makefile.

regards
sudip

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 05/16] staging: wilc1000: remove time wrapper
  2015-05-30  6:39   ` Sudip Mukherjee
@ 2015-05-30 23:58     ` Greg KH
  2015-06-01 19:09       ` Arnd Bergmann
  0 siblings, 1 reply; 21+ messages in thread
From: Greg KH @ 2015-05-30 23:58 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: Arnd Bergmann, Rachel Kim, Dean Lee, Chris Park, devel,
	nicolas.ferre, Johnny Kim, linux-kernel

On Sat, May 30, 2015 at 12:09:23PM +0530, Sudip Mukherjee wrote:
> On Fri, May 29, 2015 at 10:52:16PM +0200, Arnd Bergmann wrote:
> > The abstraction for time in this driver is completely
> > unused, so remove it.
> > 
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> >  drivers/staging/wilc1000/wilc_osconfig.h  |   1 -
> >  drivers/staging/wilc1000/wilc_oswrapper.h |   5 -
> >  drivers/staging/wilc1000/wilc_platform.h  |  12 --
> >  drivers/staging/wilc1000/wilc_time.c      | 163 ------------------------
> >  drivers/staging/wilc1000/wilc_time.h      | 205 ------------------------------
> >  5 files changed, 386 deletions(-)
> >  delete mode 100644 drivers/staging/wilc1000/wilc_time.c
> >  delete mode 100644 drivers/staging/wilc1000/wilc_time.h
> after this patch I am getting:
> "WARNING: could not open drivers/staging/wilc1000/wilc_time.c: No such file or directory"
> 
> wilc_time is mentioned in the Makefile, it should have been removed from
> there also.

Ick, not good.

Arnd, I've applied the first 4 patches, but stopped here, can you respin
the rest and resend?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 05/16] staging: wilc1000: remove time wrapper
  2015-05-30 23:58     ` Greg KH
@ 2015-06-01 19:09       ` Arnd Bergmann
  0 siblings, 0 replies; 21+ messages in thread
From: Arnd Bergmann @ 2015-06-01 19:09 UTC (permalink / raw)
  To: Greg KH
  Cc: Sudip Mukherjee, Rachel Kim, Dean Lee, Chris Park, devel,
	nicolas.ferre, Johnny Kim, linux-kernel

On Sunday 31 May 2015 08:58:13 Greg KH wrote:
> On Sat, May 30, 2015 at 12:09:23PM +0530, Sudip Mukherjee wrote:
> > On Fri, May 29, 2015 at 10:52:16PM +0200, Arnd Bergmann wrote:
> > > The abstraction for time in this driver is completely
> > > unused, so remove it.
> > > 
> > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > > ---
> > >  drivers/staging/wilc1000/wilc_osconfig.h  |   1 -
> > >  drivers/staging/wilc1000/wilc_oswrapper.h |   5 -
> > >  drivers/staging/wilc1000/wilc_platform.h  |  12 --
> > >  drivers/staging/wilc1000/wilc_time.c      | 163 ------------------------
> > >  drivers/staging/wilc1000/wilc_time.h      | 205 ------------------------------
> > >  5 files changed, 386 deletions(-)
> > >  delete mode 100644 drivers/staging/wilc1000/wilc_time.c
> > >  delete mode 100644 drivers/staging/wilc1000/wilc_time.h
> > after this patch I am getting:
> > "WARNING: could not open drivers/staging/wilc1000/wilc_time.c: No such file or directory"
> > 
> > wilc_time is mentioned in the Makefile, it should have been removed from
> > there also.
> 
> Ick, not good.

Sorry about that. I had actually made the same mistake before and fixed it up,
but the introduced the bug again and didn't find it during my build testing
because 'make' kept picking up the old object files.

> Arnd, I've applied the first 4 patches, but stopped here, can you respin
> the rest and resend?

Done.

	Arnd

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2015-06-01 19:10 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-29 20:52 [PATCH 00/16] wilc1000: dead code removal and other cleanup Arnd Bergmann
2015-05-29 20:52 ` [PATCH 01/16] staging: wilc1000: remove linux version checks Arnd Bergmann
2015-05-29 20:52 ` [PATCH 02/16] staging: wilc1000: remove platform " Arnd Bergmann
2015-05-29 20:52 ` [PATCH 03/16] staging: wilc1000: remove thread wrapper Arnd Bergmann
2015-05-29 20:52 ` [PATCH 04/16] staging: wilc1000: remove __DRIVER_VERSION__ macro Arnd Bergmann
2015-05-29 20:52 ` [PATCH 05/16] staging: wilc1000: remove time wrapper Arnd Bergmann
2015-05-30  6:39   ` Sudip Mukherjee
2015-05-30 23:58     ` Greg KH
2015-06-01 19:09       ` Arnd Bergmann
2015-05-29 20:52 ` [PATCH 06/16] staging: wilc1000: remove unused string functions Arnd Bergmann
2015-05-29 20:52 ` [PATCH 07/16] staging: wilc1000: simplify msgqueue code Arnd Bergmann
2015-05-29 20:52 ` [PATCH 08/16] staging: wilc1000: remove unused memory handling code Arnd Bergmann
2015-05-29 20:52 ` [PATCH 09/16] staging: wilc1000: simplify semaphore wrapper Arnd Bergmann
2015-05-29 20:52 ` [PATCH 10/16] staging: wilc1000: clean up sleep wrapper Arnd Bergmann
2015-05-29 20:52 ` [PATCH 11/16] staging: wilc1000: clean up timer feature Arnd Bergmann
2015-05-29 20:52 ` [PATCH 12/16] staging: wilc1000: remove unused OS abstraction features Arnd Bergmann
2015-05-29 20:52 ` [PATCH 13/16] staging: wilc1000: remove EXPORT_SYMTAB Arnd Bergmann
2015-05-29 20:52 ` [PATCH 14/16] staging: wilc1000: remove semaphore wrapper Arnd Bergmann
2015-05-30  6:46   ` Sudip Mukherjee
2015-05-29 20:52 ` [PATCH 15/16] staging: wilc1000: fix const cast warnings Arnd Bergmann
2015-05-29 20:52 ` [PATCH 16/16] staging: wilc1000: fix compiler warnings Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).