linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] Staging: winbond: Fixed some coding style issues
@ 2013-08-05  9:58 Iker Pedrosa
  2013-08-05  9:58 ` [PATCH 1/6] Staging: winbond: wb35reg: changed sleep function from msleep to usleep Iker Pedrosa
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Iker Pedrosa @ 2013-08-05  9:58 UTC (permalink / raw)
  To: pavel
  Cc: gregkh, justinmattock, ikerpedrosam, mujeeb.adil, harsh1kumar,
	devel, linux-kernel

Fixes some coding style issues from drivers/staging/winbond

Iker Pedrosa (6):
  Staging: winbond: wb35reg: changed sleep function from msleep to
    usleep
  Staging: winbond: wb35reg: white space deleted
  Staging: winbond: wb35reg: avoided use of extern function
  Staging: winbond: mds: fixed some lines over 80 characters
  Staging: winbond: mds_f: fixed lines over 80 characters
  Staging: winbond: mds_f: deleted extern function

 drivers/staging/winbond/mds.c             | 56 ++++++++++++++++++-------------
 drivers/staging/winbond/mds_f.h           | 13 ++++---
 drivers/staging/winbond/phy_calibration.h |  1 +
 drivers/staging/winbond/wb35reg.c         | 13 ++++---
 4 files changed, 48 insertions(+), 35 deletions(-)

-- 
1.8.1.2


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

* [PATCH 1/6] Staging: winbond: wb35reg: changed sleep function from msleep to usleep
  2013-08-05  9:58 [PATCH 0/6] Staging: winbond: Fixed some coding style issues Iker Pedrosa
@ 2013-08-05  9:58 ` Iker Pedrosa
  2013-08-12 10:05   ` Pavel Machek
  2013-08-05  9:58 ` [PATCH 2/6] Staging: winbond: wb35reg: white space deleted Iker Pedrosa
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Iker Pedrosa @ 2013-08-05  9:58 UTC (permalink / raw)
  To: pavel
  Cc: gregkh, justinmattock, ikerpedrosam, mujeeb.adil, harsh1kumar,
	devel, linux-kernel

Changed sleep function from msleep to usleep according to the documentation.

Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>
---
 drivers/staging/winbond/wb35reg.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/winbond/wb35reg.c b/drivers/staging/winbond/wb35reg.c
