[PATCH v2 1/6] staging: wilc1000: remove a macro WILC_NULLCHECK

2015-09-16 Thread Tony Cho
From: Leo Kim 

This patch replaces WILC_NULLCHECK with the plain statements and then removes
the macro WILC_NULLCHECK in wilc_errorsupport.h which is not used anymore.

Signed-off-by: Leo Kim 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/host_interface.c |  7 +--
 drivers/staging/wilc1000/wilc_errorsupport.h  |  6 --
 drivers/staging/wilc1000/wilc_msgqueue.c  |  9 +++--
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 24 ++-
 4 files changed, 27 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 563063c..827758d 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -7289,7 +7289,8 @@ s32 host_int_add_station(tstrWILC_WFIDrv *hWFIDrv, 
tstrWILC_AddStaParam *pstrSta
if (pstrAddStationMsg->u8NumRates > 0) {
u8 *rates = kmalloc(pstrAddStationMsg->u8NumRates, GFP_KERNEL);
 
-   WILC_NULLCHECK(s32Error, rates);
+   if (!rates)
+   return -ENOMEM;
 
memcpy(rates, pstrStaParams->pu8Rates, 
pstrAddStationMsg->u8NumRates);
pstrAddStationMsg->pu8Rates = rates;
@@ -7444,7 +7445,9 @@ s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv, 
tstrWILC_AddStaParam *pstrSt
if (pstrAddStationMsg->u8NumRates > 0) {
u8 *rates = kmalloc(pstrAddStationMsg->u8NumRates, GFP_KERNEL);
 
-   WILC_NULLCHECK(s32Error, rates);
+   if (!rates)
+   return -ENOMEM;
+
memcpy(rates, pstrStaParams->pu8Rates, 
pstrAddStationMsg->u8NumRates);
pstrAddStationMsg->pu8Rates = rates;
}
diff --git a/drivers/staging/wilc1000/wilc_errorsupport.h 
b/drivers/staging/wilc1000/wilc_errorsupport.h
index 8eb8150..42495d9 100644
--- a/drivers/staging/wilc1000/wilc_errorsupport.h
+++ b/drivers/staging/wilc1000/wilc_errorsupport.h
@@ -51,12 +51,6 @@
goto ERRORHANDLER; \
 } while (0)
 
-#define  WILC_NULLCHECK(__status__, __ptr__)   do { \
-   if (__ptr__ == NULL) { \
-   WILC_ERRORREPORT(__status__, WILC_NULL_PTR); \
-   } \
-} while (0)
-
 #define WILC_CATCH(__status__) \
 ERRORHANDLER: \
if (__status__ < WILC_SUCCESS) \
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 41244ce..ac23736 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -1,6 +1,7 @@
 
 #include "wilc_msgqueue.h"
 #include 
+#include 
 
 /*!
  *  @authorsyounan
@@ -69,11 +70,15 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
 
/* construct a new message */
pstrMessage = kmalloc(sizeof(Message), GFP_ATOMIC);
-   WILC_NULLCHECK(s32RetStatus, pstrMessage);
+   if (!pstrMessage)
+   return -ENOMEM;
pstrMessage->u32Length = u32SendBufferSize;
pstrMessage->pstrNext = NULL;
pstrMessage->pvBuffer = kmalloc(u32SendBufferSize, GFP_ATOMIC);
-   WILC_NULLCHECK(s32RetStatus, pstrMessage->pvBuffer);
+   if (!pstrMessage->pvBuffer) {
+   s32RetStatus = -ENOMEM;
+   goto ERRORHANDLER;
+   }
memcpy(pstrMessage->pvBuffer, pvSendBuffer, u32SendBufferSize);
 
/* add it to the message queue */
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 4151aae..32fd543 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -15,7 +15,7 @@
 #ifdef WILC_SDIO
 #include "linux_wlan_sdio.h"/* tony : for set_wiphy_dev() */
 #endif
-
+#include 
 
 #define IS_MANAGMEMENT 0x100
 #define IS_MANAGMEMENT_CALLBACK0x080
@@ -381,7 +381,10 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, 
tstrNetworkInfo *pstrNetwo
if (priv->bCfgScanning == true) {
if (enuScanEvent == SCAN_EVENT_NETWORK_FOUND) {
wiphy = priv->dev->ieee80211_ptr->wiphy;
-   WILC_NULLCHECK(s32Error, wiphy);
+
+   if (!wiphy)
+   return;
+
if (wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC
&&
s32)pstrNetworkInfo->s8rssi) * 100) < 0
@@ -395,7 +398,8 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, 
tstrNetworkInfo *pstrNetwo
s32Freq = 
ieee80211_channel_to_frequency((s32)pstrNetworkInfo->u8channel, 
IEEE80211_BAND_2GHZ);
channel = ieee80211_get_channel(wiphy, s32Freq);
 
-   WILC_NULLCHECK(s32Error, channel);
+   if (!channel)
+  

[PATCH v2 2/6] staging: wilc1000: remove the macro WILC_ERRORCHECK

2015-09-16 Thread Tony Cho
From: Leo Kim 

This patch removes the macro WILC_ERRORCHECK which is not used
anymore by replacing it with the plain statements.

This patch also removes the WILC_CATCH macros from some of functions not
to make the build warnings.

Signed-off-by: Leo Kim 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/host_interface.c |  3 ++-
 drivers/staging/wilc1000/wilc_errorsupport.h  |  7 ---
 drivers/staging/wilc1000/wilc_msgqueue.c  |  5 -
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 24 ---
 4 files changed, 14 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 827758d..8ed1aaf 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -7247,7 +7247,8 @@ s32 host_int_del_beacon(tstrWILC_WFIDrv *hWFIDrv)
PRINT_D(HOSTINF_DBG, "Setting deleting beacon message queue params\n");
 
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, 
sizeof(tstrHostIFmsg));
-   WILC_ERRORCHECK(s32Error);
+   if (s32Error)
+   PRINT_ER("wilc_mq_send fail\n");
 
WILC_CATCH(s32Error)
{
diff --git a/drivers/staging/wilc1000/wilc_errorsupport.h 
b/drivers/staging/wilc1000/wilc_errorsupport.h
index 42495d9..769cef0 100644
--- a/drivers/staging/wilc1000/wilc_errorsupport.h
+++ b/drivers/staging/wilc1000/wilc_errorsupport.h
@@ -38,13 +38,6 @@
 
 
 
-#define WILC_ERRORCHECK(__status__) do { \
-   if (__status__ < WILC_SUCCESS) { \
-   PRINT_ER("PRINT_ER(%d)\n", __status__); \
-   goto ERRORHANDLER; \
-   } \
-} while (0)
-
 #define WILC_ERRORREPORT(__status__, __err__) do { \
PRINT_ER("PRINT_ER(%d)\n", __err__); \
__status__ = __err__; \
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index ac23736..53b6f07 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -145,7 +145,10 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle,
spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
} else {
/* other non-timeout scenarios */
-   WILC_ERRORCHECK(s32RetStatus);
+   if (s32RetStatus) {
+   PRINT_ER("Non-timeout\n");
+   return s32RetStatus;
+   }
 
if (pHandle->bExiting) {
WILC_ERRORREPORT(s32RetStatus, WILC_FAIL);
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 32fd543..72fc105 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -3233,11 +3233,9 @@ static int stop_ap(struct wiphy *wiphy, struct 
net_device *dev)
 
s32Error = host_int_del_beacon(priv->hWILCWFIDrv);
 
-   WILC_ERRORCHECK(s32Error);
+   if (s32Error)
+   PRINT_ER("Host delete beacon fail\n");
 
-   WILC_CATCH(s32Error)
-   {
-   }
return s32Error;
 }
 
@@ -3303,12 +3301,10 @@ static int add_station(struct wiphy *wiphy, struct 
net_device *dev,
PRINT_D(HOSTAPD_DBG, "Flag Set = %d\n", 
strStaParams.u16FlagsSet);
 
s32Error = host_int_add_station(priv->hWILCWFIDrv, 
&strStaParams);
-   WILC_ERRORCHECK(s32Error);
+   if (s32Error)
+   PRINT_ER("Host add station fail\n");
}
 
-   WILC_CATCH(s32Error)
-   {
-   }
return s32Error;
 }
 
@@ -3348,10 +3344,8 @@ static int del_station(struct wiphy *wiphy, struct 
net_device *dev,
 
s32Error = host_int_del_station(priv->hWILCWFIDrv, mac);
 
-   WILC_ERRORCHECK(s32Error);
-   }
-   WILC_CATCH(s32Error)
-   {
+   if (s32Error)
+   PRINT_ER("Host delete station fail\n");
}
return s32Error;
 }
@@ -3419,10 +3413,8 @@ static int change_station(struct wiphy *wiphy, struct 
net_device *dev,
PRINT_D(HOSTAPD_DBG, "Flag Set = %d\n", 
strStaParams.u16FlagsSet);
 
s32Error = host_int_edit_station(priv->hWILCWFIDrv, 
&strStaParams);
-   WILC_ERRORCHECK(s32Error);
-   }
-   WILC_CATCH(s32Error)
-   {
+   if (s32Error)
+   PRINT_ER("Host edit station fail\n");
}
return s32Error;
 }
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 3/6] staging: wilc1000: remove the macro WILC_ERRORREPORT

2015-09-16 Thread Tony Cho
From: Leo Kim 

This patch removes the macro WILC_ERRORREPORT which is not used
anymore by replacing it with the plain statements.

The compiler complains the build warnings in some functions for WILC_CATCH and
ERRORHANDLER as unused definitions. So, this patch also removes WILC_CATCH and
ERRORHANDLER from some of functions.

Signed-off-by: Leo Kim 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/coreconfigurator.c   |   4 +-
 drivers/staging/wilc1000/host_interface.c | 869 +-
 drivers/staging/wilc1000/wilc_errorsupport.h  |   5 -
 drivers/staging/wilc1000/wilc_msgqueue.c  |  98 ++-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |   9 +-
 5 files changed, 398 insertions(+), 587 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c 
b/drivers/staging/wilc1000/coreconfigurator.c
index 87d32ae..96358a9 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -13,6 +13,7 @@
 /* File Includes */
 /*/
 #include "coreconfigurator.h"
+#include 
 /*/
 /* Constants */
 /*/
@@ -429,7 +430,7 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo 
**ppstrNetworkInfo)
/* Check whether the received message type is 'N' */
if ('N' != u8MsgType) {
PRINT_ER("Received Message format incorrect.\n");
-   WILC_ERRORREPORT(s32Error, WILC_FAIL);
+   return -EFAULT;
}
 
/* Extract message ID */
@@ -525,7 +526,6 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo 
**ppstrNetworkInfo)
 
*ppstrNetworkInfo = pstrNetworkInfo;
 
-ERRORHANDLER:
return s32Error;
 }
 
diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 8ed1aaf..8c6de42 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -668,11 +668,7 @@ static s32 Handle_SetChannel(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFSetChan *pst
 get_id_from_handler(pstrWFIDrv));
if (s32Error) {
PRINT_ER("Failed to set channel\n");
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
-   }
-   WILC_CATCH(s32Error)
-   {
-
+   return -EINVAL;
}
 
return s32Error;
@@ -712,11 +708,7 @@ static s32 Handle_SetWfiDrvHandler(tstrWILC_WFIDrv 
*drvHandler,
 
if (s32Error) {
PRINT_ER("Failed to set driver handler\n");
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
-   }
-   WILC_CATCH(s32Error)
-   {
-
+   return -EINVAL;
}
 
return s32Error;
@@ -758,11 +750,7 @@ static s32 Handle_SetOperationMode(tstrWILC_WFIDrv 
*drvHandler, tstrHostIfSetOpe
 
if (s32Error) {
PRINT_ER("Failed to set driver handler\n");
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
-   }
-   WILC_CATCH(s32Error)
-   {
-
+   return -EINVAL;
}
 
return s32Error;
@@ -805,16 +793,11 @@ s32 Handle_set_IPAddress(tstrWILC_WFIDrv *drvHandler, u8 
*pu8IPAddr, u8 idx)
host_int_get_ipaddress(drvHandler, firmwareIPAddress, idx);
 
if (s32Error) {
-   PRINT_D(HOSTINF_DBG, "Failed to set IP address\n");
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
-   } else {
-   PRINT_INFO(HOSTINF_DBG, "IP address set\n");
+   PRINT_ER("Failed to set IP address\n");
+   return -EINVAL;
}
 
-   WILC_CATCH(s32Error)
-   {
-
-   }
+   PRINT_INFO(HOSTINF_DBG, "IP address set\n");
 
return s32Error;
 }
@@ -857,17 +840,12 @@ s32 Handle_get_IPAddress(tstrWILC_WFIDrv *drvHandler, u8 
*pu8IPAddr, u8 idx)
 
if (s32Error != WILC_SUCCESS) {
PRINT_ER("Failed to get IP address\n");
-   WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
-   } else {
-   PRINT_INFO(HOSTINF_DBG, "IP address retrieved:: u8IfIdx = 
%d\n", idx);
-   PRINT_INFO(HOSTINF_DBG, "%pI4\n", gs8GetIP[idx]);
-   PRINT_INFO(HOSTINF_DBG, "\n");
+   return -EINVAL;
}
 
-   WILC_CATCH(s32Error)
-   {
-
-   }
+   PRINT_INFO(HOSTINF_DBG, "IP address retrieved:: u8IfIdx = %d\n", idx);
+   PRINT_INFO(HOSTINF_DBG, "%pI4\n", gs8GetIP[idx]);
+   PRINT_INFO(HOSTINF_DBG, "\n");
 
return s32Error;
 }
@@ -908,13 +886,9 @@ static s32 Handle_SetMacAddress(tstrWILC_WFIDrv 
*drvHandler, tstrHostIfSetMacAdd
 get_id_from_handler(pstrWF

[PATCH v2 6/6] staging: wilc1000: remove wilc_errorsupport.h

2015-09-16 Thread Tony Cho
From: Leo Kim 

This patch removes the wilc_errorsupport.h which is not used anymore and
also deletes #include "wilc_errorsupport.h" from the source code.

In addition, adds linux_wlan_common.h file in the wilc_msgqueue.c file
in order to use PRINT macros defined in the linux_wlan_common.h file.

Signed-off-by: Leo Kim 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/wilc_errorsupport.h | 15 ---
 drivers/staging/wilc1000/wilc_msgqueue.c |  1 +
 drivers/staging/wilc1000/wilc_msgqueue.h |  1 -
 drivers/staging/wilc1000/wilc_oswrapper.h|  3 ---
 4 files changed, 1 insertion(+), 19 deletions(-)
 delete mode 100644 drivers/staging/wilc1000/wilc_errorsupport.h

diff --git a/drivers/staging/wilc1000/wilc_errorsupport.h 
b/drivers/staging/wilc1000/wilc_errorsupport.h
deleted file mode 100644
index b0babbd..000
--- a/drivers/staging/wilc1000/wilc_errorsupport.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef __WILC_ERRORSUPPORT_H__
-#define __WILC_ERRORSUPPORT_H__
-
-/*!
- *  @file  wilc_errorsupport.h
- *  @brief Error reporting and handling support
- *  @authorsyounan
- *  @sawilc_oswrapper.h top level OS wrapper file
- *  @date  10 Aug 2010
- *  @version   1.0
- */
-
-#include "linux_wlan_common.h"
-
-#endif
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c 
b/drivers/staging/wilc1000/wilc_msgqueue.c
index 94a2d3d..225bb99 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -1,6 +1,7 @@
 
 #include "wilc_msgqueue.h"
 #include 
+#include "linux_wlan_common.h"
 #include 
 
 /*!
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.h 
b/drivers/staging/wilc1000/wilc_msgqueue.h
index fb26463..a3c0bba 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.h
+++ b/drivers/staging/wilc1000/wilc_msgqueue.h
@@ -11,7 +11,6 @@
  */
 
 #include "wilc_platform.h"
-#include "wilc_errorsupport.h"
 
 /*!
  *  @brief Creates a new Message queue
diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h 
b/drivers/staging/wilc1000/wilc_oswrapper.h
index 68f6efe..9b5c23a 100644
--- a/drivers/staging/wilc1000/wilc_oswrapper.h
+++ b/drivers/staging/wilc1000/wilc_oswrapper.h
@@ -16,9 +16,6 @@
 /* Os Configuration File */
 #include "wilc_platform.h"
 
-/* Error reporting and handling support */
-#include "wilc_errorsupport.h"
-
 /* Message Queue */
 #include "wilc_msgqueue.h"
 
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 4/6] staging: wilc1000: remove definitions unused

2015-09-16 Thread Tony Cho
From: Leo Kim 

Remove the definitions which are not used anywhere.
- WILC_ALREADY_EXSIT
- WILC_EMPTY
- WILC_FULL
- WILC_CANCELED
- WILC_INVALID_FILE
- WILC_UNSUPPORTED_VERSION
- WILC_FILE_EOF

Remove the definition which is not used anymore.
- WILC_CATCH

Signed-off-by: Leo Kim 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/wilc_errorsupport.h | 17 -
 1 file changed, 17 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_errorsupport.h 
b/drivers/staging/wilc1000/wilc_errorsupport.h
index 99ded3d..054ed76 100644
--- a/drivers/staging/wilc1000/wilc_errorsupport.h
+++ b/drivers/staging/wilc1000/wilc_errorsupport.h
@@ -12,9 +12,6 @@
 
 #include "linux_wlan_common.h"
 
-/* Psitive Numbers to indicate sucess with special status */
-#define WILC_ALREADY_EXSIT (+100)/** The requested object already 
exists */
-
 /* Generic success will return 0 */
 #define WILC_SUCCESS   0   /** Generic success */
 
@@ -25,22 +22,8 @@
 #define WILC_INVALID_STATE -103 /** An API request would violate 
the Driver state machine (i.e. to start PID while not camped)*/
 #define WILC_BUFFER_OVERFLOW   -104 /** In copy operations if the 
copied data is larger than the allocated buffer*/
 #define WILC_NULL_PTR  -105 /** null pointer is passed or used 
*/
-#define WILC_EMPTY -107
-#define WILC_FULL  -108
 #define WILC_TIMEOUT   -109
-#define WILC_CANCELED  -110 /** The required operation have 
been canceled by the user*/
-#define WILC_INVALID_FILE  -112 /** The Loaded file is corruped or 
having an invalid format */
 #define WILC_NOT_FOUND -113 /** Cant find the file to load */
 #define WILC_NO_MEM-114
-#define WILC_UNSUPPORTED_VERSION   -115
-#define WILC_FILE_EOF  -116
-
-
-
-
-
-#define WILC_CATCH(__status__) \
-ERRORHANDLER: \
-   if (__status__ < WILC_SUCCESS) \
 
 #endif
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 0/6] removing wilc_errorsupport.h file

2015-09-16 Thread Tony Cho
This series of patch is resent in total 6 patches as version 2. This version
fixes the warnings reported by checkpatch.pl not to make additional warnings.
The concern for the memory leak issue is checked again in this version.

The error types provided by wilc driver are being replaced by the ones provided
by Linux kernel and the macros which checking errors are being deleted in these
patches becasue they are not helpful to code readability.

Leo Kim (6):
  staging: wilc1000: remove a macro WILC_NULLCHECK
  staging: wilc1000: remove the macro WILC_ERRORCHECK
  staging: wilc1000: remove the macro WILC_ERRORREPORT
  staging: wilc1000: remove definitions unused
  staging: wilc1000: replace wilc error types with the generic error
types
  staging: wilc1000: remove wilc_errorsupport.h

 drivers/staging/wilc1000/coreconfigurator.c   |   28 +-
 drivers/staging/wilc1000/host_interface.c | 1115 +
 drivers/staging/wilc1000/linux_mon.c  |   14 +-
 drivers/staging/wilc1000/linux_wlan.c |2 +-
 drivers/staging/wilc1000/wilc_errorsupport.h  |   64 --
 drivers/staging/wilc1000/wilc_msgqueue.c  |  113 ++-
 drivers/staging/wilc1000/wilc_msgqueue.h  |1 -
 drivers/staging/wilc1000/wilc_oswrapper.h |3 -
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  133 ++-
 9 files changed, 616 insertions(+), 857 deletions(-)
 delete mode 100644 drivers/staging/wilc1000/wilc_errorsupport.h

-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 5/6] staging: wilc1000: replace wilc error types with the generic error types

2015-09-16 Thread Tony Cho
From: Leo Kim 

This patch replaces the error types defined by wilc driver with the
generic error types provided by the Linux kernel.
- WILC_SUCCESS  0
- WILC_FAIL -EFAULT
- WILC_BUSY -EBUSY
- WILC_INVALID_ARGUMENT -EINVAL
- WILC_INVALID_STATE-EINVAL
- WILC_BUFFER_OVERFLOW  -EOVERFLOW
- WILC_NULL_PTR -EFAULT
- WILC_TIMEOUT  -ETIMEDOUT
- WILC_NOT_FOUND-ENOENT
- WILC_NO_MEM   -ENOMEM

After then removes all wilc definitions.

Signed-off-by: Leo Kim 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/coreconfigurator.c   |  24 +--
 drivers/staging/wilc1000/host_interface.c | 238 +++---
 drivers/staging/wilc1000/linux_mon.c  |  14 +-
 drivers/staging/wilc1000/linux_wlan.c |   2 +-
 drivers/staging/wilc1000/wilc_errorsupport.h  |  14 --
 drivers/staging/wilc1000/wilc_msgqueue.c  |   8 +-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  76 +++
 7 files changed, 181 insertions(+), 195 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c 
