linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Staging: vt6655: apply kernel coding style to wCommandTimerWait function
@ 2014-07-18 18:35 Igor Bezukh
  2014-07-18 23:15 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Igor Bezukh @ 2014-07-18 18:35 UTC (permalink / raw)
  To: gregkh; +Cc: devel, forest, linux-kernel, igbzkh

Since there is a lot of stuff that need to be changed in order to meet the kernel
coding style in wcmd.c file, I've decided to fix function-per-patch.
The following changes were made in vCommandTimerWait function:

- Camel case change:
   - MSecond ---> msec
   - hDdeviceContext ---> private
   - pDevice ---> priv
- Removed redundant return
- Removed redndant comment

In future patches, I will also change the function name itself.

Signed-off-by: Igor Bezukh <igbzkh@gmail.com>
---
 drivers/staging/vt6655/wcmd.c |   20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/vt6655/wcmd.c b/drivers/staging/vt6655/wcmd.c
index a689645..e5073d9 100644
--- a/drivers/staging/vt6655/wcmd.c
+++ b/drivers/staging/vt6655/wcmd.c
@@ -281,21 +281,15 @@ s_MgrMakeProbeRequest(
 	return pTxPacket;
 }
 
-void
-vCommandTimerWait(
-	void *hDeviceContext,
-	unsigned int MSecond
-)
+void vCommandTimerWait(void *private, unsigned int msec)
 {
-	PSDevice        pDevice = (PSDevice)hDeviceContext;
+	PSDevice priv = (PSDevice)private;
 
-	init_timer(&pDevice->sTimerCommand);
-	pDevice->sTimerCommand.data = (unsigned long) pDevice;
-	pDevice->sTimerCommand.function = (TimerFunction)vCommandTimer;
-	// RUN_AT :1 msec ~= (HZ/1024)
-	pDevice->sTimerCommand.expires = (unsigned int)RUN_AT((MSecond * HZ) >> 10);
-	add_timer(&pDevice->sTimerCommand);
-	return;
+	init_timer(&priv->sTimerCommand);
+	priv->sTimerCommand.data = (unsigned long)priv;
+	priv->sTimerCommand.function = (TimerFunction)vCommandTimer;
+	priv->sTimerCommand.expires = (unsigned int)RUN_AT((msec * HZ) >> 10);
+	add_timer(&priv->sTimerCommand);
 }
 
 void
-- 
1.7.9.5


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

* Re: [PATCH] Staging: vt6655: apply kernel coding style to wCommandTimerWait function
  2014-07-18 18:35 [PATCH] Staging: vt6655: apply kernel coding style to wCommandTimerWait function Igor Bezukh
@ 2014-07-18 23:15 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2014-07-18 23:15 UTC (permalink / raw)
  To: Igor Bezukh; +Cc: devel, forest, linux-kernel

On Fri, Jul 18, 2014 at 09:35:13PM +0300, Igor Bezukh wrote:
> Since there is a lot of stuff that need to be changed in order to meet the kernel
> coding style in wcmd.c file, I've decided to fix function-per-patch.
> The following changes were made in vCommandTimerWait function:
> 
> - Camel case change:
>    - MSecond ---> msec
>    - hDdeviceContext ---> private
>    - pDevice ---> priv
> - Removed redundant return
> - Removed redndant comment
> 
> In future patches, I will also change the function name itself.

A better way to do this, that is easier to review, is to do, on a
per-file basis, one thing, like "remove redundant return", or "remove
unneeded comments".

Having to review all of these changes at once, even for something as
"small" as a single function, is much harder than making sure you only
do one thing, and do it all at once.

So, can you break it up in this way instead?

thanks,

greg k-h

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

end of thread, other threads:[~2014-07-18 23:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-18 18:35 [PATCH] Staging: vt6655: apply kernel coding style to wCommandTimerWait function Igor Bezukh
2014-07-18 23:15 ` Greg KH

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).