index 9be1b3b..34a2618 100644
--- a/drivers/staging/winbond/wb35reg.c
+++ b/drivers/staging/winbond/wb35reg.c
@@ -134,7 +134,7 @@ unsigned char Wb35Reg_WriteSync(struct hw_data *pHwData, u16 RegisterNo, u32 Reg
 
 	/* Wait until EP0VM stop */
 	while (reg->EP0vm_state != VM_STOP)
-		msleep(10);
+		usleep(10000);
 
 	/* Sync IoCallDriver */
 	reg->EP0vm_state = VM_RUNNING;
@@ -301,7 +301,7 @@ unsigned char Wb35Reg_ReadSync(struct hw_data *pHwData, u16 RegisterNo, u32 *pRe
 
 	/* Wait until EP0VM stop */
 	while (reg->EP0vm_state != VM_STOP)
-		msleep(10);
+		usleep(10000);
 
 	reg->EP0vm_state = VM_RUNNING;
 	ret = usb_control_msg(pHwData->udev,
@@ -501,9 +501,9 @@ void Wb35Reg_destroy(struct hw_data *pHwData)
 
 	/* Wait for Reg operation completed */
 	do {
-		msleep(10); /* Delay for waiting function enter */
+		usleep(10000); /* Delay for waiting function enter */
 	} while (reg->EP0vm_state != VM_STOP);
-	msleep(10);  /* Delay for waiting function enter */
+	usleep(10000);  /* Delay for waiting function enter */
 
 	/* Release all the data in RegQueue */
 	spin_lock_irq(&reg->EP0VM_spin_lock);
-- 
1.8.1.2


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

* [PATCH 2/6] Staging: winbond: wb35reg: white space deleted
  2013-08-05  9:58 [PATCH 0/6] Staging: winbond: Fixed some coding style issues Iker Pedrosa
  2013-08-05  9:58 ` [PATCH 1/6] Staging: winbond: wb35reg: changed sleep function from msleep to usleep Iker Pedrosa
@ 2013-08-05  9:58 ` Iker Pedrosa
  2013-08-12 10:05   ` Pavel Machek
  2013-08-05  9:58 ` [PATCH 3/6] Staging: winbond: wb35reg: avoided use of extern function Iker Pedrosa
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Iker Pedrosa @ 2013-08-05  9:58 UTC (permalink / raw)
  To: pavel
  Cc: gregkh, justinmattock, ikerpedrosam, mujeeb.adil, harsh1kumar,
	devel, linux-kernel

White space deleted before a semicolon.

Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>
---
 drivers/staging/winbond/wb35reg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/winbond/wb35reg.c b/drivers/staging/winbond/wb35reg.c
index 34a2618..1314f93 100644
--- a/drivers/staging/winbond/wb35reg.c
+++ b/drivers/staging/winbond/wb35reg.c
@@ -44,7 +44,7 @@ unsigned char Wb35Reg_BurstWrite(struct hw_data *pHwData, u16 RegisterNo, u32 *p
 	reg_queue->pBuffer = (u32 *)((u8 *)reg_queue + sizeof(struct wb35_reg_queue));
 	memcpy(reg_queue->pBuffer, pRegisterData, DataSize);
 	/* the function for reversing register data from little endian to big endian */
-	for (i = 0; i < NumberOfData ; i++)
+	for (i = 0; i < NumberOfData; i++)
 		reg_queue->pBuffer[i] = cpu_to_le32(reg_queue->pBuffer[i]);
 
 	dr = (struct usb_ctrlrequest *)((u8 *)reg_queue + sizeof(struct wb35_reg_queue) + DataSize);
-- 
1.8.1.2


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

* [PATCH 3/6] Staging: winbond: wb35reg: avoided use of extern function
  2013-08-05  9:58 [PATCH 0/6] Staging: winbond: Fixed some coding style issues Iker Pedrosa
  2013-08-05  9:58 ` [PATCH 1/6] Staging: winbond: wb35reg: changed sleep function from msleep to usleep Iker Pedrosa
  2013-08-05  9:58 ` [PATCH 2/6] Staging: winbond: wb35reg: white space deleted Iker Pedrosa
@ 2013-08-05  9:58 ` Iker Pedrosa
  2013-08-12 10:05   ` Pavel Machek
  2013-08-05  9:58 ` [PATCH 4/6] Staging: winbond: mds: fixed some lines over 80 characters Iker Pedrosa
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Iker Pedrosa @ 2013-08-05  9:58 UTC (permalink / raw)
  To: pavel
  Cc: gregkh, justinmattock, ikerpedrosam, mujeeb.adil, harsh1kumar,
	devel, linux-kernel

Prototype of a function added to the header to avoid the use of extern.

Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>
---
 drivers/staging/winbond/phy_calibration.h | 1 +
 drivers/staging/winbond/wb35reg.c         | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/winbond/phy_calibration.h b/drivers/staging/winbond/phy_calibration.h
index 84f6e84..78fc680 100644
--- a/drivers/staging/winbond/phy_calibration.h
+++ b/drivers/staging/winbond/phy_calibration.h
@@ -79,6 +79,7 @@
 #define SHIFT_IQCAL_TONE_Q(x)	((x) >> 13)
 
 void phy_set_rf_data(struct hw_data *pHwData, u32 index, u32 value);
+void phy_calibration_winbond(struct hw_data *phw_data, u32 frequency);
 #define phy_init_rf(_A)		/* RFSynthesizer_initial(_A) */
 
 #endif
diff --git a/drivers/staging/winbond/wb35reg.c b/drivers/staging/winbond/wb35reg.c
index 1314f93..a500904 100644
--- a/drivers/staging/winbond/wb35reg.c
+++ b/drivers/staging/winbond/wb35reg.c
@@ -1,10 +1,9 @@
 #include "wb35reg_f.h"
+#include "phy_calibration.h"
 
 #include <linux/usb.h>
 #include <linux/slab.h>
 
-extern void phy_calibration_winbond(struct hw_data *phw_data, u32 frequency);
-
 /*
  * true  : read command process successfully
  * false : register not support
-- 
1.8.1.2


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

* [PATCH 4/6] Staging: winbond: mds: fixed some lines over 80 characters
  2013-08-05  9:58 [PATCH 0/6] Staging: winbond: Fixed some coding style issues Iker Pedrosa
                   ` (2 preceding siblings ...)
  2013-08-05  9:58 ` [PATCH 3/6] Staging: winbond: wb35reg: avoided use of extern function Iker Pedrosa
@ 2013-08-05  9:58 ` Iker Pedrosa
  2013-08-12 10:06   ` Pavel Machek
  2013-08-05  9:58 ` [PATCH 5/6] Staging: winbond: mds_f: fixed " Iker Pedrosa
  2013-08-05  9:58 ` [PATCH 6/6] Staging: winbond: mds_f: deleted extern function Iker Pedrosa
  5 siblings, 1 reply; 14+ messages in thread
From: Iker Pedrosa @ 2013-08-05  9:58 UTC (permalink / raw)
  To: pavel
  Cc: gregkh, justinmattock, ikerpedrosam, mujeeb.adil, harsh1kumar,
	devel, linux-kernel

Fixed some coding style issues

Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>
---
 drivers/staging/winbond/mds.c | 56 +++++++++++++++++++++++++------------------
 1 file changed, 33 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/winbond/mds.c b/drivers/staging/winbond/mds.c
index faa93f0..fcc3d21 100644
--- a/drivers/staging/winbond/mds.c
+++ b/drivers/staging/winbond/mds.c
@@ -15,7 +15,8 @@ Mds_initial(struct wbsoft_priv *adapter)
 	return hal_get_tx_buffer(&adapter->sHwData, &pMds->pTxBuffer);
 }
 
-static void Mds_DurationSet(struct wbsoft_priv *adapter,  struct wb35_descriptor *pDes,  u8 *buffer)
+static void Mds_DurationSet(struct wbsoft_priv *adapter,
+			    struct wb35_descriptor *pDes, u8 *buffer)
 {
 	struct T00_descriptor *pT00;
 	struct T01_descriptor *pT01;
@@ -43,10 +44,11 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,  struct wb35_descriptor
 	 * Set RTS/CTS mechanism
 	 ******************************************/
 	if (!boGroupAddr) {
-		/* NOTE : If the protection mode is enabled and the MSDU will be fragmented,
-		 *		 the tx rates of MPDUs will all be DSSS rates. So it will not use
-		 *		 CTS-to-self in this case. CTS-To-self will only be used when without
-		 *		 fragmentation. -- 20050112 */
+		/* NOTE : If the protection mode is enabled and the MSDU will
+		 *	  be fragmented, the tx rates of MPDUs will all be DSSS
+		 *	  rates. So it will not use CTS-to-self in this case.
+		 *	  CTS-To-self will only be used when without
+		 *	  fragmentation. -- 20050112 */
 		BodyLen = (u16)pT00->T00_frame_length;	/* include 802.11 header */
 		BodyLen += 4;	/* CRC */
 
@@ -90,8 +92,8 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,  struct wb35_descriptor
 				 * CTS Rate : 24 Mega bps
 				 * CTS frame length = 14 bytes */
 				Duration += (DEFAULT_SIFSTIME +
-								PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION +
-								((112 + 22 + 95)/96)*Tsym);
+					    PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION +
+					    ((112 + 22 + 95)/96)*Tsym);
 			} else {
 				/* CTS + 1 SIFS + CTS duration
 				 * CTS Rate : ?? Mega bps
@@ -101,7 +103,8 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,  struct wb35_descriptor
 				else
 					Duration += SHORT_PREAMBLE_PLUS_PLCPHEADER_TIME;
 
-				Duration += (((112 + Rate-1) / Rate) + DEFAULT_SIFSTIME);
+				Duration += (((112 + Rate-1) / Rate) +
+					     DEFAULT_SIFSTIME);
 			}
 		}
 
@@ -127,9 +130,10 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,  struct wb35_descriptor
 				 *  Rate : ??Mega bps
 				 *  ACK frame length = 14 bytes, tx rate = 24M */
 				Duration = PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION * 3;
-				Duration += (((NextBodyLen*8 + 22 + Rate*4 - 1)/(Rate*4)) * Tsym +
-							(((2*14)*8 + 22 + 95)/96)*Tsym +
-							DEFAULT_SIFSTIME*3);
+				Duration += (((NextBodyLen*8 + 22 + Rate*4 - 1)
+					     /(Rate*4)) * Tsym +
+					     (((2*14)*8 + 22 + 95)/96)*Tsym +
+					    DEFAULT_SIFSTIME*3);
 			} else {
 				/* DSSS
 				 *  data transmit time + 2 ACK + 3 SIFS
@@ -141,8 +145,9 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,  struct wb35_descriptor
 				else
 					Duration = SHORT_PREAMBLE_PLUS_PLCPHEADER_TIME*3;
 
-				Duration += (((NextBodyLen + (2*14))*8 + Rate-1) / Rate +
-							DEFAULT_SIFSTIME*3);
+				Duration += (((NextBodyLen + (2*14))*8
+					     + Rate-1) / Rate +
+					    DEFAULT_SIFSTIME*3);
 			}
 
 			((u16 *)buffer)[5] = cpu_to_le16(Duration); /* 4 USHOR for skip 8B USB, 2USHORT=FC + Duration */
@@ -168,7 +173,8 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,  struct wb35_descriptor
 			 * ACK frame length = 14 bytes */
 			Duration = PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION;
 			/* The Tx rate of ACK use 24M */
-			Duration += (((112 + 22 + 95)/96)*Tsym + DEFAULT_SIFSTIME);
+			Duration += (((112 + 22 + 95)/96)*Tsym +
+				    DEFAULT_SIFSTIME);
 		} else {
 			/* DSSS
 			 * 1 ACK + 1 SIFS
@@ -191,7 +197,8 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,  struct wb35_descriptor
 }
 
 /* The function return the 4n size of usb pk */
-static u16 Mds_BodyCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *pDes, u8 *TargetBuffer)
+static u16 Mds_BodyCopy(struct wbsoft_priv *adapter,
+			struct wb35_descriptor *pDes, u8 *TargetBuffer)
 {
 	struct T00_descriptor *pT00;
 	struct wb35_mds *pMds = &adapter->Mds;
@@ -246,7 +253,7 @@ static u16 Mds_BodyCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *pDe
 				buf_index++;
 				buf_index %= MAX_DESCRIPTOR_BUFFER_INDEX;
 			} else {
-				u8	*pctmp = pDes->buffer_address[buf_index];
+				u8 *pctmp = pDes->buffer_address[buf_index];
 				pctmp += CopySize;
 				pDes->buffer_address[buf_index] = pctmp;
 				pDes->buffer_size[buf_index] -= CopySize;
@@ -290,7 +297,8 @@ static u16 Mds_BodyCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *pDe
 	return Size;
 }
 
-static void Mds_HeaderCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *pDes, u8 *TargetBuffer)
+static void Mds_HeaderCopy(struct wbsoft_priv *adapter,
+			   struct wb35_descriptor *pDes, u8 *TargetBuffer)
 {
 	struct wb35_mds *pMds = &adapter->Mds;
 	u8	*src_buffer = pDes->buffer_address[0]; /* 931130.5.g */
@@ -391,11 +399,12 @@ static void Mds_HeaderCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *
 		pDes->PreambleMode =  WLAN_PREAMBLE_TYPE_LONG;
 	else
 		pDes->PreambleMode =  CURRENT_PREAMBLE_MODE;
-	pT01->T01_plcp_header_length = pDes->PreambleMode;	/* Set preamble */
+	pT01->T01_plcp_header_length = pDes->PreambleMode; /* Set preamble */
 
 }
 
-static void MLME_GetNextPacket(struct wbsoft_priv *adapter, struct wb35_descriptor *desc)
+static void MLME_GetNextPacket(struct wbsoft_priv *adapter,
+			       struct wb35_descriptor *desc)
 {
 	desc->InternalUsed = desc->buffer_start_index + desc->buffer_number;
 	desc->InternalUsed %= MAX_DESCRIPTOR_BUFFER_INDEX;
@@ -423,7 +432,8 @@ static void MLMEfreeMMPDUBuffer(struct wbsoft_priv *adapter, s8 *pData)
 	}
 }
 
-static void MLME_SendComplete(struct wbsoft_priv *adapter, u8 PacketID, unsigned char SendOK)
+static void MLME_SendComplete(struct wbsoft_priv *adapter, u8 PacketID,
+			      unsigned char SendOK)
 {
     /* Reclaim the data buffer */
 	adapter->sMlmeFrame.len = 0;
@@ -440,9 +450,9 @@ Mds_Tx(struct wbsoft_priv *adapter)
 	struct wb35_mds *pMds = &adapter->Mds;
 	struct wb35_descriptor	TxDes;
 	struct wb35_descriptor *pTxDes = &TxDes;
-	u8		*XmitBufAddress;
-	u16		XmitBufSize, PacketSize, stmp, CurrentSize, FragmentThreshold;
-	u8		FillIndex, TxDesIndex, FragmentCount, FillCount;
+	u8	*XmitBufAddress;
+	u16	XmitBufSize, PacketSize, stmp, CurrentSize, FragmentThreshold;
+	u8	FillIndex, TxDesIndex, FragmentCount, FillCount;
 	unsigned char	BufferFilled = false;
 
 
-- 
1.8.1.2


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

* [PATCH 5/6] Staging: winbond: mds_f: fixed lines over 80 characters
  2013-08-05  9:58 [PATCH 0/6] Staging: winbond: Fixed some coding style issues Iker Pedrosa
                   ` (3 preceding siblings ...)
  2013-08-05  9:58 ` [PATCH 4/6] Staging: winbond: mds: fixed some lines over 80 characters Iker Pedrosa
@ 2013-08-05  9:58 ` Iker Pedrosa
  2013-08-12 10:06   ` Pavel Machek
  2013-08-05  9:58 ` [PATCH 6/6] Staging: winbond: mds_f: deleted extern function Iker Pedrosa
  5 siblings, 1 reply; 14+ messages in thread
From: Iker Pedrosa @ 2013-08-05  9:58 UTC (permalink / raw)
  To: pavel
  Cc: gregkh, justinmattock, ikerpedrosam, mujeeb.adil, harsh1kumar,
	devel, linux-kernel

Fixed some coding style issues.

Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>
---
 drivers/staging/winbond/mds_f.h | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/winbond/mds_f.h b/drivers/staging/winbond/mds_f.h
index ce8be07..ce5a78c 100644
--- a/drivers/staging/winbond/mds_f.h
+++ b/drivers/staging/winbond/mds_f.h
@@ -7,13 +7,17 @@
 unsigned char Mds_initial(struct wbsoft_priv *adapter);
 void Mds_Tx(struct wbsoft_priv *adapter);
 void Mds_SendComplete(struct wbsoft_priv *adapter, struct T02_descriptor *pt02);
-void Mds_MpduProcess(struct wbsoft_priv *adapter, struct wb35_descriptor *prxdes);
+void Mds_MpduProcess(struct wbsoft_priv *adapter,
+		     struct wb35_descriptor *prxdes);
 extern void DataDmp(u8 *pdata, u32 len, u32 offset);
 
 /* For data frame sending */
 u16 MDS_GetPacketSize(struct wbsoft_priv *adapter);
-void MDS_GetNextPacket(struct wbsoft_priv *adapter, struct wb35_descriptor *pdes);
-void MDS_GetNextPacketComplete(struct wbsoft_priv *adapter, struct wb35_descriptor *pdes);
-void MDS_SendResult(struct wbsoft_priv *adapter, u8 packetid, unsigned char sendok);
+void MDS_GetNextPacket(struct wbsoft_priv *adapter,
+		       struct wb35_descriptor *pdes);
+void MDS_GetNextPacketComplete(struct wbsoft_priv *adapter,
+			       struct wb35_descriptor *pdes);
+void MDS_SendResult(struct wbsoft_priv *adapter, u8 packetid,
+		    unsigned char sendok);
 
 #endif
-- 
1.8.1.2


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

* [PATCH 6/6] Staging: winbond: mds_f: deleted extern function
  2013-08-05  9:58 [PATCH 0/6] Staging: winbond: Fixed some coding style issues Iker Pedrosa
                   ` (4 preceding siblings ...)
  2013-08-05  9:58 ` [PATCH 5/6] Staging: winbond: mds_f: fixed " Iker Pedrosa
@ 2013-08-05  9:58 ` Iker Pedrosa
  2013-08-12 10:07   ` Pavel Machek
  5 siblings, 1 reply; 14+ messages in thread
From: Iker Pedrosa @ 2013-08-05  9:58 UTC (permalink / raw)
  To: pavel
  Cc: gregkh, justinmattock, ikerpedrosam, mujeeb.adil, harsh1kumar,
	devel, linux-kernel

Deleted an extern function that wasn't used in this driver.

Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>
---
 drivers/staging/winbond/mds_f.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/winbond/mds_f.h b/drivers/staging/winbond/mds_f.h
index ce5a78c..159b2eb 100644
--- a/drivers/staging/winbond/mds_f.h
+++ b/drivers/staging/winbond/mds_f.h
@@ -9,7 +9,6 @@ void Mds_Tx(struct wbsoft_priv *adapter);
 void Mds_SendComplete(struct wbsoft_priv *adapter, struct T02_descriptor *pt02);
 void Mds_MpduProcess(struct wbsoft_priv *adapter,
 		     struct wb35_descriptor *prxdes);
-extern void DataDmp(u8 *pdata, u32 len, u32 offset);
 
 /* For data frame sending */
 u16 MDS_GetPacketSize(struct wbsoft_priv *adapter);
-- 
1.8.1.2


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

* Re: [PATCH 1/6] Staging: winbond: wb35reg: changed sleep function from msleep to usleep
  2013-08-05  9:58 ` [PATCH 1/6] Staging: winbond: wb35reg: changed sleep function from msleep to usleep Iker Pedrosa
@ 2013-08-12 10:05   ` Pavel Machek
  2013-08-16 11:41     ` Iker Pedrosa
  0 siblings, 1 reply; 14+ messages in thread
From: Pavel Machek @ 2013-08-12 10:05 UTC (permalink / raw)
  To: Iker Pedrosa
  Cc: gregkh, justinmattock, mujeeb.adil, harsh1kumar, devel, linux-kernel

On Mon 2013-08-05 11:58:27, Iker Pedrosa wrote:
> Changed sleep function from msleep to usleep according to the documentation.
> 
> Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>

Can you explain why this is good idea?

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [PATCH 2/6] Staging: winbond: wb35reg: white space deleted
  2013-08-05  9:58 ` [PATCH 2/6] Staging: winbond: wb35reg: white space deleted Iker Pedrosa
@ 2013-08-12 10:05   ` Pavel Machek
  0 siblings, 0 replies; 14+ messages in thread
From: Pavel Machek @ 2013-08-12 10:05 UTC (permalink / raw)
  To: Iker Pedrosa
  Cc: gregkh, justinmattock, mujeeb.adil, harsh1kumar, devel, linux-kernel

On Mon 2013-08-05 11:58:28, Iker Pedrosa wrote:
> White space deleted before a semicolon.
> 
> Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>

ACK.

> ---
>  drivers/staging/winbond/wb35reg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/winbond/wb35reg.c b/drivers/staging/winbond/wb35reg.c
> index 34a2618..1314f93 100644
> --- a/drivers/staging/winbond/wb35reg.c
> +++ b/drivers/staging/winbond/wb35reg.c
> @@ -44,7 +44,7 @@ unsigned char Wb35Reg_BurstWrite(struct hw_data *pHwData, u16 RegisterNo, u32 *p
>  	reg_queue->pBuffer = (u32 *)((u8 *)reg_queue + sizeof(struct wb35_reg_queue));
>  	memcpy(reg_queue->pBuffer, pRegisterData, DataSize);
>  	/* the function for reversing register data from little endian to big endian */
> -	for (i = 0; i < NumberOfData ; i++)
> +	for (i = 0; i < NumberOfData; i++)
>  		reg_queue->pBuffer[i] = cpu_to_le32(reg_queue->pBuffer[i]);
>  
>  	dr = (struct usb_ctrlrequest *)((u8 *)reg_queue + sizeof(struct wb35_reg_queue) + DataSize);

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [PATCH 3/6] Staging: winbond: wb35reg: avoided use of extern function
  2013-08-05  9:58 ` [PATCH 3/6] Staging: winbond: wb35reg: avoided use of extern function Iker Pedrosa
@ 2013-08-12 10:05   ` Pavel Machek
  0 siblings, 0 replies; 14+ messages in thread
From: Pavel Machek @ 2013-08-12 10:05 UTC (permalink / raw)
  To: Iker Pedrosa
  Cc: gregkh, justinmattock, mujeeb.adil, harsh1kumar, devel, linux-kernel

On Mon 2013-08-05 11:58:29, Iker Pedrosa wrote:
> Prototype of a function added to the header to avoid the use of extern.
> 
> Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>

ACK.

> ---
>  drivers/staging/winbond/phy_calibration.h | 1 +
>  drivers/staging/winbond/wb35reg.c         | 3 +--
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/winbond/phy_calibration.h b/drivers/staging/winbond/phy_calibration.h
> index 84f6e84..78fc680 100644
> --- a/drivers/staging/winbond/phy_calibration.h
> +++ b/drivers/staging/winbond/phy_calibration.h
> @@ -79,6 +79,7 @@
>  #define SHIFT_IQCAL_TONE_Q(x)	((x) >> 13)
>  
>  void phy_set_rf_data(struct hw_data *pHwData, u32 index, u32 value);
> +void phy_calibration_winbond(struct hw_data *phw_data, u32 frequency);
>  #define phy_init_rf(_A)		/* RFSynthesizer_initial(_A) */
>  
>  #endif
> diff --git a/drivers/staging/winbond/wb35reg.c b/drivers/staging/winbond/wb35reg.c
> index 1314f93..a500904 100644
> --- a/drivers/staging/winbond/wb35reg.c
> +++ b/drivers/staging/winbond/wb35reg.c
> @@ -1,10 +1,9 @@
>  #include "wb35reg_f.h"
> +#include "phy_calibration.h"
>  
>  #include <linux/usb.h>
>  #include <linux/slab.h>
>  
> -extern void phy_calibration_winbond(struct hw_data *phw_data, u32 frequency);
> -
>  /*
>   * true  : read command process successfully
>   * false : register not support

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [PATCH 4/6] Staging: winbond: mds: fixed some lines over 80 characters
  2013-08-05  9:58 ` [PATCH 4/6] Staging: winbond: mds: fixed some lines over 80 characters Iker Pedrosa
@ 2013-08-12 10:06   ` Pavel Machek
  0 siblings, 0 replies; 14+ messages in thread
From: Pavel Machek @ 2013-08-12 10:06 UTC (permalink / raw)
  To: Iker Pedrosa
  Cc: gregkh, justinmattock, mujeeb.adil, harsh1kumar, devel, linux-kernel

On Mon 2013-08-05 11:58:30, Iker Pedrosa wrote:
> Fixed some coding style issues
> 
> Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>

ACK.

> ---
>  drivers/staging/winbond/mds.c | 56 +++++++++++++++++++++++++------------------
>  1 file changed, 33 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/staging/winbond/mds.c b/drivers/staging/winbond/mds.c
> index faa93f0..fcc3d21 100644
> --- a/drivers/staging/winbond/mds.c
> +++ b/drivers/staging/winbond/mds.c
> @@ -15,7 +15,8 @@ Mds_initial(struct wbsoft_priv *adapter)
>  	return hal_get_tx_buffer(&adapter->sHwData, &pMds->pTxBuffer);
>  }
>  
> -static void Mds_DurationSet(struct wbsoft_priv *adapter,  struct wb35_descriptor *pDes,  u8 *buffer)
> +static void Mds_DurationSet(struct wbsoft_priv *adapter,
> +			    struct wb35_descriptor *pDes, u8 *buffer)
>  {
>  	struct T00_descriptor *pT00;
>  	struct T01_descriptor *pT01;
> @@ -43,10 +44,11 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,  struct wb35_descriptor
>  	 * Set RTS/CTS mechanism
>  	 ******************************************/
>  	if (!boGroupAddr) {
> -		/* NOTE : If the protection mode is enabled and the MSDU will be fragmented,
> -		 *		 the tx rates of MPDUs will all be DSSS rates. So it will not use
> -		 *		 CTS-to-self in this case. CTS-To-self will only be used when without
> -		 *		 fragmentation. -- 20050112 */
> +		/* NOTE : If the protection mode is enabled and the MSDU will
> +		 *	  be fragmented, the tx rates of MPDUs will all be DSSS
> +		 *	  rates. So it will not use CTS-to-self in this case.
> +		 *	  CTS-To-self will only be used when without
> +		 *	  fragmentation. -- 20050112 */
>  		BodyLen = (u16)pT00->T00_frame_length;	/* include 802.11 header */
>  		BodyLen += 4;	/* CRC */
>  
> @@ -90,8 +92,8 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,  struct wb35_descriptor
>  				 * CTS Rate : 24 Mega bps
>  				 * CTS frame length = 14 bytes */
>  				Duration += (DEFAULT_SIFSTIME +
> -								PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION +
> -								((112 + 22 + 95)/96)*Tsym);
> +					    PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION +
> +					    ((112 + 22 + 95)/96)*Tsym);
>  			} else {
>  				/* CTS + 1 SIFS + CTS duration
>  				 * CTS Rate : ?? Mega bps
> @@ -101,7 +103,8 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,  struct wb35_descriptor
>  				else
>  					Duration += SHORT_PREAMBLE_PLUS_PLCPHEADER_TIME;
>  
> -				Duration += (((112 + Rate-1) / Rate) + DEFAULT_SIFSTIME);
> +				Duration += (((112 + Rate-1) / Rate) +
> +					     DEFAULT_SIFSTIME);
>  			}
>  		}
>  
> @@ -127,9 +130,10 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,  struct wb35_descriptor
>  				 *  Rate : ??Mega bps
>  				 *  ACK frame length = 14 bytes, tx rate = 24M */
>  				Duration = PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION * 3;
> -				Duration += (((NextBodyLen*8 + 22 + Rate*4 - 1)/(Rate*4)) * Tsym +
> -							(((2*14)*8 + 22 + 95)/96)*Tsym +
> -							DEFAULT_SIFSTIME*3);
> +				Duration += (((NextBodyLen*8 + 22 + Rate*4 - 1)
> +					     /(Rate*4)) * Tsym +
> +					     (((2*14)*8 + 22 + 95)/96)*Tsym +
> +					    DEFAULT_SIFSTIME*3);
>  			} else {
>  				/* DSSS
>  				 *  data transmit time + 2 ACK + 3 SIFS
> @@ -141,8 +145,9 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,  struct wb35_descriptor
>  				else
>  					Duration = SHORT_PREAMBLE_PLUS_PLCPHEADER_TIME*3;
>  
> -				Duration += (((NextBodyLen + (2*14))*8 + Rate-1) / Rate +
> -							DEFAULT_SIFSTIME*3);
> +				Duration += (((NextBodyLen + (2*14))*8
> +					     + Rate-1) / Rate +
> +					    DEFAULT_SIFSTIME*3);
>  			}
>  
>  			((u16 *)buffer)[5] = cpu_to_le16(Duration); /* 4 USHOR for skip 8B USB, 2USHORT=FC + Duration */
> @@ -168,7 +173,8 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,  struct wb35_descriptor
>  			 * ACK frame length = 14 bytes */
>  			Duration = PREAMBLE_PLUS_SIGNAL_PLUS_SIGNALEXTENSION;
>  			/* The Tx rate of ACK use 24M */
> -			Duration += (((112 + 22 + 95)/96)*Tsym + DEFAULT_SIFSTIME);
> +			Duration += (((112 + 22 + 95)/96)*Tsym +
> +				    DEFAULT_SIFSTIME);
>  		} else {
>  			/* DSSS
>  			 * 1 ACK + 1 SIFS
> @@ -191,7 +197,8 @@ static void Mds_DurationSet(struct wbsoft_priv *adapter,  struct wb35_descriptor
>  }
>  
>  /* The function return the 4n size of usb pk */
> -static u16 Mds_BodyCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *pDes, u8 *TargetBuffer)
> +static u16 Mds_BodyCopy(struct wbsoft_priv *adapter,
> +			struct wb35_descriptor *pDes, u8 *TargetBuffer)
>  {
>  	struct T00_descriptor *pT00;
>  	struct wb35_mds *pMds = &adapter->Mds;
> @@ -246,7 +253,7 @@ static u16 Mds_BodyCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *pDe
>  				buf_index++;
>  				buf_index %= MAX_DESCRIPTOR_BUFFER_INDEX;
>  			} else {
> -				u8	*pctmp = pDes->buffer_address[buf_index];
> +				u8 *pctmp = pDes->buffer_address[buf_index];
>  				pctmp += CopySize;
>  				pDes->buffer_address[buf_index] = pctmp;
>  				pDes->buffer_size[buf_index] -= CopySize;
> @@ -290,7 +297,8 @@ static u16 Mds_BodyCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *pDe
>  	return Size;
>  }
>  
> -static void Mds_HeaderCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *pDes, u8 *TargetBuffer)
> +static void Mds_HeaderCopy(struct wbsoft_priv *adapter,
> +			   struct wb35_descriptor *pDes, u8 *TargetBuffer)
>  {
>  	struct wb35_mds *pMds = &adapter->Mds;
>  	u8	*src_buffer = pDes->buffer_address[0]; /* 931130.5.g */
> @@ -391,11 +399,12 @@ static void Mds_HeaderCopy(struct wbsoft_priv *adapter, struct wb35_descriptor *
>  		pDes->PreambleMode =  WLAN_PREAMBLE_TYPE_LONG;
>  	else
>  		pDes->PreambleMode =  CURRENT_PREAMBLE_MODE;
> -	pT01->T01_plcp_header_length = pDes->PreambleMode;	/* Set preamble */
> +	pT01->T01_plcp_header_length = pDes->PreambleMode; /* Set preamble */
>  
>  }
>  
> -static void MLME_GetNextPacket(struct wbsoft_priv *adapter, struct wb35_descriptor *desc)
> +static void MLME_GetNextPacket(struct wbsoft_priv *adapter,
> +			       struct wb35_descriptor *desc)
>  {
>  	desc->InternalUsed = desc->buffer_start_index + desc->buffer_number;
>  	desc->InternalUsed %= MAX_DESCRIPTOR_BUFFER_INDEX;
> @@ -423,7 +432,8 @@ static void MLMEfreeMMPDUBuffer(struct wbsoft_priv *adapter, s8 *pData)
>  	}
>  }
>  
> -static void MLME_SendComplete(struct wbsoft_priv *adapter, u8 PacketID, unsigned char SendOK)
> +static void MLME_SendComplete(struct wbsoft_priv *adapter, u8 PacketID,
> +			      unsigned char SendOK)
>  {
>      /* Reclaim the data buffer */
>  	adapter->sMlmeFrame.len = 0;
> @@ -440,9 +450,9 @@ Mds_Tx(struct wbsoft_priv *adapter)
>  	struct wb35_mds *pMds = &adapter->Mds;
>  	struct wb35_descriptor	TxDes;
>  	struct wb35_descriptor *pTxDes = &TxDes;
> -	u8		*XmitBufAddress;
> -	u16		XmitBufSize, PacketSize, stmp, CurrentSize, FragmentThreshold;
> -	u8		FillIndex, TxDesIndex, FragmentCount, FillCount;
> +	u8	*XmitBufAddress;
> +	u16	XmitBufSize, PacketSize, stmp, CurrentSize, FragmentThreshold;
> +	u8	FillIndex, TxDesIndex, FragmentCount, FillCount;
>  	unsigned char	BufferFilled = false;
>  
>  

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [PATCH 5/6] Staging: winbond: mds_f: fixed lines over 80 characters
  2013-08-05  9:58 ` [PATCH 5/6] Staging: winbond: mds_f: fixed " Iker Pedrosa
@ 2013-08-12 10:06   ` Pavel Machek
  0 siblings, 0 replies; 14+ messages in thread
From: Pavel Machek @ 2013-08-12 10:06 UTC (permalink / raw)
  To: Iker Pedrosa
  Cc: gregkh, justinmattock, mujeeb.adil, harsh1kumar, devel, linux-kernel

On Mon 2013-08-05 11:58:31, Iker Pedrosa wrote:
> Fixed some coding style issues.
> 
> Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>

ACK.

> ---
>  drivers/staging/winbond/mds_f.h | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/winbond/mds_f.h b/drivers/staging/winbond/mds_f.h
> index ce8be07..ce5a78c 100644
> --- a/drivers/staging/winbond/mds_f.h
> +++ b/drivers/staging/winbond/mds_f.h
> @@ -7,13 +7,17 @@
>  unsigned char Mds_initial(struct wbsoft_priv *adapter);
>  void Mds_Tx(struct wbsoft_priv *adapter);
>  void Mds_SendComplete(struct wbsoft_priv *adapter, struct T02_descriptor *pt02);
> -void Mds_MpduProcess(struct wbsoft_priv *adapter, struct wb35_descriptor *prxdes);
> +void Mds_MpduProcess(struct wbsoft_priv *adapter,
> +		     struct wb35_descriptor *prxdes);
>  extern void DataDmp(u8 *pdata, u32 len, u32 offset);
>  
>  /* For data frame sending */
>  u16 MDS_GetPacketSize(struct wbsoft_priv *adapter);
> -void MDS_GetNextPacket(struct wbsoft_priv *adapter, struct wb35_descriptor *pdes);
> -void MDS_GetNextPacketComplete(struct wbsoft_priv *adapter, struct wb35_descriptor *pdes);
> -void MDS_SendResult(struct wbsoft_priv *adapter, u8 packetid, unsigned char sendok);
> +void MDS_GetNextPacket(struct wbsoft_priv *adapter,
> +		       struct wb35_descriptor *pdes);
> +void MDS_GetNextPacketComplete(struct wbsoft_priv *adapter,
> +			       struct wb35_descriptor *pdes);
> +void MDS_SendResult(struct wbsoft_priv *adapter, u8 packetid,
> +		    unsigned char sendok);
>  
>  #endif

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [PATCH 6/6] Staging: winbond: mds_f: deleted extern function
  2013-08-05  9:58 ` [PATCH 6/6] Staging: winbond: mds_f: deleted extern function Iker Pedrosa
@ 2013-08-12 10:07   ` Pavel Machek
  0 siblings, 0 replies; 14+ messages in thread
From: Pavel Machek @ 2013-08-12 10:07 UTC (permalink / raw)
  To: Iker Pedrosa
  Cc: gregkh, justinmattock, mujeeb.adil, harsh1kumar, devel, linux-kernel

On Mon 2013-08-05 11:58:32, Iker Pedrosa wrote:
> Deleted an extern function that wasn't used in this driver.
> 
> Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>

ACK.

> ---
>  drivers/staging/winbond/mds_f.h | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/staging/winbond/mds_f.h b/drivers/staging/winbond/mds_f.h
> index ce5a78c..159b2eb 100644
> --- a/drivers/staging/winbond/mds_f.h
> +++ b/drivers/staging/winbond/mds_f.h
> @@ -9,7 +9,6 @@ void Mds_Tx(struct wbsoft_priv *adapter);
>  void Mds_SendComplete(struct wbsoft_priv *adapter, struct T02_descriptor *pt02);
>  void Mds_MpduProcess(struct wbsoft_priv *adapter,
>  		     struct wb35_descriptor *prxdes);
> -extern void DataDmp(u8 *pdata, u32 len, u32 offset);
>  
>  /* For data frame sending */
>  u16 MDS_GetPacketSize(struct wbsoft_priv *adapter);

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [PATCH 1/6] Staging: winbond: wb35reg: changed sleep function from msleep to usleep
  2013-08-12 10:05   ` Pavel Machek
@ 2013-08-16 11:41     ` Iker Pedrosa
  0 siblings, 0 replies; 14+ messages in thread
From: Iker Pedrosa @ 2013-08-16 11:41 UTC (permalink / raw)
  To: Pavel Machek
  Cc: gregkh, justinmattock, mujeeb.adil, harsh1kumar, devel, linux-kernel

According to Documentation/timers/timers-howto.txt it is not recommended to use msleep for 1ms - 20ms because it may sleep longer than 20ms. So, it is recommended to use usleep instead.

On Mon, 12 Aug 2013 12:05:10 +0200
Pavel Machek <pavel@ucw.cz> wrote:

> On Mon 2013-08-05 11:58:27, Iker Pedrosa wrote:
> > Changed sleep function from msleep to usleep according to the documentation.
> > 
> > Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>
> 
> Can you explain why this is good idea?
> 
> -- 
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


-- 
Regards,

Iker Pedrosa <ikerpedrosam@gmail.com>

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

end of thread, other threads:[~2013-08-16 11:41 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-05  9:58 [PATCH 0/6] Staging: winbond: Fixed some coding style issues Iker Pedrosa
2013-08-05  9:58 ` [PATCH 1/6] Staging: winbond: wb35reg: changed sleep function from msleep to usleep Iker Pedrosa
2013-08-12 10:05   ` Pavel Machek
2013-08-16 11:41     ` Iker Pedrosa
2013-08-05  9:58 ` [PATCH 2/6] Staging: winbond: wb35reg: white space deleted Iker Pedrosa
2013-08-12 10:05   ` Pavel Machek
2013-08-05  9:58 ` [PATCH 3/6] Staging: winbond: wb35reg: avoided use of extern function Iker Pedrosa
2013-08-12 10:05   ` Pavel Machek
2013-08-05  9:58 ` [PATCH 4/6] Staging: winbond: mds: fixed some lines over 80 characters Iker Pedrosa
2013-08-12 10:06   ` Pavel Machek
2013-08-05  9:58 ` [PATCH 5/6] Staging: winbond: mds_f: fixed " Iker Pedrosa
2013-08-12 10:06   ` Pavel Machek
2013-08-05  9:58 ` [PATCH 6/6] Staging: winbond: mds_f: deleted extern function Iker Pedrosa
2013-08-12 10:07   ` Pavel Machek

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