b/drivers/staging/wilc1000/coreconfigurator.c
index 96358a9..aecaa03 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -340,7 +340,7 @@ INLINE u16 get_asoc_id(u8 *data)
 
 s32 CoreConfiguratorInit(void)
 {
-   s32 s32Error = WILC_SUCCESS;
+   s32 s32Error = 0;
 
PRINT_D(CORECONFIG_DBG, "CoreConfiguratorInit()\n");
 
@@ -415,7 +415,7 @@ u8 get_current_channel(u8 *pu8msa, u16 u16RxLen)
  */
 s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
 {
-   s32 s32Error = WILC_SUCCESS;
+   s32 s32Error = 0;
tstrNetworkInfo *pstrNetworkInfo = NULL;
u8 u8MsgType = 0;
u8 u8MsgID = 0;
@@ -541,21 +541,21 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo 
**ppstrNetworkInfo)
  */
 s32 DeallocateNetworkInfo(tstrNetworkInfo *pstrNetworkInfo)
 {
-   s32 s32Error = WILC_SUCCESS;
+   s32 s32Error = 0;
 
if (pstrNetworkInfo != NULL) {
if (pstrNetworkInfo->pu8IEs != NULL) {
kfree(pstrNetworkInfo->pu8IEs);
pstrNetworkInfo->pu8IEs = NULL;
} else {
-   s32Error = WILC_FAIL;
+   s32Error = -EFAULT;
}
 
kfree(pstrNetworkInfo);
pstrNetworkInfo = NULL;
 
} else {
-   s32Error = WILC_FAIL;
+   s32Error = -EFAULT;
}
 
return s32Error;
@@ -575,7 +575,7 @@ s32 DeallocateNetworkInfo(tstrNetworkInfo *pstrNetworkInfo)
 s32 ParseAssocRespInfo(u8 *pu8Buffer, u32 u32BufferLen,
   tstrConnectRespInfo **ppstrConnectRespInfo)
 {
-   s32 s32Error = WILC_SUCCESS;
+   s32 s32Error = 0;
tstrConnectRespInfo *pstrConnectRespInfo = NULL;
u16 u16AssocRespLen = 0;
u8 *pu8IEs = NULL;
@@ -632,21 +632,21 @@ s32 ParseAssocRespInfo(u8 *pu8Buffer, u32 u32BufferLen,
  */
 s32 DeallocateAssocRespInfo(tstrConnectRespInfo *pstrConnectRespInfo)
 {
-   s32 s32Error = WILC_SUCCESS;
+   s32 s32Error = 0;
 
if (pstrConnectRespInfo != NULL) {
if (pstrConnectRespInfo->pu8RespIEs != NULL) {
kfree(pstrConnectRespInfo->pu8RespIEs);
pstrConnectRespInfo->pu8RespIEs = NULL;
} else {
-   s32Error = WILC_FAIL;
+   s32Error = -EFAULT;
}
 
kfree(pstrConnectRespInfo);
pstrConnectRespInfo = NULL;
 
} else {
-   s32Error = WILC_FAIL;
+   s32Error = -EFAULT;
}
 
return s32Error;
@@ -657,7 +657,7 @@ s32 ParseSurveyResults(u8 
ppu8RcvdSiteSurveyResults[][MAX_SURVEY_RESULT_FRAG_SIZ
   wid_site_survey_reslts_s **ppstrSurveyResults,
   u32 *pu32SurveyResultsCount)
 {
-   s32 s32Error = WILC_SUCCESS;
+   s32 s32Error = 0;
wid_site_survey_reslts_s *pstrSurveyResults = NULL;
u32 u32SurveyResultsCount = 0;
u32 u32SurveyBytesLength = 0;
@@ -712,7 +712,7 @@ ERRORHANDLER:
 
 s32 DeallocateSurveyResults(wid_site_survey_reslts_s *pstrSurveyResults)
 {
-   s32 s32Error = WILC_SUCCESS;
+   s32 s32Error = 0;
 
if (pstrSurveyResults != NULL) {
kfree(pstrSurveyResults);
@@ -734,7 +734,7 @@ s32 DeallocateSurveyResults(wid_site_survey_reslts_s 
*pstrSurveyResults)
 
 s32 CoreConfiguratorDeInit(void)
 {
-   s32 s32Error = WILC_SUCCESS;
+   s32 s32Error = 0;
 
PRINT_D(CORECONFIG_DBG, "CoreConfiguratorDeInit()\n");
 
diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 8c6de42..8d7a639 1

[PATCH 4/8] staging: wilc1000: remove function linux_wlan_rxq_task

2015-09-16 Thread Tony Cho
From: Glen Lee 

linux_wlan_rxq_task is not used in the driver. Just remove it.

Signed-off-by: Glen Lee 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/linux_wlan.c | 26 --
 1 file changed, 26 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 08d75ab..de04779 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -587,32 +587,6 @@ int linux_wlan_get_num_conn_ifcs(void)
return ret_val;
 }
 
-static int linux_wlan_rxq_task(void *vp)
-{
-
-   /* inform wilc1000_wlan_init that RXQ task is started. */
-   up(&g_linux_wlan->rxq_thread_started);
-   while (1) {
-   down(&g_linux_wlan->rxq_event);
-   /* wait_for_completion(&g_linux_wlan->rxq_event); */
-
-   if (g_linux_wlan->close) {
-   /*Unlock the mutex in the mac_close function to 
indicate the exiting of the RX thread */
-   up(&g_linux_wlan->rxq_thread_started);
-
-   while (!kthread_should_stop())
-   schedule();
-
-   PRINT_D(RX_DBG, " RX thread stopped\n");
-   break;
-   }
-   PRINT_D(RX_DBG, "Calling wlan_handle_rx_que()\n");
-
-   g_linux_wlan->oup.wlan_handle_rx_que();
-   }
-   return 0;
-}
-
 #define USE_TX_BACKOFF_DELAY_IF_NO_BUFFERS
 
 static int linux_wlan_txq_task(void *vp)
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/8] staging: wilc1000: remove define WILC_P2P and ifdef line

2015-09-16 Thread Tony Cho
From: Glen Lee 

WILC_P2P is always used in the driver. So delete define WILC_P2P and ifdef line.

Signed-off-by: Glen Lee 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/coreconfigurator.c   |  2 --
 drivers/staging/wilc1000/coreconfigurator.h   |  2 --
 drivers/staging/wilc1000/host_interface.c | 32 
 drivers/staging/wilc1000/host_interface.h | 10 --
 drivers/staging/wilc1000/linux_wlan.c |  2 --
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 37 ---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.h |  3 --
 drivers/staging/wilc1000/wilc_wfi_netdevice.h |  7 -
 drivers/staging/wilc1000/wilc_wlan.c  |  8 ++---
 drivers/staging/wilc1000/wilc_wlan_if.h   |  9 --
 10 files changed, 2 insertions(+), 110 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c 
b/drivers/staging/wilc1000/coreconfigurator.c
index aecaa03..b7a4bff 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -476,11 +476,9 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo 
**ppstrNetworkInfo)
 
/* Get the cap_info */
pstrNetworkInfo->u16CapInfo = get_cap_info(pu8msa);
-   #ifdef WILC_P2P
/* Get time-stamp [Low only 32 bit] */
pstrNetworkInfo->u32Tsf = get_beacon_timestamp_lo(pu8msa);
PRINT_D(CORECONFIG_DBG, "TSF :%x\n", pstrNetworkInfo->u32Tsf);
-   #endif
 
/* Get full time-stamp [Low and High 64 bit] */
u32Tsf_Lo = get_beacon_timestamp_lo(pu8msa);
diff --git a/drivers/staging/wilc1000/coreconfigurator.h 
b/drivers/staging/wilc1000/coreconfigurator.h
index 32e5b31..8439066 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -111,9 +111,7 @@ typedef struct {
 #ifdef AGING_ALG
u8 u8Found;
 #endif
-#ifdef WILC_P2P
u32 u32Tsf; /* time-stamp [Low only 32 bit] */
-#endif
u8 *pu8IEs;
u16 u16IEsLen;
void *pJoinParams;
diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 41e80aa..6fdf392 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -443,10 +443,8 @@ typedef union _tuniHostIFmsgBody {
tstrHostIfSetMacAddress strHostIfSetMacAddress;
tstrHostIfGetMacAddress strHostIfGetMacAddress;
tstrHostIfBASessionInfo strHostIfBASessionInfo;
-   #ifdef WILC_P2P
tstrHostIfRemainOnChan strHostIfRemainOnChan;
tstrHostIfRegisterFrame strHostIfRegisterFrame;
-   #endif
char *pUserData;
tstrHostIFDelAllSta strHostIFDelAllSta;
 } tuniHostIFmsgBody;
@@ -497,7 +495,6 @@ typedef struct _tstrJoinBssParam {
u8 rsn_auth_policy[3];
u8 rsn_cap[2];
struct _tstrJoinParam *nextJoinBss;
-   #ifdef WILC_P2P
u32 tsf;
u8 u8NoaEnbaled;
u8 u8OppEnable;
@@ -507,7 +504,6 @@ typedef struct _tstrJoinBssParam {
u8 au8Duration[4];
u8 au8Interval[4];
u8 au8StartTime[4];
-   #endif
 } tstrJoinBssParam;
 /*Bug4218: Parsing Join Param*/
 /*a linked list table containing needed join parameters entries for each AP 
found in most recent scan*/
@@ -1312,9 +1308,6 @@ static s32 Handle_Scan(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFscanAttr *pstrHost
pstrWFIDrv->strWILC_UsrScanReq.pfUserScanResult = 
pstrHostIFscanAttr->pfScanResult;
pstrWFIDrv->strWILC_UsrScanReq.u32UserScanPvoid = 
pstrHostIFscanAttr->pvUserArg;
 
-   #ifdef WILC_P2P
-   #endif
-
if ((pstrWFIDrv->enuHostIFstate >= HOST_IF_SCANNING) && 
(pstrWFIDrv->enuHostIFstate < HOST_IF_CONNECTED)) {
/* here we either in HOST_IF_SCANNING, HOST_IF_WAITING_CONN_REQ 
or HOST_IF_WAITING_CONN_RESP */
PRINT_D(GENERIC_DBG, "Don't scan we are already in [%d] 
state\n", pstrWFIDrv->enuHostIFstate);
@@ -1953,7 +1946,6 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFconnectAttr *ps
/*BugID_5137*/
*(pu8CurrByte++) = REAL_JOIN_REQ;
 
-   #ifdef WILC_P2P
*(pu8CurrByte++) = ptstrJoinBssParam->u8NoaEnbaled;
if (ptstrJoinBssParam->u8NoaEnbaled) {
PRINT_D(HOSTINF_DBG, "NOA present\n");
@@ -1986,8 +1978,6 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFconnectAttr *ps
 
} else
PRINT_D(HOSTINF_DBG, "NOA not present\n");
-   #endif
-
 
/* keep the buffer at the start of the allocated pointer to use it with 
the free*/
pu8CurrByte = strWIDList[u32WidsCount].ps8WidVal;
@@ -3787,7 +3777,6 @@ ERRORHANDLER:
kfree(strWID.ps8WidVal);
 }
 
-#ifdef WILC_P2P
 /**
  *  @brief Handle_RemainOnChan
  *  @detailsSending config packet to edit station
@@ -4009,8 +3998,6 @@ static 

[PATCH 1/8] staging: wilc1000: remove define WILC_AP_EXTERNAL_MLME and ifdef line

2015-09-16 Thread Tony Cho
From: Glen Lee 

This driver use WILC_AP_EXTERNAL_MLME define always. Delete define
WILC_AP_EXTERNAL_MLME and ifdef line.

Signed-off-by: Glen Lee 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/host_interface.c | 30 +++
 drivers/staging/wilc1000/linux_mon.c  |  2 --
 drivers/staging/wilc1000/linux_wlan.c |  4 ---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 21 +---
 drivers/staging/wilc1000/wilc_wlan.c  | 12 +++--
 drivers/staging/wilc1000/wilc_wlan.h  |  2 --
 drivers/staging/wilc1000/wilc_wlan_if.h   |  5 +---
 7 files changed, 9 insertions(+), 67 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 8d7a639..41e80aa 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -563,10 +563,8 @@ static s8 gs8lnkspd;
 static u8 gu8Chnl;
 static u8 gs8SetIP[2][4];
 static u8 gs8GetIP[2][4];
-#ifdef WILC_AP_EXTERNAL_MLME
 static u32 gu32InactiveTime;
 static u8 gu8DelBcn;
-#endif
 static u32 gu32WidConnRstHack;
 
 /*BugID_5137*/
@@ -2728,9 +2726,7 @@ static int Handle_Key(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFkeyAttr *pstrHostIF
 {
s32 s32Error = 0;
tstrWID strWID;
-   #ifdef WILC_AP_EXTERNAL_MLME
tstrWID strWIDList[5];
-   #endif
u8 i;
u8 *pu8keybuf;
s8 s8idxarray[1];
@@ -2743,7 +2739,6 @@ static int Handle_Key(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFkeyAttr *pstrHostIF
 
case WEP:
 
-#ifdef WILC_AP_EXTERNAL_MLME
if (pstrHostIFkeyAttr->u8KeyAction & ADDKEY_AP) {
 
PRINT_D(HOSTINF_DBG, "Handling WEP key\n");
@@ -2791,7 +2786,6 @@ static int Handle_Key(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFkeyAttr *pstrHostIF
 
 
}
-#endif
 
if (pstrHostIFkeyAttr->u8KeyAction & ADDKEY) {
PRINT_D(HOSTINF_DBG, "Handling WEP key\n");
@@ -2844,7 +2838,6 @@ static int Handle_Key(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFkeyAttr *pstrHostIF
break;
 
case WPARxGtk:
-   #ifdef WILC_AP_EXTERNAL_MLME
if (pstrHostIFkeyAttr->u8KeyAction & ADDKEY_AP) {
pu8keybuf = kmalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL);
if (pu8keybuf == NULL) {
@@ -2894,7 +2887,6 @@ static int Handle_Key(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFkeyAttr *pstrHostIF
/* / */
}
 
-   #endif
if (pstrHostIFkeyAttr->u8KeyAction & ADDKEY) {
PRINT_D(HOSTINF_DBG, "Handling group key(Rx) 
function\n");
 
@@ -2949,7 +2941,6 @@ _WPARxGtk_end_case_:
break;
 
case WPAPtk:
-   #ifdef WILC_AP_EXTERNAL_MLME
if (pstrHostIFkeyAttr->u8KeyAction & ADDKEY_AP) {
 
 
@@ -2997,7 +2988,6 @@ _WPARxGtk_end_case_:
up(&(pstrWFIDrv->hSemTestKeyBlock));
/* / */
}
-   #endif
if (pstrHostIFkeyAttr->u8KeyAction & ADDKEY) {
 
 
@@ -3395,10 +3385,6 @@ s32 Handle_GetStatistics(tstrWILC_WFIDrv *drvHandler, 
tstrStatistics *pstrStatis
 
 }
 
-
-#ifdef WILC_AP_EXTERNAL_MLME
-
-
 /**
  *  @brief Handle_Get_InActiveTime
  *  @details   Sending config packet to set mac adddress for station and
@@ -3800,7 +3786,6 @@ ERRORHANDLER:
kfree(pstrStationParam->pu8Rates);
kfree(strWID.ps8WidVal);
 }
-#endif /*WILC_AP_EXTERNAL_MLME*/
 
 #ifdef WILC_P2P
 /**
@@ -4447,7 +4432,6 @@ static int hostIFthread(void *pvArg)
Handle_GetChnl(strHostIFmsg.drvHandler);
break;
 
-#ifdef WILC_AP_EXTERNAL_MLME
case HOST_IF_MSG_ADD_BEACON:
Handle_AddBeacon(strHostIFmsg.drvHandler, 
&strHostIFmsg.uniHostIFmsgBody.strHostIFSetBeacon);
break;
@@ -4472,7 +4456,6 @@ static int hostIFthread(void *pvArg)
Handle_Get_InActiveTime(strHostIFmsg.drvHandler, 
&strHostIFmsg.uniHostIFmsgBody.strHostIfStaInactiveT);
break;
 
-#endif /*WILC_AP_EXTERNAL_MLME*/
case HOST_IF_MSG_SCAN_TIMER_FIRED:
PRINT_D(HOSTINF_DBG, "Scan Timeout\n");
 
@@ -4781,7 +4764,6 @@ s32 host_int_add_wep_key_bss_sta(tstrWILC_WFIDrv 
*hWFIDrv, const u8 *pu8WepKey,
 
 }
 
-#ifdef WILC_AP_EXTERNAL_MLME
 /**
  *
  *  @brief  host_int_add_wep_key_bss_ap
@@ -4854,7 +4836,7 @@ s32 host_int_add_wep_key_bss_ap(tstrWILC_WFIDrv *hWFIDrv, 
const u8 *pu8WepKey, u
return s32Error;
 
 }
-#endif
+
 /**
  *  @brief  adds ptk Key
  *  @details
@@ -4896,13 +4878,11 @@ s32 host_int_add_ptk(tstrWILC_WFIDrv *hWFIDrv, const u8 
*pu8Ptk, u8 u8PtkKeylen,
 
strHostIFmsg.u16MsgId = HO

[PATCH 3/8] staging: wilc1000: remove define TCP_ENHANCEMENTS and it's related code

2015-09-16 Thread Tony Cho
From: Glen Lee 

TCP_ENHANCEMENTS is always in use. Remove define TCP_ENHANCEMENTS, ifdef line,
ifndef line and codes inside ifndef.

Signed-off-by: Glen Lee 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/linux_wlan.c | 36 ---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  2 --
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.h |  2 --
 drivers/staging/wilc1000/wilc_wlan.c  |  8 +
 drivers/staging/wilc1000/wilc_wlan_if.h   |  1 -
 5 files changed, 1 insertion(+), 48 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index f79aa49..08d75ab 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1284,21 +1284,6 @@ int wlan_initialize_threads(perInterface_wlan_t *nic)
}
 #endif
 
-#ifndef TCP_ENHANCEMENTS
-   /* create rx task */
-   PRINT_D(INIT_DBG, "Creating kthread for reception\n");
-   g_linux_wlan->rxq_thread = kthread_run(linux_wlan_rxq_task, (void 
*)g_linux_wlan, "K_RXQ_TASK");
-   if (g_linux_wlan->rxq_thread == 0) {
-   PRINT_ER("couldn't create RXQ thread\n");
-   ret = -ENOBUFS;
-   goto _fail_1;
-   }
-
-   /* wait for RXQ task to start. */
-   down(&g_linux_wlan->rxq_thread_started);
-
-#endif
-
/* create tx task */
PRINT_D(INIT_DBG, "Creating kthread for transmission\n");
g_linux_wlan->txq_thread = kthread_run(linux_wlan_txq_task, (void 
*)g_linux_wlan, "K_TXQ_TASK");
@@ -1327,9 +1312,6 @@ _fail_2:
up(&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;
@@ -1970,10 +1952,6 @@ void frmw_to_linux(u8 *buff, u32 size, u32 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;
 
@@ -2019,16 +1997,6 @@ void frmw_to_linux(u8 *buff, u32 size, u32 pkt_offset)
/* nic = netdev_priv(wilc_netdev); */
 
skb->protocol = eth_type_trans(skb, wilc_netdev);
-   #ifndef TCP_ENHANCEMENTS
-   /*get source and dest ip addresses*/
-   ih = (struct iphdr *)(skb->data + sizeof(struct ethhdr));
-
-   pu8UdpBuffer = (char *)ih + sizeof(struct iphdr);
-   if (buff_to_send[35] == 67 && buff_to_send[37] == 68)
-   PRINT_D(RX_DBG, "DHCP Message received\n");
-   if (buff_to_send[12] == 0x88 && buff_to_send[13] == 0x8e)
-   PRINT_D(GENERIC_DBG, "eapol received\n");
-   #endif
/* Send the packet to the stack by giving it to the bridge */
nic->netstats.rx_packets++;
nic->netstats.rx_bytes += frame_len;
@@ -2036,10 +2004,6 @@ void frmw_to_linux(u8 *buff, u32 size, u32 pkt_offset)
stats = netif_rx(skb);
PRINT_D(RX_DBG, "netif_rx ret value is: %d\n", stats);
}
-   #ifndef TCP_ENHANCEMENTS
-   else
-   PRINT_ER("Discard sending packet with len = %d\n", size);
-   #endif
 }
 
 void WILC_WFI_mgmt_rx(u8 *buff, u32 size)
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 468b632..a2c80db 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1663,12 +1663,10 @@ static int get_station(struct wiphy *wiphy, struct 
net_device *dev,
sinfo->tx_failed=  strStatistics.u32TxFailureCount;
sinfo->txrate.legacy = strStatistics.u8LinkSpeed * 10;
 
-#ifdef TCP_ENHANCEMENTS
if ((strStatistics.u8LinkSpeed > 
TCP_ACK_FILTER_LINK_SPEED_THRESH) && (strStatistics.u8LinkSpeed != 
DEFAULT_LINK_SPEED))
Enable_TCP_ACK_Filter(true);
else if (strStatistics.u8LinkSpeed != DEFAULT_LINK_SPEED)
Enable_TCP_ACK_Filter(false);
-#endif
 
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);
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
index dff8265..4d37c4e 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
@@ -101,10 +101,8 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size);
 int WILC_WFI_deinit_mon_interface(void);
 struct net_device *WILC_WFI_init_mon_interface(const char *name, struct 
net_de

[PATCH 6/8] staging: wilc1000: remove unused semaphore and it's related codes

2015-09-16 Thread Tony Cho
From: Glen Lee 

Variable rxq_event, rxq_wait_event and rxq_wait have the same pointer.

nwi->os_context.rxq_wait_event = (void *)&g_linux_wlan->rxq_event;
g_wlan.rxq_wait = inp->os_context.rxq_wait_event;

They are never aquired(down) since down function was only called in
linux_wlan_rxq_task which was deleted in a previous patch.
So delete variable rxq_event, rxq_wait_event, rxq_wait and it's related codes.

Signed-off-by: Glen Lee 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/linux_wlan.c | 9 -
 drivers/staging/wilc1000/wilc_wfi_netdevice.h | 1 -
 drivers/staging/wilc1000/wilc_wlan.c  | 3 ---
 drivers/staging/wilc1000/wilc_wlan_if.h   | 1 -
 4 files changed, 14 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index f104a23..186e42e 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1088,10 +1088,6 @@ void wilc1000_wlan_deinit(linux_wlan_t *nic)
  #endif
#endif
 
-   /* not sure if the following unlocks are needed or not*/
-   if (&g_linux_wlan->rxq_event != NULL)
-   up(&g_linux_wlan->rxq_event);
-
if (&g_linux_wlan->txq_event != NULL)
up(&g_linux_wlan->txq_event);
 
@@ -1156,7 +1152,6 @@ int wlan_init_locks(linux_wlan_t *p_nic)
sema_init(&g_linux_wlan->txq_add_to_head_cs, 1);
 
sema_init(&g_linux_wlan->txq_event, 0);
-   sema_init(&g_linux_wlan->rxq_event, 0);
 
sema_init(&g_linux_wlan->cfg_event, 0);
sema_init(&g_linux_wlan->sync_event, 0);
@@ -1207,7 +1202,6 @@ void linux_to_wlan(wilc_wlan_inp_t *nwi, linux_wlan_t 
*nic)
nwi->os_context.rx_buffer_size = LINUX_RX_SIZE;
 #endif
nwi->os_context.rxq_critical_section = (void *)&g_linux_wlan->rxq_cs;
-   nwi->os_context.rxq_wait_event = (void *)&g_linux_wlan->rxq_event;
nwi->os_context.cfg_wait_event = (void *)&g_linux_wlan->cfg_event;
 
nwi->os_func.os_debug = linux_wlan_dbg;
@@ -1282,7 +1276,6 @@ int wlan_initialize_threads(perInterface_wlan_t *nic)
 _fail_2:
/*De-Initialize 2nd thread*/
g_linux_wlan->close = 1;
-   up(&g_linux_wlan->rxq_event);
kthread_stop(g_linux_wlan->rxq_thread);
 
#if (RX_BH_TYPE == RX_BH_KTHREAD)
@@ -1301,8 +1294,6 @@ static void wlan_deinitialize_threads(linux_wlan_t *nic)
 
g_linux_wlan->close = 1;
PRINT_D(INIT_DBG, "Deinitializing Threads\n");
-   if (&g_linux_wlan->rxq_event != NULL)
-   up(&g_linux_wlan->rxq_event);
 
if (g_linux_wlan->rxq_thread != NULL) {
kthread_stop(g_linux_wlan->rxq_thread);
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h 
b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index c68df360..c98eab6 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -187,7 +187,6 @@ typedef struct {
struct mutex rxq_cs;
struct mutex hif_cs;
 
-   struct semaphore rxq_event;
struct semaphore cfg_event;
struct semaphore sync_event;
struct semaphore txq_event;
diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 1db4cc8..22310cc 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -90,7 +90,6 @@ typedef struct {
struct rxq_entry_t *rxq_head;
struct rxq_entry_t *rxq_tail;
int rxq_entries;
-   void *rxq_wait;
int rxq_exit;
 
 
@@ -1398,7 +1397,6 @@ _end_:
rqe->buffer_size = size;
PRINT_D(RX_DBG, "rxq entery Size= %d - Address 
= %p\n", rqe->buffer_size, rqe->buffer);
wilc_wlan_rxq_add(rqe);
-   up(p->rxq_wait);
}
} else {
 #ifndef MEMORY_STATIC
@@ -2049,7 +2047,6 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t 
*oup)
 
g_wlan.rxq_lock = inp->os_context.rxq_critical_section;
g_wlan.txq_wait = inp->os_context.txq_wait_event;
-   g_wlan.rxq_wait = inp->os_context.rxq_wait_event;
g_wlan.cfg_wait = inp->os_context.cfg_wait_event;
g_wlan.tx_buffer_size = inp->os_context.tx_buffer_size;
 #if defined (MEMORY_STATIC)
diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index 3f5aa44..bccfcf9 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -137,7 +137,6 @@ typedef struct {
u32 rx_buffer_size;
 #endif
void *rxq_critical_section;
-   void *rxq_wait_event;
 
struct semaphore *cfg_wait_event;
 } wilc_wlan_os_context_t;
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/m

[PATCH 8/8] staging: wilc1000: remove unused variable rxq_thread

2015-09-16 Thread Tony Cho
From: Glen Lee 

The rxq_thread never runs since it's kthread_run code was delete in a previous
patch. Remove kthread_run and it's related codes.

Signed-off-by: Glen Lee 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/linux_wlan.c | 6 --
 drivers/staging/wilc1000/wilc_wfi_netdevice.h | 1 -
 2 files changed, 7 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 186e42e..a4f43d2 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1276,7 +1276,6 @@ int wlan_initialize_threads(perInterface_wlan_t *nic)
 _fail_2:
/*De-Initialize 2nd thread*/
g_linux_wlan->close = 1;
-   kthread_stop(g_linux_wlan->rxq_thread);
 
#if (RX_BH_TYPE == RX_BH_KTHREAD)
/*De-Initialize 1st thread*/
@@ -1295,11 +1294,6 @@ static void wlan_deinitialize_threads(linux_wlan_t *nic)
g_linux_wlan->close = 1;
PRINT_D(INIT_DBG, "Deinitializing Threads\n");
 
-   if (g_linux_wlan->rxq_thread != NULL) {
-   kthread_stop(g_linux_wlan->rxq_thread);
-   g_linux_wlan->rxq_thread = NULL;
-   }
-
if (&g_linux_wlan->txq_event != NULL)
up(&g_linux_wlan->txq_event);
 
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h 
b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index c98eab6..aa96ef3 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -199,7 +199,6 @@ typedef struct {
 #endif
struct semaphore txq_thread_started;
 
-   struct task_struct *rxq_thread;
struct task_struct *txq_thread;
 
unsigned char eth_src_address[NUM_CONCURRENT_IFC][6];
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 5/8] staging: wilc1000: remove variable rxq_thread_started

2015-09-16 Thread Tony Cho
From: Glen Lee 

rxq_thread_started is initiallized but never used in the driver. Remove
the variable and init code line.

Signed-off-by: Glen Lee 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/linux_wlan.c | 1 -
 drivers/staging/wilc1000/wilc_wfi_netdevice.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index de04779..f104a23 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1161,7 +1161,6 @@ int wlan_init_locks(linux_wlan_t *p_nic)
sema_init(&g_linux_wlan->cfg_event, 0);
sema_init(&g_linux_wlan->sync_event, 0);
 
-   sema_init(&g_linux_wlan->rxq_thread_started, 0);
sema_init(&g_linux_wlan->txq_thread_started, 0);
 
#if (RX_BH_TYPE == RX_BH_KTHREAD)
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h 
b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index 27c9ccf..c68df360 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -198,7 +198,6 @@ typedef struct {
struct task_struct *rx_bh_thread;
struct semaphore rx_sem;
 #endif
-   struct semaphore rxq_thread_started;
struct semaphore txq_thread_started;
 
struct task_struct *rxq_thread;
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 7/8] staging: wicl1000: remove function pointer wlan_handle_rx_que

2015-09-16 Thread Tony Cho
From: Glen Lee 

The function pointer wlan_handle_rx_que is not called anywhere. Delete
wlan_handle_rx_que and it's assignment code.
But the function wilc_wlan_handle_rxq in assignment code is used. So leave it.

Signed-off-by: Glen Lee 
Signed-off-by: Tony Cho 
---
 drivers/staging/wilc1000/wilc_wlan.c| 1 -
 drivers/staging/wilc1000/wilc_wlan_if.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 22310cc..17f66e7 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -2126,7 +2126,6 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t 
*oup)
oup->wlan_stop = wilc_wlan_stop;
oup->wlan_add_to_tx_que = wilc_wlan_txq_add_net_pkt;
oup->wlan_handle_tx_que = wilc_wlan_handle_txq;
-   oup->wlan_handle_rx_que = wilc_wlan_handle_rxq;
oup->wlan_handle_rx_isr = wilc_handle_isr;
oup->wlan_cleanup = wilc_wlan_cleanup;
oup->wlan_cfg_set = wilc_wlan_cfg_set;
diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index bccfcf9..cc92dc9 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -167,7 +167,6 @@ typedef struct {
int (*wlan_stop)(void);
int (*wlan_add_to_tx_que)(void *, u8 *, u32, wilc_tx_complete_func_t);
int (*wlan_handle_tx_que)(u32 *);
-   void (*wlan_handle_rx_que)(void);
void (*wlan_handle_rx_isr)(void);
void (*wlan_cleanup)(void);
int (*wlan_cfg_set)(int, u32, u8 *, u32, int, u32);
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/10] staging: wilc1000: wilc_wlan.c: use BIT(x) macro

2015-09-16 Thread Chaehyun Lim
Remove bit shift macro that is custom defined, then replace BIT(x)
macro.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_wlan.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 7496c1f..add9eeb 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -2177,7 +2177,6 @@ _fail_:
 
 }
 
-#define BIT31 (1 << 31)
 u16 Set_machw_change_vir_if(bool bValue)
 {
u16 ret;
@@ -2191,9 +2190,9 @@ u16 Set_machw_change_vir_if(bool bValue)
}
 
if (bValue)
-   reg |= (BIT31);
+   reg |= BIT(31);
else
-   reg &= ~(BIT31);
+   reg &= ~BIT(31);
 
ret = (&g_wlan)->hif_func.hif_write_reg(WILC_CHANGING_VIR_IF, reg);
 
-- 
2.5.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 03/10] staging: wilc1000: remove INLINE macro

2015-09-16 Thread Chaehyun Lim
This patch removes INLINE macro that is used anymore.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/coreconfigurator.c | 1 -
 drivers/staging/wilc1000/wilc_wlan.c| 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c 
b/drivers/staging/wilc1000/coreconfigurator.c
index 9605517..f15ca3b 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -16,7 +16,6 @@
 /*/
 /* Constants */
 /*/
-#define INLINE static __inline
 #define PHY_802_11n
 #define MAX_CFG_PKTLEN 1450
 #define MSG_HEADER_LEN 4
diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 4ea7de4..a3e6973 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -9,7 +9,6 @@
 
 #include "wilc_wlan_if.h"
 #include "wilc_wlan.h"
-#define INLINE static __inline
 
 /
  *
-- 
2.5.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 04/10] staging: wilc1000: replace __inline with inline

2015-09-16 Thread Chaehyun Lim
This patch replaces __inline with inline. plain inline is more
preferred than __inline.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_wlan.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index a3e6973..d27ef47 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -317,13 +317,13 @@ u32 Pending_Acks;
 
 
 
-static __inline int Init_TCP_tracking(void)
+static inline int Init_TCP_tracking(void)
 {
 
return 0;
 
 }
-static __inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq)
+static inline int add_TCP_track_session(u32 src_prt, u32 dst_prt, u32 seq)
 {
Acks_keep_track_info[Opened_TCP_session].Ack_seq_num = seq;
Acks_keep_track_info[Opened_TCP_session].Bigger_Ack_num = 0;
@@ -335,7 +335,7 @@ static __inline int add_TCP_track_session(u32 src_prt, u32 
dst_prt, u32 seq)
return 0;
 }
 
-static __inline int Update_TCP_track_session(u32 index, u32 Ack)
+static inline int Update_TCP_track_session(u32 index, u32 Ack)
 {
 
if (Ack > Acks_keep_track_info[index].Bigger_Ack_num) {
@@ -344,7 +344,7 @@ static __inline int Update_TCP_track_session(u32 index, u32 
Ack)
return 0;
 
 }
-static __inline int add_TCP_Pending_Ack(u32 Ack, u32 Session_index, struct 
txq_entry_t  *txqe)
+static inline int add_TCP_Pending_Ack(u32 Ack, u32 Session_index, struct 
txq_entry_t  *txqe)
 {
Statisitcs_totalAcks++;
if (Pending_Acks < MAX_PENDING_ACKS) {
@@ -359,7 +359,7 @@ static __inline int add_TCP_Pending_Ack(u32 Ack, u32 
Session_index, struct txq_e
}
return 0;
 }
-static __inline int remove_TCP_related(void)
+static inline int remove_TCP_related(void)
 {
wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
unsigned long flags;
@@ -370,7 +370,7 @@ static __inline int remove_TCP_related(void)
return 0;
 }
 
-static __inline int tcp_process(struct txq_entry_t *tqe)
+static inline int tcp_process(struct txq_entry_t *tqe)
 {
int ret;
u8 *eth_hdr_ptr;
-- 
2.5.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 02/10] staging: wilc1000: replace INLINE with static inline

2015-09-16 Thread Chaehyun Lim
INLINE macro is defined as static __inline so that it is replaced by
static inline.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/coreconfigurator.c | 30 ++---
 drivers/staging/wilc1000/wilc_wlan.c| 16 +++
 2 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c 
b/drivers/staging/wilc1000/coreconfigurator.c
index 8164a33..9605517 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -301,7 +301,7 @@ u16 g_num_total_switches = (sizeof(gastrWIDs) / 
sizeof(tstrWID));
 
 /* This function extracts the beacon period field from the beacon or probe   */
 /* response frame.   */
-INLINE u16 get_beacon_period(u8 *data)
+static inline u16 get_beacon_period(u8 *data)
 {
u16 bcn_per = 0;
 
@@ -311,7 +311,7 @@ INLINE u16 get_beacon_period(u8 *data)
return bcn_per;
 }
 
-INLINE u32 get_beacon_timestamp_lo(u8 *data)
+static inline u32 get_beacon_timestamp_lo(u8 *data)
 {
u32 time_stamp = 0;
u32 index= MAC_HDR_LEN;
@@ -324,7 +324,7 @@ INLINE u32 get_beacon_timestamp_lo(u8 *data)
return time_stamp;
 }
 
-INLINE u32 get_beacon_timestamp_hi(u8 *data)
+static inline u32 get_beacon_timestamp_hi(u8 *data)
 {
u32 time_stamp = 0;
u32 index= (MAC_HDR_LEN + 4);
@@ -340,7 +340,7 @@ INLINE u32 get_beacon_timestamp_hi(u8 *data)
 /* This function extracts the 'frame type and sub type' bits from the MAC*/
 /* header of the input frame.*/
 /* Returns the value in the LSB of the returned value.   */
-INLINE tenuFrmSubtype get_sub_type(u8 *header)
+static inline tenuFrmSubtype get_sub_type(u8 *header)
 {
return ((tenuFrmSubtype)(header[0] & 0xFC));
 }
@@ -348,7 +348,7 @@ INLINE tenuFrmSubtype get_sub_type(u8 *header)
 /* This function extracts the 'to ds' bit from the MAC header of the input   */
 /* frame.*/
 /* Returns the value in the LSB of the returned value.   */
-INLINE u8 get_to_ds(u8 *header)
+static inline u8 get_to_ds(u8 *header)
 {
return (header[1] & 0x01);
 }
@@ -356,28 +356,28 @@ INLINE u8 get_to_ds(u8 *header)
 /* This function extracts the 'from ds' bit from the MAC header of the input */
 /* frame.*/
 /* Returns the value in the LSB of the returned value.   */
-INLINE u8 get_from_ds(u8 *header)
+static inline u8 get_from_ds(u8 *header)
 {
return ((header[1] & 0x02) >> 1);
 }
 
 /* This function extracts the MAC Address in 'address1' field of the MAC */
 /* header and updates the MAC Address in the allocated 'addr' variable.  */
-INLINE void get_address1(u8 *pu8msa, u8 *addr)
+static inline void get_address1(u8 *pu8msa, u8 *addr)
 {
memcpy(addr, pu8msa + 4, 6);
 }
 
 /* This function extracts the MAC Address in 'address2' field of the MAC */
 /* header and updates the MAC Address in the allocated 'addr' variable.  */
-INLINE void get_address2(u8 *pu8msa, u8 *addr)
+static inline void get_address2(u8 *pu8msa, u8 *addr)
 {
memcpy(addr, pu8msa + 10, 6);
 }
 
 /* This function extracts the MAC Address in 'address3' field of the MAC */
 /* header and updates the MAC Address in the allocated 'addr' variable.  */
-INLINE void get_address3(u8 *pu8msa, u8 *addr)
+static inline void get_address3(u8 *pu8msa, u8 *addr)
 {
memcpy(addr, pu8msa + 16, 6);
 }
@@ -385,7 +385,7 @@ INLINE void get_address3(u8 *pu8msa, u8 *addr)
 /* This function extracts the BSSID from the incoming WLAN packet based on   */
 /* the 'from ds' bit, and updates the MAC Address in the allocated 'addr'*/
 /* variable. */
-INLINE void get_BSSID(u8 *data, u8 *bssid)
+static inline void get_BSSID(u8 *data, u8 *bssid)
 {
if (get_from_ds(data) == 1)
get_address2(data, bssid);
@@ -396,7 +396,7 @@ INLINE void get_BSSID(u8 *data, u8 *bssid)
 }
 
 /* This function extracts the SSID from a beacon/probe response frame*/
-INLINE void get_ssid(u8 *data, u8 *ssid, u8 *p_ssid_len)
+static inline void get_ssid(u8 *data, u8 *ssid, u8 *p_ssid_len)
 {
u8 len = 0;
u8 i   = 0;
@@ -422,7 +422,7 @@ INLINE void get_ssid(u8 *data, u8 *ssid, u8 *p_ssid_len)
 
 /* This function extracts the capability info field from the beacon or probe */
 /* response frame.   */
-INLINE u16 get_cap_info(u8 *data)
+static inline u16 get_cap_info(u8 *data)
 {
u16 cap_info = 0;
u16 index= MAC_HDR_LEN;
@@ -443,7 +443,7 @@ INLINE u16 get_cap_info(u8 *data)
 
 /* This function extracts the capability info field from the Associ

[PATCH 05/10] staging: wilc1000: replace int8_t with int

2015-09-16 Thread Chaehyun Lim
This patch replaces int8_t with int. just use return type as int.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 3ecf5b1..e04d97e 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -275,9 +275,9 @@ static void clear_duringIP(unsigned long arg)
 }
 #endif
 
-int8_t is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid)
+int is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid)
 {
-   int8_t state = -1;
+   int state = -1;
int i;
 
if (u32LastScannedNtwrksCountShadow == 0) {
@@ -300,7 +300,7 @@ int8_t is_network_in_shadow(tstrNetworkInfo 
*pstrNetworkInfo, void *pUserVoid)
 
 void add_network_to_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid, 
void *pJoinParams)
 {
-   int8_t ap_found = is_network_in_shadow(pstrNetworkInfo, pUserVoid);
+   int ap_found = is_network_in_shadow(pstrNetworkInfo, pUserVoid);
u32 ap_index = 0;
u8 rssi_index = 0;
 
-- 
2.5.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 06/10] staging: wilc1000: linux_wlan_spi.c: fix kzalloc error check

2015-09-16 Thread Chaehyun Lim
This patch fixs error check of kzalloc.
If kzalloc is failed, return type is used as -ENOMEM.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/linux_wlan_spi.c | 22 --
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan_spi.c 
b/drivers/staging/wilc1000/linux_wlan_spi.c
index 3e24256..51bbd96 100644
--- a/drivers/staging/wilc1000/linux_wlan_spi.c
+++ b/drivers/staging/wilc1000/linux_wlan_spi.c
@@ -125,10 +125,8 @@ int linux_spi_write(u8 *b, u32 len)
int remainder = len % TXRX_PHASE_SIZE;
 
char *r_buffer = kzalloc(TXRX_PHASE_SIZE, GFP_KERNEL);
-
-   if (!r_buffer) {
-   PRINT_ER("Failed to allocate memory for r_buffer\n");
-   }
+   if (!r_buffer)
+   return -ENOMEM;
 
if (blk) {
while (i < blk) {
@@ -208,10 +206,9 @@ int linux_spi_write(u8 *b, u32 len)
.delay_usecs = 0,
};
char *r_buffer = kzalloc(len, GFP_KERNEL);
+   if (!r_buffer)
+   return -ENOMEM;
 
-   if (!r_buffer) {
-   PRINT_ER("Failed to allocate memory for r_buffer\n");
-   }
tr.rx_buf = r_buffer;
PRINT_D(BUS_DBG, "Request writing %d bytes\n", len);
 
@@ -257,10 +254,8 @@ int linux_spi_read(unsigned char *rb, unsigned long rlen)
int remainder = rlen % TXRX_PHASE_SIZE;
 
char *t_buffer = kzalloc(TXRX_PHASE_SIZE, GFP_KERNEL);
-
-   if (!t_buffer) {
-   PRINT_ER("Failed to allocate memory for t_buffer\n");
-   }
+   if (!t_buffer)
+   return -ENOMEM;
 
if (blk) {
while (i < blk) {
@@ -337,10 +332,9 @@ int linux_spi_read(unsigned char *rb, unsigned long rlen)
 
};
char *t_buffer = kzalloc(rlen, GFP_KERNEL);
+   if (!t_buffer)
+   return -ENOMEM;
 
-   if (!t_buffer) {
-   PRINT_ER("Failed to allocate memory for t_buffer\n");
-   }
tr.tx_buf = t_buffer;
 
memset(&msg, 0, sizeof(msg));
-- 
2.5.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 08/10] staging: wilc1000: remove WILC_TIME typedef

2015-09-16 Thread Chaehyun Lim
This patch removes WILC_TIME typedef that is not used anymore.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_platform.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_platform.h 
b/drivers/staging/wilc1000/wilc_platform.h
index 5c867ec..b763616 100644
--- a/drivers/staging/wilc1000/wilc_platform.h
+++ b/drivers/staging/wilc1000/wilc_platform.h
@@ -33,8 +33,6 @@ typedef struct __MessageQueue_struct {
 
 
 
-/*Time represented in 64 bit format*/
-typedef time_t WILC_Time;
 
 
 /***
-- 
2.5.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/10] staging: wilc1000: remove unused defines

2015-09-16 Thread Chaehyun Lim
This patch removes unused defines.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/wilc_platform.h | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_platform.h 
b/drivers/staging/wilc1000/wilc_platform.h
index 1e56973..5c867ec 100644
--- a/drivers/staging/wilc1000/wilc_platform.h
+++ b/drivers/staging/wilc1000/wilc_platform.h
@@ -41,8 +41,4 @@ typedef time_t WILC_Time;
  *  others
  /
 
-/* Generic printf function */
-#define __WILC_FILE__  __FILE__
-#define __WILC_FUNCTION__  __func__
-#define __WILC_LINE__  __LINE__
 #endif
-- 
2.5.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 10/10] staging: wilc1000: remove declaration of wilc_get_chipid

2015-09-16 Thread Chaehyun Lim
This patch removes the declaration of wilc_get_chipid function.
It is included wilc_wlan_if.h that has declaration of wilc_get_chipid.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index e12c95d..4c88a60 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1,5 +1,6 @@
 #include "host_interface.h"
 #include "coreconfigurator.h"
+#include "wilc_wlan_if.h"
 
 extern u8 connecting;
 
@@ -7424,7 +7425,6 @@ s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv, 
tstrWILC_AddStaParam *pstrSt
return s32Error;
 }
 #endif /*WILC_AP_EXTERNAL_MLME*/
-u32 wilc_get_chipid(u8);
 
 s32 host_int_set_power_mgmt(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 
u32Timeout)
 {
-- 
2.5.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 09/10] staging: wilc1000: remove useless comment

2015-09-16 Thread Chaehyun Lim
This patch removes useless comment that is included "BugID_"

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 36 ---
 drivers/staging/wilc1000/host_interface.h |  4 ---
 drivers/staging/wilc1000/linux_wlan.c |  8 -
 drivers/staging/wilc1000/linux_wlan_common.h  |  1 -
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 42 ---
 drivers/staging/wilc1000/wilc_wfi_netdevice.h |  1 -
 drivers/staging/wilc1000/wilc_wlan.c  | 26 ++
 drivers/staging/wilc1000/wilc_wlan.h  |  1 -
 drivers/staging/wilc1000/wilc_wlan_if.h   |  9 -
 9 files changed, 2 insertions(+), 126 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 563063c..e12c95d 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -7,7 +7,6 @@ extern u8 connecting;
 extern struct timer_list hDuringIpTimer;
 #endif
 
-/*BugID_5137*/
 extern u8 g_wilc_initialized;
 /*/
 /* Macros  
 */
@@ -173,7 +172,6 @@ typedef struct _tstrHostIFscanAttr {
size_t IEsLen;
tWILCpfScanResult pfScanResult;
void *pvUserArg;
-   /*BugID_4189*/
tstrHiddenNetwork strHiddenNetwork;
 
 } tstrHostIFscanAttr;
@@ -569,7 +567,6 @@ static u8 gu8DelBcn;
 #endif
 static u32 gu32WidConnRstHack;
 
-/*BugID_5137*/
 u8 *gu8FlushedJoinReq;
 u8 *gu8FlushedInfoElemAsoc;
 u8 gu8Flushed11iMode;
@@ -920,7 +917,6 @@ static s32 Handle_SetMacAddress(tstrWILC_WFIDrv 
*drvHandler, tstrHostIfSetMacAdd
 }
 
 
-/*BugID_5213*/
 /**
  *  @brief Handle_GetMacAddress
  *  @detailsGetting mac address
@@ -1331,7 +1327,6 @@ static s32 Handle_Scan(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFscanAttr *pstrHost
 
pstrWFIDrv->strWILC_UsrScanReq.u32RcvdChCount = 0;
 
-   /*BugID_4189*/
strWIDList[u32WidsCount].u16WIDid = (u16)WID_SSID_PROBE_REQ;
strWIDList[u32WidsCount].enuWIDtype = WID_STR;
 
@@ -1477,7 +1472,6 @@ static s32 Handle_ScanDone(tstrWILC_WFIDrv *drvHandler, 
tenuScanEvent enuEvent)
 
PRINT_D(HOSTINF_DBG, "in Handle_ScanDone()\n");
 
-   /*BugID_4978*/
/*Ask FW to abort the running scan, if any*/
if (enuEvent == SCAN_EVENT_ABORTED) {
PRINT_D(GENERIC_DBG, "Abort running scan\n");
@@ -1774,7 +1768,6 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFconnectAttr *ps
strWIDList[u32WidsCount].s32ValueSize = 
pstrWFIDrv->strWILC_UsrConnReq.ConnReqIEsLen;
u32WidsCount++;
 
-   /*BugID_5137*/
if (memcmp("DIRECT-", pstrHostIFconnectAttr->pu8ssid, 7)) {
 
gu32FlushedInfoElemAsocSize = 
pstrWFIDrv->strWILC_UsrConnReq.ConnReqIEsLen;
@@ -1789,7 +1782,6 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFconnectAttr *ps
strWIDList[u32WidsCount].ps8WidVal = (s8 
*)(&(pstrWFIDrv->strWILC_UsrConnReq.u8security));
u32WidsCount++;
 
-   /*BugID_5137*/
if (memcmp("DIRECT-", pstrHostIFconnectAttr->pu8ssid, 7))
gu8Flushed11iMode = pstrWFIDrv->strWILC_UsrConnReq.u8security;
 
@@ -1802,7 +1794,6 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFconnectAttr *ps
strWIDList[u32WidsCount].ps8WidVal = (s8 
*)(&pstrWFIDrv->strWILC_UsrConnReq.tenuAuth_type);
u32WidsCount++;
 
-   /*BugID_5137*/
if (memcmp("DIRECT-", pstrHostIFconnectAttr->pu8ssid, 7))
gu8FlushedAuthType = 
(u8)pstrWFIDrv->strWILC_UsrConnReq.tenuAuth_type;
 
@@ -1857,7 +1848,6 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFconnectAttr *ps
strWIDList[u32WidsCount].s32ValueSize = 112; /* 79; */
strWIDList[u32WidsCount].ps8WidVal = 
kmalloc(strWIDList[u32WidsCount].s32ValueSize, GFP_KERNEL);
 
-   /*BugID_5137*/
if (memcmp("DIRECT-", pstrHostIFconnectAttr->pu8ssid, 7)) {
gu32FlushedJoinReqSize = strWIDList[u32WidsCount].s32ValueSize;
gu8FlushedJoinReq = kmalloc(gu32FlushedJoinReqSize, GFP_KERNEL);
@@ -1941,7 +1931,6 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFconnectAttr *ps
memcpy(pu8CurrByte, ptstrJoinBssParam->rsn_cap, 
sizeof(ptstrJoinBssParam->rsn_cap));
pu8CurrByte += sizeof(ptstrJoinBssParam->rsn_cap);
 
-   /*BugID_5137*/
*(pu8CurrByte++) = REAL_JOIN_REQ;
 
#ifdef WILC_P2P
@@ -1994,7 +1983,6 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, 
tstrHostIFconnectAttr *ps
gu32WidConnRstHack = 0;
/* // */
 
-   /*BugID_5137*/
if (memcmp("DIRECT-", pstrHostIFconnectAttr->pu8ssid, 7)) {
me

[PATCH v2] staging: lustre: lnet: lnet: Removed a space

2015-09-16 Thread Anjali Menon
Removed a space to fix the following coding style warning detected by
checkpatch:

WARNING: space prohibited between function name and open parenthesis '('

Signed-off-by: Anjali Menon 
---

Modified the subject

 drivers/staging/lustre/lnet/lnet/router.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lnet/lnet/router.c 
b/drivers/staging/lustre/lnet/lnet/router.c
index 8510bae..be23e06 100644
--- a/drivers/staging/lustre/lnet/lnet/router.c
+++ b/drivers/staging/lustre/lnet/lnet/router.c
@@ -1511,7 +1511,7 @@ lnet_notify(lnet_ni_t *ni, lnet_nid_t nid, int alive, 
unsigned long when)
unsigned long   now = cfs_time_current();
int cpt = lnet_cpt_of_nid(nid);
 
-   LASSERT(!in_interrupt ());
+   LASSERT(!in_interrupt());
 
CDEBUG(D_NET, "%s notifying %s: %s\n",
(ni == NULL) ? "userspace" : libcfs_nid2str(ni->ni_nid),
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: wilc1000: Added new lines

2015-09-16 Thread Aparna Karuthodi
Added new lines after declarations for removing coding style warnings
detected by checkpatch.The warnings are given below:

1561: WARNING: Missing a blank line after declarations
1551: WARNING: Missing a blank line after declarations
1329: WARNING: Missing a blank line after declarations
1213: WARNING: Missing a blank line after declarations
1158: WARNING: Missing a blank line after declarations
1104: WARNING: Missing a blank line after declarations
675: WARNING: Missing a blank line after declarations

Signed-off-by: Aparna Karuthodi 
---
 drivers/staging/wilc1000/coreconfigurator.c |7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c 
b/drivers/staging/wilc1000/coreconfigurator.c
index 5241699..dad03f3 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -669,6 +669,7 @@ INLINE u16 get_asoc_id(u8 *data)
 s32 CoreConfiguratorInit(void)
 {
s32 s32Error = WILC_SUCCESS;
+
PRINT_D(CORECONFIG_DBG, "CoreConfiguratorInit()\n");
 
sema_init(&SemHandleSendPkt, 1);
@@ -1098,6 +1099,7 @@ void ProcessCharWid(char *pcPacket, s32 *ps32PktLen,
u8 *pu8val = (u8 *)ps8WidVal;
u8 u8val = 0;
s32 s32PktLen = *ps32PktLen;
+
if (pstrWID == NULL) {
PRINT_WRN(CORECONFIG_DBG, "Can't set CHAR val 0x%x ,NULL 
structure\n", u8val);
return;
@@ -1152,6 +1154,7 @@ void ProcessShortWid(char *pcPacket, s32 *ps32PktLen,
u16 *pu16val = (u16 *)ps8WidVal;
u16 u16val = 0;
s32 s32PktLen = *ps32PktLen;
+
if (pstrWID == NULL) {
PRINT_WRN(CORECONFIG_DBG, "Can't set SHORT val 0x%x ,NULL 
structure\n", u16val);
return;
@@ -1207,6 +1210,7 @@ void ProcessIntWid(char *pcPacket, s32 *ps32PktLen,
u32 *pu32val = (u32 *)ps8WidVal;
u32 u32val = 0;
s32 s32PktLen = *ps32PktLen;
+
if (pstrWID == NULL) {
PRINT_WRN(CORECONFIG_DBG, "Can't set INT val 0x%x , NULL 
structure\n", u32val);
return;
@@ -1323,6 +1327,7 @@ void ProcessStrWid(char *pcPacket, s32 *ps32PktLen,
u16 u16MsgLen = 0;
u16 idx= 0;
s32 s32PktLen = *ps32PktLen;
+
if (pstrWID == NULL) {
PRINT_WRN(CORECONFIG_DBG, "Can't set STR val, NULL 
structure\n");
return;
@@ -1545,6 +1550,7 @@ s32 further_process_response(u8 *resp,
case WID_SHORT:
{
u16 *pu16val = (u16 *)(pstrWIDresult->ps8WidVal);
+
cfg_sht = MAKE_WORD16(resp[idx], resp[idx + 1]);
/*Set local copy of WID*/
/* pstrWIDresult->ps8WidVal = (s8*)(s32)cfg_sht; */
@@ -1555,6 +1561,7 @@ s32 further_process_response(u8 *resp,
case WID_INT:
{
u32 *pu32val = (u32 *)(pstrWIDresult->ps8WidVal);
+
cfg_int = MAKE_WORD32(
MAKE_WORD16(resp[idx], resp[idx + 1]),
MAKE_WORD16(resp[idx + 2], resp[idx + 3])
-- 
1.7.9.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: lustre: lustre: mdc: lproc_mdc.c: declared file_operations struct as const

2015-09-16 Thread Sakshi Vaid
Declared the file_operations structure as const as done elsewhere in the
kernel, as there are no modifiactions to this field.

Following warning found by checkpatch
WARNING: struct file_operations should normally be const

Signed-off-by: Sakshi Vaid 
---
 drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c 
b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
index c791941..c62c0ac 100644
--- a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
+++ b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
@@ -146,7 +146,7 @@ static ssize_t mdc_kuc_write(struct file *file,
return count;
 }
 
-struct file_operations mdc_kuc_fops = {
+const struct file_operations mdc_kuc_fops = {
.open   = mdc_kuc_open,
.write  = mdc_kuc_write,
.release= single_release,
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: lustre: lustre: mgc: mgc_request.c: Removed unnecessary space

2015-09-16 Thread Sakshi Vaid
Removed the unnecessary space in the declaration of a pointer.
The following error was given.
ERROR: "foo *   bar" should be "foo *bar"

Signed-off-by: Sakshi Vaid 
---
 drivers/staging/lustre/lustre/mgc/mgc_request.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c 
b/drivers/staging/lustre/lustre/mgc/mgc_request.c
index 60d2b0f..8d3dbdc 100644
--- a/drivers/staging/lustre/lustre/mgc/mgc_request.c
+++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c
@@ -160,7 +160,7 @@ struct config_llog_data *config_log_find(char *logname,
 {
struct config_llog_data *cld;
struct config_llog_data *found = NULL;
-   void * instance;
+   void *instance;
 
LASSERT(logname != NULL);
 
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: wlan-ng: fix a wrong type of a assignment

2015-09-16 Thread Navy Cheng
The type of value is u16 however the return type of cpu_to_le16() is
__le16. The incorrect type of assignment is complained by sparse.

Signed-off-by: Navy Cheng 
---
 drivers/staging/wlan-ng/hfa384x.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wlan-ng/hfa384x.h 
b/drivers/staging/wlan-ng/hfa384x.h
index 8dfe438..fe7df37 100644
--- a/drivers/staging/wlan-ng/hfa384x.h
+++ b/drivers/staging/wlan-ng/hfa384x.h
@@ -1385,7 +1385,7 @@ static inline int hfa384x_drvr_getconfig16(hfa384x_t *hw, 
u16 rid, void *val)
 
 static inline int hfa384x_drvr_setconfig16(hfa384x_t *hw, u16 rid, u16 val)
 {
-   u16 value = cpu_to_le16(val);
+   __le16 value = cpu_to_le16(val);
 
return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value));
 }
-- 
2.1.4


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: dgap: Remove myself from the MAINTAINERS file

2015-09-16 Thread Greg Kroah-Hartman
On Wed, Sep 16, 2015 at 10:30:37AM +0530, Sudip Mukherjee wrote:
> On Tue, Sep 15, 2015 at 06:05:29AM -0700, Greg Kroah-Hartman wrote:
> > On Tue, Sep 15, 2015 at 08:56:10AM -0400, Mark Hounschell wrote:
> 
> > > 
> > > Signed-off-by: Mark Hounschell 
> > > Cc: Greg Kroah-Hartman 
> > > Cc: Ben Hutchings 
> > > ---
> > >  MAINTAINERS | 1 -
> > >  1 file changed, 1 deletion(-)
> > 
> > Shouldn't we also just delete the driver?
> > 
> > sad times,
> You once said in another thread that "staging is not for dumping crap".
> Can't we have a separate dumping ground in kernel where drivers like
> this and the "mali" from the other thread can stay? Only if the opensourced
> part is added there?

Nope, sorry, why would we want "unmaintained crap that no one wishes to
support" in our tree?  Same goes for "mali", it's totally unmaintained,
and the author of it wishes for it to _not_ be included in the upstream
kernel sources.

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 17/19] staging/lustre: Remove IS_SERVER and all users

2015-09-16 Thread Oleg Drokin

On Sep 16, 2015, at 1:35 AM, Sudip Mukherjee wrote:

> On Tue, Sep 15, 2015 at 08:30:41PM -0400, gr...@linuxhacker.ru wrote:
>> From: Oleg Drokin 
>> 
>> Since the client can never be server, this is all dead code.
>> 
>> Signed-off-by: Oleg Drokin 
>> ---
> OOPS.. build fails with error:
> error: ‘lsi’ undeclared (first use in this function)

Ah, you are right.
Fused the fix in the frong commit. :(

Thanks, I'll resend.

Bye,
Oleg
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: most: Add dependency to HAS_IOMEM

2015-09-16 Thread Christian Gromm
This patch prevents the module hdm_dim2 from breaking the build in case
HAS_IOMEM is not configured.

Reported-by: 
Signed-off-by: Christian Gromm 
---
 drivers/staging/most/hdm-dim2/Kconfig |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/most/hdm-dim2/Kconfig 
b/drivers/staging/most/hdm-dim2/Kconfig
index 1d4ad1d..fc54876 100644
--- a/drivers/staging/most/hdm-dim2/Kconfig
+++ b/drivers/staging/most/hdm-dim2/Kconfig
@@ -5,6 +5,7 @@
 config HDM_DIM2
tristate "DIM2 HDM"
depends on AIM_NETWORK
+   depends on HAS_IOMEM
 
---help---
  Say Y here if you want to connect via MediaLB to network transceiver.
-- 
1.7.9.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/3] VME bus error handling overhaul

2015-09-16 Thread Dmitry Kalinkin

> On 05 Aug 2015, at 16:12, Greg Kroah-Hartman  
> wrote:
> 
> On Mon, Jul 06, 2015 at 01:31:47PM +0100, Martyn Welch wrote:
>> Hi Dmitry,
>> 
>> These are looking good to me.
> 
> Can I get an "Acked-by:" or something so that I know it's ok to apply
> these?
> 
> thanks,
> 
> greg k-h-

Now that we have next cycle, should I resend these?
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/3] VME bus error handling overhaul

2015-09-16 Thread Greg Kroah-Hartman
On Wed, Sep 16, 2015 at 11:39:22AM -0400, Dmitry Kalinkin wrote:
> 
> > On 05 Aug 2015, at 16:12, Greg Kroah-Hartman  
> > wrote:
> > 
> > On Mon, Jul 06, 2015 at 01:31:47PM +0100, Martyn Welch wrote:
> >> Hi Dmitry,
> >> 
> >> These are looking good to me.
> > 
> > Can I get an "Acked-by:" or something so that I know it's ok to apply
> > these?
> > 
> > thanks,
> > 
> > greg k-h-
> 
> Now that we have next cycle, should I resend these?

That would be good.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/3] VME bus error handling overhaul

2015-09-16 Thread Dmitry Kalinkin

> On 16 Sep 2015, at 11:53, Greg Kroah-Hartman  
> wrote:
> 
> On Wed, Sep 16, 2015 at 11:39:22AM -0400, Dmitry Kalinkin wrote:
>> 
>>> On 05 Aug 2015, at 16:12, Greg Kroah-Hartman  
>>> wrote:
>>> 
>>> On Mon, Jul 06, 2015 at 01:31:47PM +0100, Martyn Welch wrote:
 Hi Dmitry,
 
 These are looking good to me.
>>> 
>>> Can I get an "Acked-by:" or something so that I know it's ok to apply
>>> these?
>>> 
>>> thanks,
>>> 
>>> greg k-h-
>> 
>> Now that we have next cycle, should I resend these?
> 
> That would be good.

It seems like Martyn’s email is dead, it gives me a delivery failure with:

550 5.1.1 No such user - pp

Not sure how to proceed in this case.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[patch] IB/hfi1: mask vs shift confusion

2015-09-16 Thread Dan Carpenter
We are shifting by the _MASK macros instead of the _SHIFT ones.

Signed-off-by: Dan Carpenter 

diff --git a/drivers/staging/rdma/hfi1/sdma.c b/drivers/staging/rdma/hfi1/sdma.c
index a8c903c..3a457d2 100644
--- a/drivers/staging/rdma/hfi1/sdma.c
+++ b/drivers/staging/rdma/hfi1/sdma.c
@@ -1848,7 +1848,7 @@ static void dump_sdma_state(struct sdma_engine *sde)
dd_dev_err(sde->dd,
"\taidx: %u amode: %u alen: %u\n",
(u8)((desc[1] & SDMA_DESC1_HEADER_INDEX_SMASK)
-   >> SDMA_DESC1_HEADER_INDEX_MASK),
+   >> SDMA_DESC1_HEADER_INDEX_SHIFT),
(u8)((desc[1] & SDMA_DESC1_HEADER_MODE_SMASK)
>> SDMA_DESC1_HEADER_MODE_SHIFT),
(u8)((desc[1] & SDMA_DESC1_HEADER_DWS_SMASK)
@@ -1926,7 +1926,7 @@ void sdma_seqfile_dump_sde(struct seq_file *s, struct 
sdma_engine *sde)
if (desc[0] & SDMA_DESC0_FIRST_DESC_FLAG)
seq_printf(s, "\t\tahgidx: %u ahgmode: %u\n",
(u8)((desc[1] & SDMA_DESC1_HEADER_INDEX_SMASK)
-   >> SDMA_DESC1_HEADER_INDEX_MASK),
+   >> SDMA_DESC1_HEADER_INDEX_SHIFT),
(u8)((desc[1] & SDMA_DESC1_HEADER_MODE_SMASK)
>> SDMA_DESC1_HEADER_MODE_SHIFT));
head = (head + 1) & sde->sdma_mask;
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[patch] IB/hfi1: clean up some defines

2015-09-16 Thread Dan Carpenter
I added spaces around operators so it matches kernel style because
normally "-1ULL" is a number and " - 1" is a subtract operation.  Also
removed some superflous "ULL" types so "1ULL" becomes "1".

Signed-off-by: Dan Carpenter 

diff --git a/drivers/staging/rdma/hfi1/sdma.h b/drivers/staging/rdma/hfi1/sdma.h
index 1e613fc..4960869 100644
--- a/drivers/staging/rdma/hfi1/sdma.h
+++ b/drivers/staging/rdma/hfi1/sdma.h
@@ -109,53 +109,53 @@
 /*
  * Bits defined in the send DMA descriptor.
  */
-#define SDMA_DESC0_FIRST_DESC_FLAG  (1ULL<<63)
-#define SDMA_DESC0_LAST_DESC_FLAG   (1ULL<<62)
+#define SDMA_DESC0_FIRST_DESC_FLAG  (1ULL << 63)
+#define SDMA_DESC0_LAST_DESC_FLAG   (1ULL << 62)
 #define SDMA_DESC0_BYTE_COUNT_SHIFT 48
 #define SDMA_DESC0_BYTE_COUNT_WIDTH 14
 #define SDMA_DESC0_BYTE_COUNT_MASK \
-   ((1ULL

[PATCH] staging: wilc1000: Removed unwanted curly braces

2015-09-16 Thread Aparna Karuthodi
Removed unwanted curly braces of a single statement if-else block to
remove a coding style warning detected by checkpatch. The warning is
given below:

58: WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: Aparna Karuthodi 
---
 drivers/staging/wilc1000/fifo_buffer.c |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/fifo_buffer.c 
b/drivers/staging/wilc1000/fifo_buffer.c
index b6c07cf..4fbac3d 100644
--- a/drivers/staging/wilc1000/fifo_buffer.c
+++ b/drivers/staging/wilc1000/fifo_buffer.c
@@ -52,11 +52,10 @@ u32 FIFO_ReadBytes(tHANDLE hFifo, u8 *pu8Buffer, u32 
u32BytesToRead, u32 *pu32By
if (pstrFifoHandler->u32TotalBytes) {
down(&pstrFifoHandler->SemBuffer);
 
-   if (u32BytesToRead > pstrFifoHandler->u32TotalBytes) {
+   if (u32BytesToRead > pstrFifoHandler->u32TotalBytes)
*pu32BytesRead = pstrFifoHandler->u32TotalBytes;
-   } else {
+else
*pu32BytesRead = u32BytesToRead;
-   }
if ((pstrFifoHandler->u32ReadOffset + u32BytesToRead) 
<= pstrFifoHandler->u32BufferLength) {
WILC_memcpy(pu8Buffer, 
pstrFifoHandler->pu8Buffer + pstrFifoHandler->u32ReadOffset,
*pu32BytesRead);
-- 
1.7.9.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 00/19] Lustre cleanups

2015-09-16 Thread green
From: Oleg Drokin 

This bunch of patches removes significant chunks of
Lustre specific allocators which is possible thanks to prior patches
from Julia Lawall.
Also removed are some server-only bits of code that make no sense
to retain in a client.

Please consider.

The v2 version fixes build error in patch 17 without patch 18.

Oleg Drokin (19):
  staging/lustre: Remove OBD_CPT_ALLOC_LARGE
  staging/lustre: Remove unused OBD_VMALLOC
  staging/lustre: Remove unused OBD_CPT_ALLOC* macros
  staging/lustre: Remove users of OBD_ALLOC/FREE_PTR lu_object.h
  staging/lustre/llite: Get rid of OBD_ALLOC/FREE_PTR
  staging/lustre/obdclass: replace OBD_ALLOC_GFP with kzalloc
  staging/lustre: Remove references to OBD_ALLOC/FREE* in comments
  staging/lustre/fld: Replace OBD_ALLOC_GFP with kzalloc
  staging/lustre: Convert lustre_cfg_new/free to use kzalloc/kfree
  staging/lustre/ptlrpc: Replace OBD_FREE_PTR with kfree
  staging/lustre: Replace last users of OBD_ALLOC/FREE_LARGE
  staging/lustre: Remove stray bit of userland utils code
  staging/lustre: Remove unused OBD_ALLOC* and OBD_FREE macros
  staging/lustre: Remove memory allocation fault injection framework
  staging/lustre: Remove lustre used memory tracking framework
  staging/lustre: remove obd_memory stats counter
  staging/lustre: Remove IS_SERVER and all users
  staging/lustre: remove IS_MDS|IS_OST|IS_MGS defines and users
  staging/lustre: Remove server defines from lustre_disk.h

 drivers/staging/lustre/lustre/fld/fld_cache.c  |   2 +-
 drivers/staging/lustre/lustre/include/lu_object.h  |   4 +-
 drivers/staging/lustre/lustre/include/lustre_cfg.h |   6 +-
 .../staging/lustre/lustre/include/lustre_disk.h| 142 ---
 drivers/staging/lustre/lustre/include/lustre_lib.h |   4 +-
 drivers/staging/lustre/lustre/include/lustre_net.h |   2 +-
 drivers/staging/lustre/lustre/include/obd.h|  12 +-
 .../staging/lustre/lustre/include/obd_support.h| 198 +
 drivers/staging/lustre/lustre/llite/file.c |   2 +-
 drivers/staging/lustre/lustre/llite/llite_lib.c|   2 +-
 drivers/staging/lustre/lustre/mgc/mgc_request.c|  44 +
 drivers/staging/lustre/lustre/obdclass/cl_page.c   |   3 +-
 drivers/staging/lustre/lustre/obdclass/class_obd.c | 103 ---
 .../staging/lustre/lustre/obdclass/llog_internal.h |   8 -
 .../lustre/lustre/obdclass/lprocfs_counters.c  |   9 -
 .../lustre/lustre/obdclass/lprocfs_status.c|   2 +-
 drivers/staging/lustre/lustre/obdclass/obd_mount.c |  91 ++
 .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c|   2 +-
 drivers/staging/lustre/lustre/ptlrpc/pinger.c  |   2 -
 .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |   2 +-
 drivers/staging/lustre/lustre/ptlrpc/service.c |   6 +-
 21 files changed, 46 insertions(+), 600 deletions(-)

-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 01/19] staging/lustre: Remove OBD_CPT_ALLOC_LARGE

2015-09-16 Thread green
From: Oleg Drokin 

Remove OBD_CPT_ALLOC_LARGE define and convert the only user to
libcfs_kvzalloc_cpt.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/obd_support.h | 5 -
 drivers/staging/lustre/lustre/ptlrpc/service.c  | 6 --
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd_support.h 
b/drivers/staging/lustre/lustre/include/obd_support.h
index 30f22d9..b746763 100644
--- a/drivers/staging/lustre/lustre/include/obd_support.h
+++ b/drivers/staging/lustre/lustre/include/obd_support.h
@@ -634,11 +634,6 @@ do {   
  \
ptr = libcfs_kvzalloc(size, GFP_NOFS);\
 } while (0)
 
-#define OBD_CPT_ALLOC_LARGE(ptr, cptab, cpt, size)   \
-do { \
-   ptr = libcfs_kvzalloc_cpt(cptab, cpt, size, GFP_NOFS);\
-} while (0)
-
 #define OBD_FREE_LARGE(ptr, size)   \
 do { \
(void)(size);   \
diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c 
b/drivers/staging/lustre/lustre/ptlrpc/service.c
index 003344c..40de622 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/service.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/service.c
@@ -86,8 +86,10 @@ ptlrpc_alloc_rqbd(struct ptlrpc_service_part *svcpt)
rqbd->rqbd_cbid.cbid_fn = request_in_callback;
rqbd->rqbd_cbid.cbid_arg = rqbd;
INIT_LIST_HEAD(&rqbd->rqbd_reqs);
-   OBD_CPT_ALLOC_LARGE(rqbd->rqbd_buffer, svc->srv_cptable,
-   svcpt->scp_cpt, svc->srv_buf_size);
+   rqbd->rqbd_buffer = libcfs_kvzalloc_cpt(svc->srv_cptable,
+   svcpt->scp_cpt,
+   svc->srv_buf_size,
+   GFP_KERNEL);
if (rqbd->rqbd_buffer == NULL) {
kfree(rqbd);
return NULL;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 07/19] staging/lustre: Remove references to OBD_ALLOC/FREE* in comments

2015-09-16 Thread green
From: Oleg Drokin 

Since everything is now supposed to use regular kernel alloc and
free functions.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_lib.h  | 2 +-
 drivers/staging/lustre/lustre/include/lustre_net.h  | 2 +-
 drivers/staging/lustre/lustre/llite/file.c  | 2 +-
 drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_lib.h 
b/drivers/staging/lustre/lustre/include/lustre_lib.h
index 2a4294d..352e524 100644
--- a/drivers/staging/lustre/lustre/include/lustre_lib.h
+++ b/drivers/staging/lustre/lustre/include/lustre_lib.h
@@ -453,7 +453,7 @@ static inline void obd_ioctl_freedata(char *buf, int len)
  *  __wake_up_common(q, ...); (2.2)
  *  spin_unlock(&q->lock, flags); (2.3)
  *
- *   OBD_FREE_PTR(obj);  (3)
+ *   kfree(obj); (3)
  *
  * As l_wait_event() may "short-cut" execution and return without taking
  * wait-queue spin-lock, some additional synchronization is necessary to
diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h 
b/drivers/staging/lustre/lustre/include/lustre_net.h
index 3b6a2d7..c9c21d2 100644
--- a/drivers/staging/lustre/lustre/include/lustre_net.h
+++ b/drivers/staging/lustre/lustre/include/lustre_net.h
@@ -306,7 +306,7 @@ union ptlrpc_async_args {
/**
 * Scratchpad for passing args to completion interpreter. Users
 * cast to the struct of their choosing, and CLASSERT that this is
-* big enough.  For _tons_ of context, OBD_ALLOC a struct and store
+* big enough.  For _tons_ of context, kmalloc a struct and store
 * a pointer to it here.  The pointer_arg ensures this struct is at
 * least big enough for that.
 */
diff --git a/drivers/staging/lustre/lustre/llite/file.c 
b/drivers/staging/lustre/lustre/llite/file.c
index b610032..31ed248 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -694,7 +694,7 @@ out_och_free:
if (rc) {
if (och_p && *och_p) {
kfree(*och_p);
-   *och_p = NULL; /* OBD_FREE writes some magic there */
+   *och_p = NULL;
(*och_usecount)--;
}
mutex_unlock(&lli->lli_och_mutex);
diff --git a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c 
b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
index 84eb3da..9a10baf 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
@@ -1223,7 +1223,7 @@ int lprocfs_wr_evict_client(struct file *file, const char 
__user *buffer,
return -ENOMEM;
 
/*
-* OBD_ALLOC() will zero kbuf, but we only copy BUFLEN - 1
+* kzalloc() will zero kbuf, but we only copy BUFLEN - 1
 * bytes into kbuf, to ensure that the string is NUL-terminated.
 * UUID_MAX should include a trailing NUL already.
 */
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 04/19] staging/lustre: Remove users of OBD_ALLOC/FREE_PTR lu_object.h

2015-09-16 Thread green
From: Oleg Drokin 

These are converted to regular kzalloc/kfree calls.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lu_object.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lu_object.h 
b/drivers/staging/lustre/lustre/include/lu_object.h
index 96e271d..7756008 100644
--- a/drivers/staging/lustre/lustre/include/lu_object.h
+++ b/drivers/staging/lustre/lustre/include/lu_object.h
@@ -1126,7 +1126,7 @@ struct lu_context_key {
  \
CLASSERT(PAGE_CACHE_SIZE >= sizeof (*value));   \
  \
-   OBD_ALLOC_PTR(value);\
+   value = kzalloc(sizeof(*value), GFP_NOFS);  \
if (value == NULL)  \
value = ERR_PTR(-ENOMEM);\
  \
@@ -1140,7 +1140,7 @@ struct lu_context_key {
{  \
type *info = data;\
\
-   OBD_FREE_PTR(info);  \
+   kfree(info); \
}  \
struct __##mod##__dummy_fini {; } /* semicolon catcher */
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 13/19] staging/lustre: Remove unused OBD_ALLOC* and OBD_FREE macros

2015-09-16 Thread green
From: Oleg Drokin 

This removes now unused OBD_ALLOC, OBD_ALLOC_GFP, OBD_ALLOC_PTR,
OBD_ALLOC_LARGE and supporting infrastructure.
Also OBD_FREE, OBD_FREE_PTR, OBD_FREE_LARGE and supporting infrastructure.

Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/include/obd_support.h| 52 --
 1 file changed, 52 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd_support.h 
b/drivers/staging/lustre/lustre/include/obd_support.h
index d8feec7..8a3323c 100644
--- a/drivers/staging/lustre/lustre/include/obd_support.h
+++ b/drivers/staging/lustre/lustre/include/obd_support.h
@@ -551,48 +551,6 @@ __u64 obd_pages_max(void);
 #define OBD_ALLOC_FAIL_MASK ((1 << OBD_ALLOC_FAIL_BITS) - 1)
 #define OBD_ALLOC_FAIL_MULT (OBD_ALLOC_FAIL_MASK / 100)
 
-#define OBD_FREE_RTN0(ptr) \
-({ \
-   kfree(ptr); \
-   (ptr) = NULL;\
-   0;  \
-})
-
-#define __OBD_MALLOC_VERBOSE(ptr, cptab, cpt, size, flags)   \
-do { \
-   (ptr) = (cptab) == NULL ? \
-   kmalloc(size, flags | __GFP_ZERO) :   \
-   kmalloc_node(size, flags | __GFP_ZERO,\
-cfs_cpt_spread_node(cptab, cpt));\
-   if (likely((ptr) != NULL &&\
-  (!HAS_FAIL_ALLOC_FLAG || obd_alloc_fail_rate == 0 ||   \
-   !obd_alloc_fail(ptr, #ptr, "km", size,  \
-   __FILE__, __LINE__) ||  \
-   OBD_FREE_RTN0(ptr { \
-   OBD_ALLOC_POST(ptr, size, "kmalloced");\
-   }\
-} while (0)
-
-#define OBD_ALLOC_GFP(ptr, size, gfp_mask)   \
-   __OBD_MALLOC_VERBOSE(ptr, NULL, 0, size, gfp_mask)
-
-#define OBD_ALLOC(ptr, size) OBD_ALLOC_GFP(ptr, size, GFP_NOFS)
-#define OBD_ALLOC_WAIT(ptr, size) OBD_ALLOC_GFP(ptr, size, GFP_KERNEL)
-#define OBD_ALLOC_PTR(ptr) OBD_ALLOC(ptr, sizeof(*(ptr)))
-#define OBD_ALLOC_PTR_WAIT(ptr) OBD_ALLOC_WAIT(ptr, sizeof(*(ptr)))
-
-#define OBD_ALLOC_LARGE(ptr, size) \
-do { \
-   ptr = libcfs_kvzalloc(size, GFP_NOFS);\
-} while (0)
-
-#define OBD_FREE_LARGE(ptr, size)   \
-do { \
-   (void)(size);   \
-   kvfree(ptr);  \
-} while (0)
-
-
 #ifdef CONFIG_DEBUG_SLAB
 #define POISON(ptr, c, s) do {} while (0)
 #define POISON_PTR(ptr)  ((void)0)
@@ -610,14 +568,6 @@ do {   
  \
 #define POISON_PAGE(page, val) do { } while (0)
 #endif
 
-#define OBD_FREE(ptr, size)   \
-do { \
-   OBD_FREE_PRE(ptr, size, "kfreed");  \
-   kfree(ptr); \
-   POISON_PTR(ptr);  \
-} while (0)
-
-
 #define OBD_FREE_RCU(ptr, size, handle)
  \
 do { \
struct portals_handle *__h = (handle);\
@@ -660,8 +610,6 @@ do {
  \
 #define OBD_SLAB_CPT_ALLOC_GFP(ptr, slab, cptab, cpt, size, flags)   \
__OBD_SLAB_ALLOC_VERBOSE(ptr, slab, cptab, cpt, size, flags)
 
-#define OBD_FREE_PTR(ptr) OBD_FREE(ptr, sizeof(*(ptr)))
-
 #define OBD_SLAB_FREE(ptr, slab, size) \
 do { \
OBD_FREE_PRE(ptr, size, "slab-freed");  \
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 15/19] staging/lustre: Remove lustre used memory tracking framework

2015-09-16 Thread green
From: Oleg Drokin 

Lustre memory allocation framework has a feature to track amount
of allocated memory, but since it's not being used consistently anymore
and is on the way out in general, just remove it.

Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/include/obd_support.h| 60 +---
 drivers/staging/lustre/lustre/obdclass/class_obd.c | 64 --
 drivers/staging/lustre/lustre/ptlrpc/pinger.c  |  2 -
 3 files changed, 1 insertion(+), 125 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd_support.h 
b/drivers/staging/lustre/lustre/include/obd_support.h
index 3d92f19..62d76b5 100644
--- a/drivers/staging/lustre/lustre/include/obd_support.h
+++ b/drivers/staging/lustre/lustre/include/obd_support.h
@@ -494,50 +494,6 @@ extern char obd_jobid_var[];
 #define OBD_FAIL_ONCE CFS_FAIL_ONCE
 #define OBD_FAILED   CFS_FAILED
 
-void obd_update_maxusage(void);
-
-#define obd_memory_add(size) \
-   lprocfs_counter_add(obd_memory, OBD_MEMORY_STAT, (long)(size))
-#define obd_memory_sub(size) \
-   lprocfs_counter_sub(obd_memory, OBD_MEMORY_STAT, (long)(size))
-#define obd_memory_sum() \
-   lprocfs_stats_collector(obd_memory, OBD_MEMORY_STAT,  \
-   LPROCFS_FIELDS_FLAGS_SUM)
-#define obd_pages_add(order) \
-   lprocfs_counter_add(obd_memory, OBD_MEMORY_PAGES_STAT,  \
-   (long)(1 << (order)))
-#define obd_pages_sub(order) \
-   lprocfs_counter_sub(obd_memory, OBD_MEMORY_PAGES_STAT,  \
-   (long)(1 << (order)))
-#define obd_pages_sum()   \
-   lprocfs_stats_collector(obd_memory, OBD_MEMORY_PAGES_STAT,  \
-   LPROCFS_FIELDS_FLAGS_SUM)
-
-__u64 obd_memory_max(void);
-__u64 obd_pages_max(void);
-
-#define OBD_DEBUG_MEMUSAGE (1)
-
-#if OBD_DEBUG_MEMUSAGE
-#define OBD_ALLOC_POST(ptr, size, name) \
-   obd_memory_add(size);  \
-   CDEBUG(D_MALLOC, name " '" #ptr "': %d at %p.\n",   \
-  (int)(size), ptr)
-
-#define OBD_FREE_PRE(ptr, size, name) \
-   LASSERT(ptr);  \
-   obd_memory_sub(size);  \
-   CDEBUG(D_MALLOC, name " '" #ptr "': %d at %p.\n",  \
-  (int)(size), ptr);  \
-   POISON(ptr, 0x5a, size)
-
-#else /* !OBD_DEBUG_MEMUSAGE */
-
-#define OBD_ALLOC_POST(ptr, size, name) ((void)0)
-#define OBD_FREE_PRE(ptr, size, name)   ((void)0)
-
-#endif /* !OBD_DEBUG_MEMUSAGE */
-
 #ifdef CONFIG_DEBUG_SLAB
 #define POISON(ptr, c, s) do {} while (0)
 #define POISON_PTR(ptr)  ((void)0)
@@ -583,8 +539,6 @@ do {
  \
kmem_cache_alloc(slab, type | __GFP_ZERO) : \
kmem_cache_alloc_node(slab, type | __GFP_ZERO,  \
  cfs_cpt_spread_node(cptab, cpt)); \
-   if (likely(ptr))\
-   OBD_ALLOC_POST(ptr, size, "slab-alloced");  \
 } while (0)
 
 #define OBD_SLAB_ALLOC_GFP(ptr, slab, size, flags)   \
@@ -594,7 +548,6 @@ do {
  \
 
 #define OBD_SLAB_FREE(ptr, slab, size) \
 do { \
-   OBD_FREE_PRE(ptr, size, "slab-freed");  \
kmem_cache_free(slab, ptr); \
POISON_PTR(ptr);  \
 } while (0)
@@ -629,17 +582,7 @@ do {   
  \
(ptr) = (cptab) == NULL ? \
alloc_page(gfp_mask) :\
alloc_pages_node(cfs_cpt_spread_node(cptab, cpt), gfp_mask, 0);\
-   if (unlikely((ptr) == NULL)) {  \
-   CERROR("alloc_pages of '" #ptr "' %d page(s) / %llu bytes "\
-  "failed\n", (int)1,  \
-  (__u64)(1 << PAGE_CACHE_SHIFT));  \
-   CERROR("%llu total bytes and %llu total pages "\
-  "(%llu bytes) allocated by Lustre\n",

[PATCH v2 10/19] staging/lustre/ptlrpc: Replace OBD_FREE_PTR with kfree

2015-09-16 Thread green
From: Oleg Drokin 

Part of effort of getting rid of custom Lustre alloc/free macros

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h 
b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h
index 1d64ca7..34c7e28 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h
+++ b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h
@@ -298,6 +298,6 @@ static inline void tgt_mod_exit(void)
 static inline void ptlrpc_reqset_put(struct ptlrpc_request_set *set)
 {
if (atomic_dec_and_test(&set->set_refcount))
-   OBD_FREE_PTR(set);
+   kfree(set);
 }
 #endif /* PTLRPC_INTERNAL_H */
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 05/19] staging/lustre/llite: Get rid of OBD_ALLOC/FREE_PTR

2015-09-16 Thread green
From: Oleg Drokin 

The remaining users in ll_open_cleanup and obd_mod_alloc
are converted to regular kzalloc/kfree.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/obd.h | 4 ++--
 drivers/staging/lustre/lustre/llite/llite_lib.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd.h 
b/drivers/staging/lustre/lustre/include/obd.h
index 130f840..1013c33 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -1408,7 +1408,7 @@ static inline struct md_open_data *obd_mod_alloc(void)
 {
struct md_open_data *mod;
 
-   OBD_ALLOC_PTR(mod);
+   mod = kzalloc(sizeof(*mod), GFP_NOFS);
if (mod == NULL)
return NULL;
atomic_set(&mod->mod_refcount, 1);
@@ -1421,7 +1421,7 @@ static inline struct md_open_data *obd_mod_alloc(void)
if (atomic_dec_and_test(&(mod)->mod_refcount)) {  \
if ((mod)->mod_open_req)  \
ptlrpc_req_finished((mod)->mod_open_req);   \
-   OBD_FREE_PTR(mod);\
+   kfree(mod);   \
}  \
 })
 
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c 
b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 725481d..aa68608 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -1996,7 +1996,7 @@ void ll_open_cleanup(struct super_block *sb, struct 
ptlrpc_request *open_req)
struct obd_export   *exp   = ll_s2sbi(sb)->ll_md_exp;
 
body = req_capsule_server_get(&open_req->rq_pill, &RMF_MDT_BODY);
-   OBD_ALLOC_PTR(op_data);
+   op_data = kzalloc(sizeof(*op_data), GFP_NOFS);
if (!op_data) {
CWARN("%s: cannot allocate op_data to release open handle for "
  DFID "\n",
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 03/19] staging/lustre: Remove unused OBD_CPT_ALLOC* macros

2015-09-16 Thread green
From: Oleg Drokin 

OBD_CPT_ALLOC and friends are no longer used, so remove them.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/obd_support.h | 9 -
 1 file changed, 9 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd_support.h 
b/drivers/staging/lustre/lustre/include/obd_support.h
index f58d142..5ae35fa 100644
--- a/drivers/staging/lustre/lustre/include/obd_support.h
+++ b/drivers/staging/lustre/lustre/include/obd_support.h
@@ -599,15 +599,6 @@ do {   
  \
 #define OBD_ALLOC_PTR(ptr) OBD_ALLOC(ptr, sizeof(*(ptr)))
 #define OBD_ALLOC_PTR_WAIT(ptr) OBD_ALLOC_WAIT(ptr, sizeof(*(ptr)))
 
-#define OBD_CPT_ALLOC_GFP(ptr, cptab, cpt, size, gfp_mask)   \
-   __OBD_MALLOC_VERBOSE(ptr, cptab, cpt, size, gfp_mask)
-
-#define OBD_CPT_ALLOC(ptr, cptab, cpt, size) \
-   OBD_CPT_ALLOC_GFP(ptr, cptab, cpt, size, GFP_NOFS)
-
-#define OBD_CPT_ALLOC_PTR(ptr, cptab, cpt)   \
-   OBD_CPT_ALLOC(ptr, cptab, cpt, sizeof(*(ptr)))
-
 #define OBD_ALLOC_LARGE(ptr, size) \
 do { \
ptr = libcfs_kvzalloc(size, GFP_NOFS);\
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 08/19] staging/lustre/fld: Replace OBD_ALLOC_GFP with kzalloc

2015-09-16 Thread green
From: Oleg Drokin 

Part of effort to get rid of custom Lustre allocation macros.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/fld/fld_cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/fld/fld_cache.c 
b/drivers/staging/lustre/lustre/fld/fld_cache.c
index 1b1066b..5eeb36d 100644
--- a/drivers/staging/lustre/lustre/fld/fld_cache.c
+++ b/drivers/staging/lustre/lustre/fld/fld_cache.c
@@ -266,7 +266,7 @@ static void fld_cache_punch_hole(struct fld_cache *cache,
const u64 new_end  = range->lsr_end;
struct fld_cache_entry *fldt;
 
-   OBD_ALLOC_GFP(fldt, sizeof(*fldt), GFP_ATOMIC);
+   fldt = kzalloc(sizeof(*fldt), GFP_ATOMIC);
if (!fldt) {
kfree(f_new);
/* overlap is not allowed, so dont mess up list. */
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 17/19] staging/lustre: Remove IS_SERVER and all users

2015-09-16 Thread green
From: Oleg Drokin 

Since the client can never be server, this is all dead code.

Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/include/lustre_disk.h|  2 -
 drivers/staging/lustre/lustre/mgc/mgc_request.c| 36 ++---
 drivers/staging/lustre/lustre/obdclass/obd_mount.c | 85 --
 3 files changed, 20 insertions(+), 103 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_disk.h 
b/drivers/staging/lustre/lustre/include/lustre_disk.h
index 131985d..3f404a2 100644
--- a/drivers/staging/lustre/lustre/include/lustre_disk.h
+++ b/drivers/staging/lustre/lustre/include/lustre_disk.h
@@ -180,8 +180,6 @@ struct lustre_disk_data {
 #define IS_MDT(data)((data)->lsi_flags & LDD_F_SV_TYPE_MDT)
 #define IS_OST(data)((data)->lsi_flags & LDD_F_SV_TYPE_OST)
 #define IS_MGS(data)((data)->lsi_flags & LDD_F_SV_TYPE_MGS)
-#define IS_SERVER(data) ((data)->lsi_flags & (LDD_F_SV_TYPE_MGS | \
-LDD_F_SV_TYPE_MDT | LDD_F_SV_TYPE_OST))
 #define MT_STR(data)mt_str((data)->ldd_mount_type)
 
 /* Make the mdt/ost server obd name based on the filesystem name */
diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c 
b/drivers/staging/lustre/lustre/mgc/mgc_request.c
index 1bcf946..8b94dd4 100644
--- a/drivers/staging/lustre/lustre/mgc/mgc_request.c
+++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c
@@ -263,14 +263,8 @@ static struct config_llog_data 
*config_recover_log_add(struct obd_device *obd,
 * where only clients are notified if one of cmd server restarts */
LASSERT(strlen(fsname) < sizeof(logname) / 2);
strcpy(logname, fsname);
-   if (IS_SERVER(lsi)) { /* mdt */
-   LASSERT(lcfg.cfg_instance == NULL);
-   lcfg.cfg_instance = sb;
-   strcat(logname, "-mdtir");
-   } else {
-   LASSERT(lcfg.cfg_instance != NULL);
-   strcat(logname, "-cliir");
-   }
+   LASSERT(lcfg.cfg_instance);
+   strcat(logname, "-cliir");
 
cld = do_config_log_add(obd, logname, CONFIG_T_RECOVER, &lcfg, sb);
return cld;
@@ -899,12 +893,6 @@ static int mgc_enqueue(struct obd_export *exp, struct 
lov_stripe_md *lsm,
req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER, 0);
ptlrpc_request_set_replen(req);
 
-   /* check if this is server or client */
-   if (cld->cld_cfg.cfg_sb) {
-   struct lustre_sb_info *lsi = s2lsi(cld->cld_cfg.cfg_sb);
-   if (lsi && IS_SERVER(lsi))
-   short_limit = 1;
-   }
/* Limit how long we will wait for the enqueue to complete */
req->rq_delay_limit = short_limit ? 5 : MGC_ENQUEUE_LIMIT;
rc = ldlm_cli_enqueue(exp, &req, &einfo, &cld->cld_resid, NULL, flags,
@@ -1112,7 +1100,6 @@ static int mgc_apply_recover_logs(struct obd_device *mgc,
  void *data, int datalen, bool mne_swab)
 {
struct config_llog_instance *cfg = &cld->cld_cfg;
-   struct lustre_sb_info   *lsi = s2lsi(cfg->cfg_sb);
struct mgs_nidtbl_entry *entry;
struct lustre_cfg   *lcfg;
struct lustre_cfg_bufs   bufs;
@@ -1131,21 +1118,10 @@ static int mgc_apply_recover_logs(struct obd_device 
*mgc,
if (!inst)
return -ENOMEM;
 
-   if (!IS_SERVER(lsi)) {
-   pos = snprintf(inst, PAGE_CACHE_SIZE, "%p", cfg->cfg_instance);
-   if (pos >= PAGE_CACHE_SIZE) {
-   kfree(inst);
-   return -E2BIG;
-   }
-   } else {
-   LASSERT(IS_MDT(lsi));
-   rc = server_name2svname(lsi->lsi_svname, inst, NULL,
-   PAGE_CACHE_SIZE);
-   if (rc) {
-   kfree(inst);
-   return -EINVAL;
-   }
-   pos = strlen(inst);
+   pos = snprintf(inst, PAGE_CACHE_SIZE, "%p", cfg->cfg_instance);
+   if (pos >= PAGE_CACHE_SIZE) {
+   kfree(inst);
+   return -E2BIG;
}
 
++pos;
diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c 
b/drivers/staging/lustre/lustre/obdclass/obd_mount.c
index 3c66dbd..1db4669 100644
--- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c
+++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c
@@ -216,29 +216,10 @@ int lustre_start_mgc(struct super_block *sb)
 
LASSERT(lsi->lsi_lmd);
 
-   /* Find the first non-lo MGS nid for our MGC name */
-   if (IS_SERVER(lsi)) {
-   /* mount -o mgsnode=nid */
-   ptr = lsi->lsi_lmd->lmd_mgs;
-   if (lsi->lsi_lmd->lmd_mgs &&
-   (class_parse_nid(lsi->lsi_lmd->lmd_mgs, &nid, &ptr) == 0)) {
-   i++;
-   } else if (IS_MGS(lsi)) {
-   lnet_process_id_t id;
-   while ((rc = LNetGetId(i++, &id)) != -ENOENT) {
-

[PATCH v2 18/19] staging/lustre: remove IS_MDS|IS_OST|IS_MGS defines and users

2015-09-16 Thread green
From: Oleg Drokin 

These could only happen on the server, so they make no sense
on the client.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_disk.h | 3 ---
 drivers/staging/lustre/lustre/mgc/mgc_request.c | 8 
 drivers/staging/lustre/lustre/obdclass/obd_mount.c  | 6 --
 3 files changed, 17 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_disk.h 
b/drivers/staging/lustre/lustre/include/lustre_disk.h
index 3f404a2..859007c 100644
--- a/drivers/staging/lustre/lustre/include/lustre_disk.h
+++ b/drivers/staging/lustre/lustre/include/lustre_disk.h
@@ -177,9 +177,6 @@ struct lustre_disk_data {
 };
 
 
-#define IS_MDT(data)((data)->lsi_flags & LDD_F_SV_TYPE_MDT)
-#define IS_OST(data)((data)->lsi_flags & LDD_F_SV_TYPE_OST)
-#define IS_MGS(data)((data)->lsi_flags & LDD_F_SV_TYPE_MGS)
 #define MT_STR(data)mt_str((data)->ldd_mount_type)
 
 /* Make the mdt/ost server obd name based on the filesystem name */
diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c 
b/drivers/staging/lustre/lustre/mgc/mgc_request.c
index 8b94dd4..f254bb1 100644
--- a/drivers/staging/lustre/lustre/mgc/mgc_request.c
+++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c
@@ -248,17 +248,9 @@ static struct config_llog_data 
*config_recover_log_add(struct obd_device *obd,
struct super_block *sb)
 {
struct config_llog_instance lcfg = *cfg;
-   struct lustre_sb_info *lsi = s2lsi(sb);
struct config_llog_data *cld;
char logname[32];
 
-   if (IS_OST(lsi))
-   return NULL;
-
-   /* for osp-on-ost, see lustre_start_osp() */
-   if (IS_MDT(lsi) && lcfg.cfg_instance)
-   return NULL;
-
/* we have to use different llog for clients and mdts for cmd
 * where only clients are notified if one of cmd server restarts */
LASSERT(strlen(fsname) < sizeof(logname) / 2);
diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c 
b/drivers/staging/lustre/lustre/obdclass/obd_mount.c
index 1db4669..16009a6 100644
--- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c
+++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c
@@ -281,12 +281,6 @@ int lustre_start_mgc(struct super_block *sb)
}
 
recov_bk = 0;
-   /* If we are restarting the MGS, don't try to keep the MGC's
-  old connection, or registration will fail. */
-   if (IS_MGS(lsi)) {
-   CDEBUG(D_MOUNT, "New MGS with live MGC\n");
-   recov_bk = 1;
-   }
 
/* Try all connections, but only once (again).
   We don't want to block another target from starting
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 11/19] staging/lustre: Replace last users of OBD_ALLOC/FREE_LARGE

2015-09-16 Thread green
From: Oleg Drokin 

OBD_ALLOC_LARGE is now replaced with libcfs_kvzalloc and
OBD_FREE_LARGE is now replaced with kvfree.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_lib.h | 2 +-
 drivers/staging/lustre/lustre/include/obd.h| 8 
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_lib.h 
b/drivers/staging/lustre/lustre/include/lustre_lib.h
index 352e524..b380359 100644
--- a/drivers/staging/lustre/lustre/include/lustre_lib.h
+++ b/drivers/staging/lustre/lustre/include/lustre_lib.h
@@ -258,7 +258,7 @@ int obd_ioctl_popdata(void *arg, void *data, int len);
 
 static inline void obd_ioctl_freedata(char *buf, int len)
 {
-   OBD_FREE_LARGE(buf, len);
+   kvfree(buf);
return;
 }
 
diff --git a/drivers/staging/lustre/lustre/include/obd.h 
b/drivers/staging/lustre/lustre/include/obd.h
index 1013c33..9c50ef1 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -728,8 +728,8 @@ static inline void oti_alloc_cookies(struct obd_trans_info 
*oti,
if (num_cookies == 1)
oti->oti_logcookies = &oti->oti_onecookie;
else
-   OBD_ALLOC_LARGE(oti->oti_logcookies,
-   num_cookies * sizeof(oti->oti_onecookie));
+   oti->oti_logcookies = libcfs_kvzalloc(num_cookies * 
sizeof(oti->oti_onecookie),
+ GFP_NOFS);
 
oti->oti_numcookies = num_cookies;
 }
@@ -742,8 +742,8 @@ static inline void oti_free_cookies(struct obd_trans_info 
*oti)
if (oti->oti_logcookies == &oti->oti_onecookie)
LASSERT(oti->oti_numcookies == 1);
else
-   OBD_FREE_LARGE(oti->oti_logcookies,
-  oti->oti_numcookies*sizeof(oti->oti_onecookie));
+   kvfree(oti->oti_logcookies);
+
oti->oti_logcookies = NULL;
oti->oti_numcookies = 0;
 }
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 12/19] staging/lustre: Remove stray bit of userland utils code

2015-09-16 Thread green
From: Oleg Drokin 

The UTILS are userland and I see it's causing confusion
with things beging already converted to kmalloc,
so just remove it.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/obd_support.h | 18 --
 1 file changed, 18 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd_support.h 
b/drivers/staging/lustre/lustre/include/obd_support.h
index 5ae35fa..d8feec7 100644
--- a/drivers/staging/lustre/lustre/include/obd_support.h
+++ b/drivers/staging/lustre/lustre/include/obd_support.h
@@ -551,23 +551,6 @@ __u64 obd_pages_max(void);
 #define OBD_ALLOC_FAIL_MASK ((1 << OBD_ALLOC_FAIL_BITS) - 1)
 #define OBD_ALLOC_FAIL_MULT (OBD_ALLOC_FAIL_MASK / 100)
 
-#if defined(LUSTRE_UTILS) /* this version is for utils only */
-#define __OBD_MALLOC_VERBOSE(ptr, cptab, cpt, size, flags)   \
-do { \
-   (ptr) = (cptab) == NULL ? \
-   kmalloc(size, flags) :\
-   kmalloc_node(size, flags, cfs_cpt_spread_node(cptab, cpt));   \
-   if (unlikely((ptr) == NULL)) {  \
-   CERROR("kmalloc of '" #ptr "' (%d bytes) failed at %s:%d\n",  \
-  (int)(size), __FILE__, __LINE__);  \
-   } else {  \
-   memset(ptr, 0, size); \
-   CDEBUG(D_MALLOC, "kmalloced '" #ptr "': %d at %p\n",  \
-  (int)(size), ptr); \
-   } \
-} while (0)
-
-#else /* this version is for the kernel and liblustre */
 #define OBD_FREE_RTN0(ptr) \
 ({ \
kfree(ptr); \
@@ -589,7 +572,6 @@ do {
  \
OBD_ALLOC_POST(ptr, size, "kmalloced");\
}\
 } while (0)
-#endif
 
 #define OBD_ALLOC_GFP(ptr, size, gfp_mask)   \
__OBD_MALLOC_VERBOSE(ptr, NULL, 0, size, gfp_mask)
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 19/19] staging/lustre: Remove server defines from lustre_disk.h

2015-09-16 Thread green
From: Oleg Drokin 

Take initial stab at removing server-disk related defines that
client does not need.

Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/include/lustre_disk.h| 137 -
 .../staging/lustre/lustre/obdclass/llog_internal.h |   8 --
 2 files changed, 145 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_disk.h 
b/drivers/staging/lustre/lustre/include/lustre_disk.h
index 859007c..ec33259 100644
--- a/drivers/staging/lustre/lustre/include/lustre_disk.h
+++ b/drivers/staging/lustre/lustre/include/lustre_disk.h
@@ -52,24 +52,6 @@
 #include "../../include/linux/lnet/types.h"
 #include 
 
-/** on-disk files */
-
-#define MDT_LOGS_DIR   "LOGS"  /* COMPAT_146 */
-#define MOUNT_CONFIGS_DIR  "CONFIGS"
-#define CONFIGS_FILE   "mountdata"
-/** Persistent mount data are stored on the disk in this file. */
-#define MOUNT_DATA_FILEMOUNT_CONFIGS_DIR"/"CONFIGS_FILE
-#define LAST_RCVD  "last_rcvd"
-#define LOV_OBJID  "lov_objid"
-#define LOV_OBJSEQ "lov_objseq"
-#define HEALTH_CHECK   "health_check"
-#define CAPA_KEYS  "capa_keys"
-#define CHANGELOG_USERS"changelog_users"
-#define MGS_NIDTBL_DIR "NIDTBL_VERSIONS"
-#define QMT_DIR"quota_master"
-#define QSD_DIR"quota_slave"
-#define HSM_ACTIONS"hsm_actions"
-
 /** persistent mount data */
 
 #define LDD_F_SV_TYPE_MDT   0x0001
@@ -79,125 +61,6 @@
LDD_F_SV_TYPE_OST  | \
LDD_F_SV_TYPE_MGS)
 #define LDD_F_SV_ALL   0x0008
-/** need an index assignment */
-#define LDD_F_NEED_INDEX0x0010
-/** never registered */
-#define LDD_F_VIRGIN   0x0020
-/** update the config logs for this server */
-#define LDD_F_UPDATE   0x0040
-/** rewrite the LDD */
-#define LDD_F_REWRITE_LDD   0x0080
-/** regenerate config logs for this fs or server */
-#define LDD_F_WRITECONF 0x0100
-/** COMPAT_14 */
-#define LDD_F_UPGRADE14 0x0200
-/** process as lctl conf_param */
-#define LDD_F_PARAM 0x0400
-/** all nodes are specified as service nodes */
-#define LDD_F_NO_PRIMNODE   0x1000
-/** IR enable flag */
-#define LDD_F_IR_CAPABLE0x2000
-/** the MGS refused to register the target. */
-#define LDD_F_ERROR 0x4000
-/** process at lctl conf_param */
-#define LDD_F_PARAM2   0x8000
-
-/* opc for target register */
-#define LDD_F_OPC_REG   0x1000
-#define LDD_F_OPC_UNREG 0x2000
-#define LDD_F_OPC_READY 0x4000
-#define LDD_F_OPC_MASK  0xf000
-
-#define LDD_F_ONDISK_MASK  (LDD_F_SV_TYPE_MASK)
-
-#define LDD_F_MASK   0x
-
-enum ldd_mount_type {
-   LDD_MT_EXT3 = 0,
-   LDD_MT_LDISKFS,
-   LDD_MT_SMFS,
-   LDD_MT_REISERFS,
-   LDD_MT_LDISKFS2,
-   LDD_MT_ZFS,
-   LDD_MT_LAST
-};
-
-static inline char *mt_str(enum ldd_mount_type mt)
-{
-   static char *mount_type_string[] = {
-   "ext3",
-   "ldiskfs",
-   "smfs",
-   "reiserfs",
-   "ldiskfs2",
-   "zfs",
-   };
-   return mount_type_string[mt];
-}
-
-static inline char *mt_type(enum ldd_mount_type mt)
-{
-   static char *mount_type_string[] = {
-   "osd-ldiskfs",
-   "osd-ldiskfs",
-   "osd-smfs",
-   "osd-reiserfs",
-   "osd-ldiskfs",
-   "osd-zfs",
-   };
-   return mount_type_string[mt];
-}
-
-#define LDD_INCOMPAT_SUPP 0
-#define LDD_ROCOMPAT_SUPP 0
-
-#define LDD_MAGIC 0x1dd1
-
-/* On-disk configuration file. In host-endian order. */
-struct lustre_disk_data {
-   __u32  ldd_magic;
-   __u32  ldd_feature_compat;  /* compatible feature flags */
-   __u32  ldd_feature_rocompat;/* read-only compatible feature flags */
-   __u32  ldd_feature_incompat;/* incompatible feature flags */
-
-   __u32  ldd_config_ver;  /* config rewrite count - not used */
-   __u32  ldd_flags;  /* LDD_SV_TYPE */
-   __u32  ldd_svindex;  /* server index (0001), must match
-  svname */
-   __u32  ldd_mount_type;  /* target fs type LDD_MT_* */
-   char   ldd_fsname[64];  /* filesystem this server is part of,
-  MTI_NAME_MAXLEN */
-   char   ldd_svname[64];  /* this server's name (lustre-mdt0001)*/
-   __u8   ldd_uuid[40];/* server UUID (COMPAT_146) */
-
-/*200*/ char   ldd_userdata[1024 - 200]; /* arbitrary user string */
-/*1024*/__u8   ldd_padding[4096 - 1024];
-/*4096*/char   ldd_mount_opts[4096]; /* target fs mount opts */
-/*8192*/char   ldd_params[4096]; /* key=value pairs */
-};
-
-
-#define MT_STR(data)mt_str((data)->ldd_mount_type)
-
-/* Make the mdt/ost

[PATCH v2 14/19] staging/lustre: Remove memory allocation fault injection framework

2015-09-16 Thread green
From: Oleg Drokin 

Lustre memory allocation wrappers also included a fault injection
framework that's totally redundant, since in-kernel offering is
actually superior to what we had.
So let's remove it.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/obd_support.h | 20 +---
 drivers/staging/lustre/lustre/obdclass/class_obd.c  | 21 -
 2 files changed, 1 insertion(+), 40 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd_support.h 
b/drivers/staging/lustre/lustre/include/obd_support.h
index 8a3323c..3d92f19 100644
--- a/drivers/staging/lustre/lustre/include/obd_support.h
+++ b/drivers/staging/lustre/lustre/include/obd_support.h
@@ -66,13 +66,8 @@ extern unsigned int obd_sync_filter;
 extern unsigned int obd_max_dirty_pages;
 extern atomic_t obd_dirty_pages;
 extern atomic_t obd_dirty_transit_pages;
-extern unsigned int obd_alloc_fail_rate;
 extern char obd_jobid_var[];
 
-/* lvfs.c */
-int obd_alloc_fail(const void *ptr, const char *name, const char *type,
-  size_t size, const char *file, int line);
-
 /* Some hash init argument constants */
 #define HASH_POOLS_BKT_BITS 3
 #define HASH_POOLS_CUR_BITS 3
@@ -428,8 +423,6 @@ int obd_alloc_fail(const void *ptr, const char *name, const 
char *type,
 
 #define OBD_FAIL_LPROC_REMOVE  0xB00
 
-#define OBD_FAIL_GENERAL_ALLOC0xC00
-
 #define OBD_FAIL_SEQ0x1000
 #define OBD_FAIL_SEQ_QUERY_NET0x1001
 #define OBD_FAIL_SEQ_EXHAUST0x1002
@@ -545,12 +538,6 @@ __u64 obd_pages_max(void);
 
 #endif /* !OBD_DEBUG_MEMUSAGE */
 
-#define HAS_FAIL_ALLOC_FLAG OBD_FAIL_CHECK(OBD_FAIL_GENERAL_ALLOC)
-
-#define OBD_ALLOC_FAIL_BITS 24
-#define OBD_ALLOC_FAIL_MASK ((1 << OBD_ALLOC_FAIL_BITS) - 1)
-#define OBD_ALLOC_FAIL_MULT (OBD_ALLOC_FAIL_MASK / 100)
-
 #ifdef CONFIG_DEBUG_SLAB
 #define POISON(ptr, c, s) do {} while (0)
 #define POISON_PTR(ptr)  ((void)0)
@@ -596,13 +583,8 @@ do {   
  \
kmem_cache_alloc(slab, type | __GFP_ZERO) : \
kmem_cache_alloc_node(slab, type | __GFP_ZERO,  \
  cfs_cpt_spread_node(cptab, cpt)); \
-   if (likely((ptr) != NULL &&\
-  (!HAS_FAIL_ALLOC_FLAG || obd_alloc_fail_rate == 0 ||   \
-   !obd_alloc_fail(ptr, #ptr, "slab-", size,\
-   __FILE__, __LINE__) ||  \
-   OBD_SLAB_FREE_RTN0(ptr, slab {  \
+   if (likely(ptr))\
OBD_ALLOC_POST(ptr, size, "slab-alloced");  \
-   }\
 } while (0)
 
 #define OBD_SLAB_ALLOC_GFP(ptr, slab, size, flags)   \
diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c 
b/drivers/staging/lustre/lustre/obdclass/class_obd.c
index b151154..fb4138c 100644
--- a/drivers/staging/lustre/lustre/obdclass/class_obd.c
+++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c
@@ -64,8 +64,6 @@ EXPORT_SYMBOL(obd_pages);
 static DEFINE_SPINLOCK(obd_updatemax_lock);
 
 /* The following are visible and mutable through /proc/sys/lustre/. */
-unsigned int obd_alloc_fail_rate;
-EXPORT_SYMBOL(obd_alloc_fail_rate);
 unsigned int obd_debug_peer_on_timeout;
 EXPORT_SYMBOL(obd_debug_peer_on_timeout);
 unsigned int obd_dump_on_timeout;
@@ -132,25 +130,6 @@ int lustre_get_jobid(char *jobid)
 }
 EXPORT_SYMBOL(lustre_get_jobid);
 
-int obd_alloc_fail(const void *ptr, const char *name, const char *type,
-  size_t size, const char *file, int line)
-{
-   if (ptr == NULL ||
-   (cfs_rand() & OBD_ALLOC_FAIL_MASK) < obd_alloc_fail_rate) {
-   CERROR("%s%salloc of %s (%llu bytes) failed at %s:%d\n",
-  ptr ? "force " : "", type, name, (__u64)size, file,
-  line);
-   CERROR("%llu total bytes and %llu total pages"
-   " (%llu bytes) allocated by Lustre\n",
-  obd_memory_sum(),
-  obd_pages_sum() << PAGE_CACHE_SHIFT,
-  obd_pages_sum());
-   return 1;
-   }
-   return 0;
-}
-EXPORT_SYMBOL(obd_alloc_fail);
-
 static inline void obd_data2conn(struct lustre_handle *conn,
 struct obd_ioctl_data *data)
 {
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 02/19] staging/lustre: Remove unused OBD_VMALLOC

2015-09-16 Thread green
From: Oleg Drokin 

These macros are not used anymore, so let's remove them,
also __OBD_VMALLOC_VEROBSE and OBD_CPT_VMALLOC

Signed-off-by: Oleg Drokin 
---
 .../staging/lustre/lustre/include/obd_support.h| 29 --
 1 file changed, 29 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd_support.h 
b/drivers/staging/lustre/lustre/include/obd_support.h
index b746763..f58d142 100644
--- a/drivers/staging/lustre/lustre/include/obd_support.h
+++ b/drivers/staging/lustre/lustre/include/obd_support.h
@@ -608,27 +608,6 @@ do {   
  \
 #define OBD_CPT_ALLOC_PTR(ptr, cptab, cpt)   \
OBD_CPT_ALLOC(ptr, cptab, cpt, sizeof(*(ptr)))
 
-# define __OBD_VMALLOC_VEROBSE(ptr, cptab, cpt, size)\
-do { \
-   (ptr) = cptab == NULL ?   \
-   vzalloc(size) :   \
-   vzalloc_node(size, cfs_cpt_spread_node(cptab, cpt));  \
-   if (unlikely((ptr) == NULL)) {  \
-   CERROR("vmalloc of '" #ptr "' (%d bytes) failed\n",\
-  (int)(size));  \
-   CERROR("%llu total bytes allocated by Lustre\n",  \
-  obd_memory_sum()); \
-   } else {  \
-   OBD_ALLOC_POST(ptr, size, "vmalloced");\
-   }\
-} while (0)
-
-# define OBD_VMALLOC(ptr, size)
  \
-__OBD_VMALLOC_VEROBSE(ptr, NULL, 0, size)
-# define OBD_CPT_VMALLOC(ptr, cptab, cpt, size)
  \
-__OBD_VMALLOC_VEROBSE(ptr, cptab, cpt, size)
-
-
 #define OBD_ALLOC_LARGE(ptr, size) \
 do { \
ptr = libcfs_kvzalloc(size, GFP_NOFS);\
@@ -677,14 +656,6 @@ do {   
  \
POISON_PTR(ptr);  \
 } while (0)
 
-
-#define OBD_VFREE(ptr, size)   \
-   do {\
-   OBD_FREE_PRE(ptr, size, "vfreed");  \
-   vfree(ptr); \
-   POISON_PTR(ptr);\
-   } while (0)
-
 /* we memset() the slab object to 0 when allocation succeeds, so DO NOT
  * HAVE A CTOR THAT DOES ANYTHING.  its work will be cleared here.  we'd
  * love to assert on that, but slab.c keeps kmem_cache_s all to itself. */
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 09/19] staging/lustre: Convert lustre_cfg_new/free to use kzalloc/kfree

2015-09-16 Thread green
From: Oleg Drokin 

Part of effort of getting rid of custom Lustre allocation macros

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_cfg.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_cfg.h 
b/drivers/staging/lustre/lustre/include/lustre_cfg.h
index 7b385b8..c80d78e 100644
--- a/drivers/staging/lustre/lustre/include/lustre_cfg.h
+++ b/drivers/staging/lustre/lustre/include/lustre_cfg.h
@@ -231,8 +231,8 @@ static inline struct lustre_cfg *lustre_cfg_new(int cmd,
char *ptr;
int i;
 
-   OBD_ALLOC(lcfg, lustre_cfg_len(bufs->lcfg_bufcount,
-  bufs->lcfg_buflen));
+   lcfg = kzalloc(lustre_cfg_len(bufs->lcfg_bufcount, bufs->lcfg_buflen),
+  GFP_NOFS);
if (!lcfg)
return ERR_PTR(-ENOMEM);
 
@@ -254,7 +254,7 @@ static inline void lustre_cfg_free(struct lustre_cfg *lcfg)
 
len = lustre_cfg_len(lcfg->lcfg_bufcount, lcfg->lcfg_buflens);
 
-   OBD_FREE(lcfg, len);
+   kfree(lcfg);
return;
 }
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 16/19] staging/lustre: remove obd_memory stats counter

2015-09-16 Thread green
From: Oleg Drokin 

Now that we no longer track allocated memory, remove
obd_memory statistics counter and all references to it everywhere

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/obd_support.h|  7 ---
 drivers/staging/lustre/lustre/obdclass/class_obd.c | 18 --
 .../staging/lustre/lustre/obdclass/lprocfs_counters.c  |  9 -
 .../staging/lustre/lustre/obdclass/lprocfs_status.c|  2 +-
 4 files changed, 1 insertion(+), 35 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd_support.h 
b/drivers/staging/lustre/lustre/include/obd_support.h
index 62d76b5..80ab85d 100644
--- a/drivers/staging/lustre/lustre/include/obd_support.h
+++ b/drivers/staging/lustre/lustre/include/obd_support.h
@@ -43,13 +43,6 @@
 #include "lprocfs_status.h"
 
 /* global variables */
-extern struct lprocfs_stats *obd_memory;
-enum {
-   OBD_MEMORY_STAT = 0,
-   OBD_MEMORY_PAGES_STAT = 1,
-   OBD_STATS_NUM,
-};
-
 extern unsigned int obd_debug_peer_on_timeout;
 extern unsigned int obd_dump_on_timeout;
 extern unsigned int obd_dump_on_eviction;
diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c 
b/drivers/staging/lustre/lustre/obdclass/class_obd.c
index 32daefb..39bf734 100644
--- a/drivers/staging/lustre/lustre/obdclass/class_obd.c
+++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c
@@ -487,22 +487,6 @@ static int __init init_obdclass(void)
spin_lock_init(&obd_types_lock);
obd_zombie_impexp_init();
 
-   obd_memory = lprocfs_alloc_stats(OBD_STATS_NUM,
-LPROCFS_STATS_FLAG_NONE |
-LPROCFS_STATS_FLAG_IRQ_SAFE);
-
-   if (obd_memory == NULL) {
-   CERROR("kmalloc of 'obd_memory' failed\n");
-   return -ENOMEM;
-   }
-
-   lprocfs_counter_init(obd_memory, OBD_MEMORY_STAT,
-LPROCFS_CNTR_AVGMINMAX,
-"memused", "bytes");
-   lprocfs_counter_init(obd_memory, OBD_MEMORY_PAGES_STAT,
-LPROCFS_CNTR_AVGMINMAX,
-"pagesused", "pages");
-
err = obd_init_checks();
if (err == -EOVERFLOW)
return err;
@@ -592,8 +576,6 @@ static void cleanup_obdclass(void)
class_handle_cleanup();
class_exit_uuidlist();
obd_zombie_impexp_stop();
-
-   lprocfs_free_stats(&obd_memory);
 }
 
 MODULE_AUTHOR("Sun Microsystems, Inc. ");
diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_counters.c 
b/drivers/staging/lustre/lustre/obdclass/lprocfs_counters.c
index 1f0004c..6acc4a1 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_counters.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_counters.c
@@ -41,9 +41,6 @@
 #include "../include/lprocfs_status.h"
 #include "../include/obd_support.h"
 
-struct lprocfs_stats *obd_memory;
-EXPORT_SYMBOL(obd_memory);
-
 void lprocfs_counter_add(struct lprocfs_stats *stats, int idx, long amount)
 {
struct lprocfs_counter  *percpu_cntr;
@@ -74,9 +71,6 @@ void lprocfs_counter_add(struct lprocfs_stats *stats, int 
idx, long amount)
 * ldlm_pool_shrink(), which calls lprocfs_counter_add().
 * LU-1727.
 *
-* Only obd_memory uses LPROCFS_STATS_FLAG_IRQ_SAFE
-* flag, because it needs accurate counting lest memory leak
-* check reports error.
 */
if (in_interrupt() &&
(stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE) != 0)
@@ -124,9 +118,6 @@ void lprocfs_counter_sub(struct lprocfs_stats *stats, int 
idx, long amount)
 * softirq context here, use separate counter for that.
 * bz20650.
 *
-* Only obd_memory uses LPROCFS_STATS_FLAG_IRQ_SAFE
-* flag, because it needs accurate counting lest memory leak
-* check reports error.
 */
if (in_interrupt() &&
(stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE) != 0)
diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c 
b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index 08d1f0e..8d2a523 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -1082,7 +1082,7 @@ struct lprocfs_stats *lprocfs_alloc_stats(unsigned int 
num,
goto fail;
stats->ls_biggest_alloc_num = 1;
} else if ((flags & LPROCFS_STATS_FLAG_IRQ_SAFE) != 0) {
-   /* alloc all percpu data, currently only obd_memory use this */
+   /* alloc all percpu data */
for (i = 0; i < num_entry; ++i)
if (lprocfs_stats_alloc_one(stats, i) < 0)
goto fail;
-- 
2

[PATCH v2 06/19] staging/lustre/obdclass: replace OBD_ALLOC_GFP with kzalloc

2015-09-16 Thread green
From: Oleg Drokin 

Part of getting rid of custom Lustre allocation macros.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/obdclass/cl_page.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c 
b/drivers/staging/lustre/lustre/obdclass/cl_page.c
index d5fb81f..e27062d 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_page.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c
@@ -283,8 +283,7 @@ static struct cl_page *cl_page_alloc(const struct lu_env 
*env,
struct cl_page*page;
struct lu_object_header *head;
 
-   OBD_ALLOC_GFP(page, cl_object_header(o)->coh_page_bufsize,
-   GFP_NOFS);
+   page = kzalloc(cl_object_header(o)->coh_page_bufsize, GFP_NOFS);
if (page != NULL) {
int result = 0;
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: unisys: remove reference of visorutil

2015-09-16 Thread Sudip Mukherjee
commit 53490b545cb0 ("staging: unisys: move periodic_work.c into the visorbus 
directory")
has removed the visorutil directory but missed removing the reference in
the Makefile.

Fixes: 53490b545cb0 ("staging: unisys: move periodic_work.c into the visorbus 
directory")
Signed-off-by: Sudip Mukherjee 
---
 drivers/staging/unisys/visorbus/Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/unisys/visorbus/Makefile 
b/drivers/staging/unisys/visorbus/Makefile
index fa27ee5..fc790e7 100644
--- a/drivers/staging/unisys/visorbus/Makefile
+++ b/drivers/staging/unisys/visorbus/Makefile
@@ -10,4 +10,3 @@ visorbus-y += visorchipset.o
 visorbus-y += periodic_work.o
 
 ccflags-y += -Idrivers/staging/unisys/include
-ccflags-y += -Idrivers/staging/unisys/visorutil
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/3] VME bus error handling overhaul

2015-09-16 Thread Dmitry Kalinkin

> On 16 Sep 2015, at 11:55, Dmitry Kalinkin  wrote:
> 
> 
>> On 16 Sep 2015, at 11:53, Greg Kroah-Hartman  
>> wrote:
>> 
>> On Wed, Sep 16, 2015 at 11:39:22AM -0400, Dmitry Kalinkin wrote:
>>> 
 On 05 Aug 2015, at 16:12, Greg Kroah-Hartman  
 wrote:
 
 On Mon, Jul 06, 2015 at 01:31:47PM +0100, Martyn Welch wrote:
> Hi Dmitry,
> 
> These are looking good to me.
 
 Can I get an "Acked-by:" or something so that I know it's ok to apply
 these?
 
 thanks,
 
 greg k-h-
>>> 
>>> Now that we have next cycle, should I resend these?
>> 
>> That would be good.
> 
> It seems like Martyn’s email is dead, it gives me a delivery failure with:
> 
> 550 5.1.1 No such user - pp
> 
> Not sure how to proceed in this case.

I’ve established contact with Martyn. Will try to sort things out together.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: wilc1000: Added spaces

2015-09-16 Thread Aparna Karuthodi
Added spaces around '=' to remove coding style errors detected by
checkpatch.The errors are given below:
drivers/staging/wilc1000/host_interface.c:7951: ERROR: spaces required
around that '=' (ctx:VxV)
drivers/staging/wilc1000/host_interface.c:7952: ERROR: spaces required
around that '=' (ctx:VxW)

Signed-off-by: Aparna Karuthodi 
---
 drivers/staging/wilc1000/host_interface.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 6b10bbb..d1fe73d 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -7945,8 +7945,8 @@ s32 host_int_get_ipaddress(WILC_WFIDrvHandle hWFIDrv, u8 
*u16ipadd, u8 idx)
strHostIFmsg.u16MsgId = HOST_IF_MSG_GET_IPADDRESS;
 
strHostIFmsg.uniHostIFmsgBody.strHostIfSetIP.au8IPAddr = u16ipadd;
-   strHostIFmsg.drvHandler=hWFIDrv;
-   strHostIFmsg.uniHostIFmsgBody.strHostIfSetIP.idx= idx;
+   strHostIFmsg.drvHandler = hWFIDrv;
+   strHostIFmsg.uniHostIFmsgBody.strHostIfSetIP.idx = idx;
 
s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, 
sizeof(tstrHostIFmsg), NULL);
if (s32Error) {
-- 
1.7.9.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: wilc1000: Removed unwanted curly braces

2015-09-16 Thread Dan Carpenter
On Wed, Sep 16, 2015 at 09:50:50PM +0530, Aparna Karuthodi wrote:
> Removed unwanted curly braces of a single statement if-else block to
> remove a coding style warning detected by checkpatch. The warning is
> given below:
> 
> 58: WARNING: braces {} are not necessary for any arm of this statement
> 
> Signed-off-by: Aparna Karuthodi 
> ---
>  drivers/staging/wilc1000/fifo_buffer.c |5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/fifo_buffer.c 
> b/drivers/staging/wilc1000/fifo_buffer.c
> index b6c07cf..4fbac3d 100644
> --- a/drivers/staging/wilc1000/fifo_buffer.c
> +++ b/drivers/staging/wilc1000/fifo_buffer.c
> @@ -52,11 +52,10 @@ u32 FIFO_ReadBytes(tHANDLE hFifo, u8 *pu8Buffer, u32 
> u32BytesToRead, u32 *pu32By
>   if (pstrFifoHandler->u32TotalBytes) {
>   down(&pstrFifoHandler->SemBuffer);
>  
> - if (u32BytesToRead > pstrFifoHandler->u32TotalBytes) {
> + if (u32BytesToRead > pstrFifoHandler->u32TotalBytes)
>   *pu32BytesRead = pstrFifoHandler->u32TotalBytes;
> - } else {
> +  else

The indenting is wrong here.  There is an extra space char.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: comedi: drivers: coding style: fixed block comment style

2015-09-16 Thread Marcos Canán
This is a patch to the drivers.c file that fixes
a block comment style.

Signed-off-by: Marcos Canán 
---
 drivers/staging/comedi/drivers.c |   32 
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index b03bc66..387fac1 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -1,20 +1,20 @@
 /*
-module/drivers.c
-functions for manipulating drivers
-
-COMEDI - Linux Control and Measurement Device Interface
-Copyright (C) 1997-2000 David A. Schleef 
-Copyright (C) 2002 Frank Mori Hess 
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+ *  module/drivers.c
+ *  functions for manipulating drivers
+ *
+ *  COMEDI - Linux Control and Measurement Device Interface
+ *  Copyright (C) 1997-2000 David A. Schleef 
+ *  Copyright (C) 2002 Frank Mori Hess 
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
 */
 
 #include 
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero

2015-09-16 Thread Ronit Halder
Why not the second one?
None of the line edited in first patch haven't changed after that.

On Tue, Sep 15, 2015 at 7:24 PM, Greg KH  wrote:
> On Tue, Sep 15, 2015 at 03:04:58PM +0530, Ronit Halder wrote:
>> This patch fixes the warning generated by sparse
>> "Using plain integer as NULL pointer" by using NULL
>> instead of zero.
>>
>> Signed-off-by: Ronit halder 
>> ---
>>
>> v2: added a new patch in this patch series to fix the NULL comparison style
>
> This patch, and the second one, do not apply to my tree anymore :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero

2015-09-16 Thread Greg KH

A: No.
Q: Should I include quotations after my reply?


http://daringfireball.net/2007/07/on_top

On Thu, Sep 17, 2015 at 07:13:39AM +0530, Ronit Halder wrote:
> Why not the second one?

Second what?

> None of the line edited in first patch haven't changed after that.

I don't understand what you are asking here :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging/lustre: use __noreturn for lbug_with_loc

2015-09-16 Thread Juston Li
fixes sparse error:
drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c:149:6: error:
symbol 'lbug_with_loc'redeclared with different type (originally declared at
drivers/staging/lustre/lustre/libcfs/linux/../../../include/linux/libcfs/libcfs_private.h:82)
- different modifiers

Use the __noreturn macro instead of __attribute__((noreturn))
The macro is exactly that but its usage seems more common and
it is bit more readable.

Signed-off-by: Juston Li 
---
 drivers/staging/lustre/include/linux/libcfs/libcfs_private.h | 2 +-
 drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
index 9544860..6af733d 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
@@ -79,7 +79,7 @@ do {  
\
 
 #define KLASSERT(e) LASSERT(e)
 
-void lbug_with_loc(struct libcfs_debug_msg_data *)__attribute__((noreturn));
+void __noreturn lbug_with_loc(struct libcfs_debug_msg_data *);
 
 #define LBUG()   \
 do {   \
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c 
b/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c
index 4545d54..8689ea7 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c
@@ -146,7 +146,7 @@ void libcfs_run_lbug_upcall(struct libcfs_debug_msg_data 
*msgdata)
 }
 
 /* coverity[+kill] */
-void lbug_with_loc(struct libcfs_debug_msg_data *msgdata)
+void __noreturn lbug_with_loc(struct libcfs_debug_msg_data *msgdata)
 {
libcfs_catastrophe = 1;
libcfs_debug_msg(msgdata, "LBUG\n");
-- 
2.5.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero

2015-09-16 Thread roni
Sorry for the ambiguity.
I am talking about my second patch in the series.
https://lkml.org/lkml/2015/9/15/293

> > None of the line edited in first patch haven't changed after that.

You applied the version 1 of the first patch in the series
https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/commit/?h=staging-testing&id=0e04f3f381c6a3ab3a7ef0ec9ded709e95996527

Since then those lines I changed in the patch mentioned above haven't
changed.

Why my second patch in this series doesn't apply?

regards


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero

2015-09-16 Thread Greg KH
On Thu, Sep 17, 2015 at 08:28:52AM +0530, roni wrote:
> Sorry for the ambiguity.
> I am talking about my second patch in the series.
> https://lkml.org/lkml/2015/9/15/293
> 
> > > None of the line edited in first patch haven't changed after that.
> 
> You applied the version 1 of the first patch in the series
> https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/commit/?h=staging-testing&id=0e04f3f381c6a3ab3a7ef0ec9ded709e95996527
> 
> Since then those lines I changed in the patch mentioned above haven't
> changed.
> 
> Why my second patch in this series doesn't apply?

I don't remember, that was many hundreds of patches ago, sorry.  Try it
yourself to see if I messed up.  Perhaps someone else had already sent
in that same change before you did?

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero

2015-09-16 Thread Ronit Halder
On Wed, 2015-09-16 at 20:15 -0700, Greg KH wrote:
> On Thu, Sep 17, 2015 at 08:28:52AM +0530, roni wrote:
> > Sorry for the ambiguity.
> > I am talking about my second patch in the series.
> > https://lkml.org/lkml/2015/9/15/293
> > 
> > > > None of the line edited in first patch haven't changed after that.
> > 
> > You applied the version 1 of the first patch in the series
> > https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/commit/?h=staging-testing&id=0e04f3f381c6a3ab3a7ef0ec9ded709e95996527
> > 
> > Since then those lines I changed in the patch mentioned above haven't
> > changed.
> > 
> > Why my second patch in this series doesn't apply?
> 
> I don't remember, that was many hundreds of patches ago, sorry.  Try it
> yourself to see if I messed up.  Perhaps someone else had already sent
> in that same change before you did?

git-apply shows no error if I apply second patch on
staging/staging-testing.

regards



___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: lustre: lustre: mdc: lproc_mdc.c: declared file_operations struct as const

2015-09-16 Thread Greg KH
On Wed, Sep 16, 2015 at 06:01:01PM +0530, Sakshi Vaid wrote:
> Declared the file_operations structure as const as done elsewhere in the
> kernel, as there are no modifiactions to this field.
> 
> Following warning found by checkpatch
> WARNING: struct file_operations should normally be const
> 
> Signed-off-by: Sakshi Vaid 
> ---
>  drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c 
> b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
> index c791941..c62c0ac 100644
> --- a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
> +++ b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
> @@ -146,7 +146,7 @@ static ssize_t mdc_kuc_write(struct file *file,
>   return count;
>  }
>  
> -struct file_operations mdc_kuc_fops = {
> +const struct file_operations mdc_kuc_fops = {
>   .open   = mdc_kuc_open,
>   .write  = mdc_kuc_write,
>   .release= single_release,

This doesn't apply to my tree at all, what are you making it against?
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: lustre: lustre: mgc: mgc_request.c: Removed unnecessary space

2015-09-16 Thread Greg KH
On Wed, Sep 16, 2015 at 06:27:12PM +0530, Sakshi Vaid wrote:
> Removed the unnecessary space in the declaration of a pointer.
> The following error was given.
> ERROR: "foo * bar" should be "foo *bar"
> 
> Signed-off-by: Sakshi Vaid 
> ---
>  drivers/staging/lustre/lustre/mgc/mgc_request.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c 
> b/drivers/staging/lustre/lustre/mgc/mgc_request.c
> index 60d2b0f..8d3dbdc 100644
> --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c
> +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c
> @@ -160,7 +160,7 @@ struct config_llog_data *config_log_find(char *logname,
>  {
>   struct config_llog_data *cld;
>   struct config_llog_data *found = NULL;
> - void * instance;
> + void *instance;
>  
>   LASSERT(logname != NULL);
>  

This also doesn't apply :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 03/10] staging: wilc1000: remove INLINE macro

2015-09-16 Thread Greg KH
On Wed, Sep 16, 2015 at 08:11:28PM +0900, Chaehyun Lim wrote:
> This patch removes INLINE macro that is used anymore.
> 
> Signed-off-by: Chaehyun Lim 
> ---
>  drivers/staging/wilc1000/coreconfigurator.c | 1 -
>  drivers/staging/wilc1000/wilc_wlan.c| 1 -
>  2 files changed, 2 deletions(-)

This doesn't apply to my tree anymore, can you refresh it and resend
this and the rest of this series?

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: wilc1000: Added spaces

2015-09-16 Thread Greg KH
On Thu, Sep 17, 2015 at 12:12:50AM +0530, Aparna Karuthodi wrote:
> Added spaces around '=' to remove coding style errors detected by
> checkpatch.The errors are given below:
> drivers/staging/wilc1000/host_interface.c:7951: ERROR: spaces required
> around that '=' (ctx:VxV)
> drivers/staging/wilc1000/host_interface.c:7952: ERROR: spaces required
> around that '=' (ctx:VxW)
> 
> Signed-off-by: Aparna Karuthodi 
> ---
>  drivers/staging/wilc1000/host_interface.c |4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/host_interface.c 
> b/drivers/staging/wilc1000/host_interface.c
> index 6b10bbb..d1fe73d 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -7945,8 +7945,8 @@ s32 host_int_get_ipaddress(WILC_WFIDrvHandle hWFIDrv, 
> u8 *u16ipadd, u8 idx)
>   strHostIFmsg.u16MsgId = HOST_IF_MSG_GET_IPADDRESS;
>  
>   strHostIFmsg.uniHostIFmsgBody.strHostIfSetIP.au8IPAddr = u16ipadd;
> - strHostIFmsg.drvHandler=hWFIDrv;
> - strHostIFmsg.uniHostIFmsgBody.strHostIfSetIP.idx= idx;
> + strHostIFmsg.drvHandler = hWFIDrv;
> + strHostIFmsg.uniHostIFmsgBody.strHostIfSetIP.idx = idx;
>  
>   s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, 
> sizeof(tstrHostIFmsg), NULL);
>   if (s32Error) {
> -- 
> 1.7.9.5

Does not apply to my tree :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: wilc1000: Added new lines

2015-09-16 Thread Greg KH
On Wed, Sep 16, 2015 at 05:42:42PM +0530, Aparna Karuthodi wrote:
> Added new lines after declarations for removing coding style warnings
> detected by checkpatch.The warnings are given below:
> 
> 1561: WARNING: Missing a blank line after declarations
> 1551: WARNING: Missing a blank line after declarations
> 1329: WARNING: Missing a blank line after declarations
> 1213: WARNING: Missing a blank line after declarations
> 1158: WARNING: Missing a blank line after declarations
> 1104: WARNING: Missing a blank line after declarations
> 675: WARNING: Missing a blank line after declarations
> 
> Signed-off-by: Aparna Karuthodi 
> ---
>  drivers/staging/wilc1000/coreconfigurator.c |7 +++
>  1 file changed, 7 insertions(+)

Does not apply to my tree :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: fsl-mc: up-rev version of MC interface code

2015-09-16 Thread Greg KH
On Tue, Sep 15, 2015 at 03:22:00PM -0500, J. German Rivera wrote:
> The DPAA2 management complex has a versioned binary interface
> that has to be kept in sync with the DPAA2 drivers. This patch
> uprevs the APIs that build MC commands and parse results.
> This uprev is needed to support object interrupts.
> 
> MC binary interface changes
>-overall version from 6.0 to 8.0
>-dprc version from 3.0 to 4.0
>-dpbp and dpmcp versions from 2.0 to 2.1
>-new dprc commands -- set/get obj irq, set obj label,
> get obj descriptor
>-removed commands -- get portal paddr
>-object regions are reported as region offsets not physical
> addresses
> 
> build/parse API changes
>-flags arg is added to all APIs for future extensibility,
> hardcoded priority bit is now a flag
>-IRQ-related args are consolidated into an irq_cfg struct
> 
> Signed-off-by: J. German Rivera 
> ---
>  drivers/staging/fsl-mc/bus/dpbp.c   | 141 ++---
>  drivers/staging/fsl-mc/bus/dpmcp-cmd.h  |   2 +-
>  drivers/staging/fsl-mc/bus/dpmcp.c  | 123 +---
>  drivers/staging/fsl-mc/bus/dpmcp.h  | 123 +---
>  drivers/staging/fsl-mc/bus/dpmng.c  |  14 +-
>  drivers/staging/fsl-mc/bus/dprc-cmd.h   |   7 +-
>  drivers/staging/fsl-mc/bus/dprc-driver.c|   8 +-
>  drivers/staging/fsl-mc/bus/dprc.c   | 464 
> +++-
>  drivers/staging/fsl-mc/bus/mc-allocator.c   |   6 +-
>  drivers/staging/fsl-mc/bus/mc-bus.c |  54 +++-
>  drivers/staging/fsl-mc/include/dpbp-cmd.h   |   2 +-
>  drivers/staging/fsl-mc/include/dpbp.h   |  91 --
>  drivers/staging/fsl-mc/include/dpcon-cmd.h  |   2 +-
>  drivers/staging/fsl-mc/include/dpmng.h  |  14 +-
>  drivers/staging/fsl-mc/include/dprc.h   | 313 +++
>  drivers/staging/fsl-mc/include/mc-cmd.h |  28 +-
>  drivers/staging/fsl-mc/include/mc-private.h |  15 +-
>  17 files changed, 1052 insertions(+), 355 deletions(-)

This patch does many things all at once.  Please break it up into
different logical patches, each one only doing one thing, and send it as
a series so that it can be properly reviewed and applied to the tree.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: wlan-ng: fix a wrong type of a assignment

2015-09-16 Thread Greg Kroah-Hartman
On Wed, Sep 16, 2015 at 09:06:13PM +0800, Navy Cheng wrote:
> The type of value is u16 however the return type of cpu_to_le16() is
> __le16. The incorrect type of assignment is complained by sparse.
> 
> Signed-off-by: Navy Cheng 
> ---
>  drivers/staging/wlan-ng/hfa384x.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/wlan-ng/hfa384x.h 
> b/drivers/staging/wlan-ng/hfa384x.h
> index 8dfe438..fe7df37 100644
> --- a/drivers/staging/wlan-ng/hfa384x.h
> +++ b/drivers/staging/wlan-ng/hfa384x.h
> @@ -1385,7 +1385,7 @@ static inline int hfa384x_drvr_getconfig16(hfa384x_t 
> *hw, u16 rid, void *val)
>  
>  static inline int hfa384x_drvr_setconfig16(hfa384x_t *hw, u16 rid, u16 val)
>  {
> - u16 value = cpu_to_le16(val);
> + __le16 value = cpu_to_le16(val);
>  
>   return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value));

but value is a pointer to a u16, doesn't this change now cause another
sparse warning?
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCHv2 02/16] staging: rtl8192u: r8192U_core: add line breaks to keep lines under 80 characters

2015-09-16 Thread Greg Kroah-Hartman
On Fri, Sep 11, 2015 at 03:29:10AM -0400, Raphaël Beamonte wrote:
> Add line breaks in multiple lines to keep them under 80 characters,
> as to follow the kernel code style.
> 
> Signed-off-by: Raphaël Beamonte 
> ---
>  drivers/staging/rtl8192u/r8192U_core.c | 626 
> ++---
>  1 file changed, 421 insertions(+), 205 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
> b/drivers/staging/rtl8192u/r8192U_core.c
> index 5e9d0ac..37c17eb 100644
> --- a/drivers/staging/rtl8192u/r8192U_core.c
> +++ b/drivers/staging/rtl8192u/r8192U_core.c
> @@ -144,25 +144,31 @@ struct CHANNEL_LIST {
>  
>  static struct CHANNEL_LIST ChannelPlan[] = {
>   /* FCC */
> - {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 52, 56, 60, 64, 
> 149, 153, 157, 161, 165}, 24},
> + {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 52, 56, 60, 64,
> +   149, 153, 157, 161, 165}, 24},

But now these look worse than before.  I say just leave these long
variables as-is.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCHv2 03/16] staging: rtl8192u: r8192U_core: add temporary variables to keep lines under 80 characters

2015-09-16 Thread Greg Kroah-Hartman
On Fri, Sep 11, 2015 at 03:29:11AM -0400, Raphaël Beamonte wrote:
> Add some temporary variables to reduce line length under the maximum
> of 80 characters, as per the kernel code style.
> 
> Signed-off-by: Raphaël Beamonte 
> ---
>  drivers/staging/rtl8192u/r8192U_core.c | 139 
> ++---
>  1 file changed, 94 insertions(+), 45 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
> b/drivers/staging/rtl8192u/r8192U_core.c
> index 37c17eb..c8724cd 100644
> --- a/drivers/staging/rtl8192u/r8192U_core.c
> +++ b/drivers/staging/rtl8192u/r8192U_core.c
> @@ -177,6 +177,7 @@ static void rtl819x_set_channel_map(u8 channel_plan, 
> struct r8192_priv *priv)
>  {
>   int i, max_chan = -1, min_chan = -1;
>   struct ieee80211_device *ieee = priv->ieee80211;
> + struct CHANNEL_LIST cl;
>  
>   switch (channel_plan) {
>   case COUNTRY_CODE_FCC:
> @@ -200,15 +201,18 @@ static void rtl819x_set_channel_map(u8 channel_plan, 
> struct r8192_priv *priv)
>"unknown rf chip, can't set channel map in 
> function:%s()\n",
>__func__);
>   }
> - if (ChannelPlan[channel_plan].Len != 0) {
> + cl = ChannelPlan[channel_plan];
> + if (cl.Len != 0) {
>   /* Clear old channel map */
>   memset(GET_DOT11D_INFO(ieee)->channel_map, 0,
>  sizeof(GET_DOT11D_INFO(ieee)->channel_map));
>   /* Set new channel map */
> - for (i = 0; i < ChannelPlan[channel_plan].Len; i++) {
> - if (ChannelPlan[channel_plan].Channel[i] < 
> min_chan || ChannelPlan[channel_plan].Channel[i] > max_chan)
> + for (i = 0; i < cl.Len; i++) {
> + u8 chan = cl.Channel[i];
> +
> + if (chan < min_chan || chan > max_chan)
>   break;
> - 
> GET_DOT11D_INFO(ieee)->channel_map[ChannelPlan[channel_plan].Channel[i]] = 1;
> + GET_DOT11D_INFO(ieee)->channel_map[chan] = 1;
>   }
>   }
>   break;
> @@ -1699,9 +1703,12 @@ short rtl8192_tx(struct net_device *dev, struct 
> sk_buff *skb)
> &zero, 0, tx_zero_isr, dev);
>   status = usb_submit_urb(tx_urb_zero, GFP_ATOMIC);
>   if (status) {
> + atomic_t tx =
> + priv->tx_pending[tcb_desc->queue_index];
> +
>   RT_TRACE(COMP_ERR,
>"Error TX URB for zero byte %d, error 
> %d",
> -  
> atomic_read(&priv->tx_pending[tcb_desc->queue_index]),
> +  atomic_read(&tx),
>status);
>   return -1;
>   }
> @@ -1748,8 +1755,9 @@ static short rtl8192_usb_initendpoints(struct 
> net_device *dev)
>   oldaddr = priv->oldaddr;
>   align = ((long)oldaddr) & 3;
>   if (align) {
> - newaddr = oldaddr + 4 - align;
> - priv->rx_urb[16]->transfer_buffer_length = 16 - 4 + 
> align;
> + align = 4 - align;
> + newaddr = oldaddr + align;
> + priv->rx_urb[16]->transfer_buffer_length = 16 - align;

At a quick glance, this conversion looks wrong...

And it's not what your changelog text said you were doing :(

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCHv2 03/16] staging: rtl8192u: r8192U_core: add temporary variables to keep lines under 80 characters

2015-09-16 Thread Raphaël Beamonte
2015-09-17 0:57 GMT-04:00 Greg Kroah-Hartman :

>> @@ -1748,8 +1755,9 @@ static short rtl8192_usb_initendpoints(struct 
>> net_device *dev)
>>   oldaddr = priv->oldaddr;
>>   align = ((long)oldaddr) & 3;
>>   if (align) {
>> - newaddr = oldaddr + 4 - align;
>> - priv->rx_urb[16]->transfer_buffer_length = 16 - 4 + 
>> align;
>> + align = 4 - align;
>> + newaddr = oldaddr + align;
>> + priv->rx_urb[16]->transfer_buffer_length = 16 - align;
>
> At a quick glance, this conversion looks wrong...

What is wrong with it?

oldaddr + 4 - align;
can also be read:
oldaddr + (4 - align);

as well as
16 - 4 + align;
can also be read
16 - (4 - align);
as when we remove the parenthesis, the - sign invert the parenthesis
elements signs.

Calculating (4 - align) previously thus preserve the logic here!

> And it's not what your changelog text said you were doing :(

It's true that I didn't add a new temporary variable here but instead
re-used one that is not used after, but I thought it went in the same
idea as the rest of this patch. Should I separate that as another
patch?
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCHv2 03/16] staging: rtl8192u: r8192U_core: add temporary variables to keep lines under 80 characters

2015-09-16 Thread Greg Kroah-Hartman
On Thu, Sep 17, 2015 at 01:06:33AM -0400, Raphaël Beamonte wrote:
> 2015-09-17 0:57 GMT-04:00 Greg Kroah-Hartman :
> 
> >> @@ -1748,8 +1755,9 @@ static short rtl8192_usb_initendpoints(struct 
> >> net_device *dev)
> >>   oldaddr = priv->oldaddr;
> >>   align = ((long)oldaddr) & 3;
> >>   if (align) {
> >> - newaddr = oldaddr + 4 - align;
> >> - priv->rx_urb[16]->transfer_buffer_length = 16 - 4 + 
> >> align;
> >> + align = 4 - align;
> >> + newaddr = oldaddr + align;
> >> + priv->rx_urb[16]->transfer_buffer_length = 16 - 
> >> align;
> >
> > At a quick glance, this conversion looks wrong...
> 
> What is wrong with it?
> 
> oldaddr + 4 - align;
> can also be read:
> oldaddr + (4 - align);
> 
> as well as
> 16 - 4 + align;
> can also be read
> 16 - (4 - align);
> as when we remove the parenthesis, the - sign invert the parenthesis
> elements signs.
> 
> Calculating (4 - align) previously thus preserve the logic here!

Ugh, it's been a long day, yeah, ok, this is the same, you are right.

But step back please, what exactly is this trying to do?  I think it's a
round_up type function, perhaps that should be what we do instead (the
kernel has such functions already.)

> > And it's not what your changelog text said you were doing :(
> 
> It's true that I didn't add a new temporary variable here but instead
> re-used one that is not used after, but I thought it went in the same
> idea as the rest of this patch. Should I separate that as another
> patch?

It might be the same "idea", but it's not what you did, so don't try to
sneak it in.

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: wlan-ng: fix a wrong type of a assignment

2015-09-16 Thread Navy Cheng
On Wed, Sep 16, 2015 at 09:52:06PM -0700, Greg Kroah-Hartman wrote:
> On Wed, Sep 16, 2015 at 09:06:13PM +0800, Navy Cheng wrote:
> > The type of value is u16 however the return type of cpu_to_le16() is
> > __le16. The incorrect type of assignment is complained by sparse.
> > 
> > Signed-off-by: Navy Cheng 
> > ---
> >  drivers/staging/wlan-ng/hfa384x.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/staging/wlan-ng/hfa384x.h 
> > b/drivers/staging/wlan-ng/hfa384x.h
> > index 8dfe438..fe7df37 100644
> > --- a/drivers/staging/wlan-ng/hfa384x.h
> > +++ b/drivers/staging/wlan-ng/hfa384x.h
> > @@ -1385,7 +1385,7 @@ static inline int hfa384x_drvr_getconfig16(hfa384x_t 
> > *hw, u16 rid, void *val)
> >  
> >  static inline int hfa384x_drvr_setconfig16(hfa384x_t *hw, u16 rid, u16 val)
> >  {
> > -   u16 value = cpu_to_le16(val);
> > +   __le16 value = cpu_to_le16(val);
> >  
> > return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value));
> 
> but value is a pointer to a u16, doesn't this change now cause another
> sparse warning?

Sorry, do you mean &value is a pointer to a u16?

I use *make C=2 CF="-D__CHECK_ENDIAN__" drivers/staging/wlan-ng* to check
the warnings.

before the fixing, there are many repeated warnings like this:

/home/navy/linux/drivers/staging/wlan-ng/hfa384x.h:1382:34: warning: cast 
to restricted __le16
/home/navy/linux/drivers/staging/wlan-ng/hfa384x.h:1388:21: warning: 
incorrect type in initializer (different base types)
/home/navy/linux/drivers/staging/wlan-ng/hfa384x.h:1388:21:expected 
unsigned short [unsigned] [usertype] value
/home/navy/linux/drivers/staging/wlan-ng/hfa384x.h:1388:21:got 
restricted __le16 [usertype] 

after the fixing, the warnigs of hfa384x.h is still redundant, but only
one pattern, like:

/home/navy/linux/drivers/staging/wlan-ng/hfa384x.h:1382:34: warning: cast 
to restricted __le16

So I think this fixing dosn't cause another warnings.

There is still one warnings for hfa384x.h and many other warnings for other
files in staging/wlan-ng/. I'm not familiar with sending patch sets, so I
only send one patch about one problem.

Do this patch is needed and do you want a patchv2? If the warnings is
needed, I want to send more patches to fix the sparse warings in wlan-ng.

Thanks.

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 1/2] Staging: wilc1000: Use NULL instead of zero

2015-09-16 Thread Sudip Mukherjee
On Thu, Sep 17, 2015 at 09:09:35AM +0530, Ronit Halder wrote:
> On Wed, 2015-09-16 at 20:15 -0700, Greg KH wrote:
> > On Thu, Sep 17, 2015 at 08:28:52AM +0530, roni wrote:

> > 
> > I don't remember, that was many hundreds of patches ago, sorry.  Try it
> > yourself to see if I messed up.  Perhaps someone else had already sent
> > in that same change before you did?
> 
> git-apply shows no error if I apply second patch on
> staging/staging-testing.
If you think your patch still applies properly then please resend it.

regards
sudip
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel