linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][Trivial] staging: vt6656: Remove some redundant casts and parentheses + other style cleanups
@ 2012-04-16 21:20 Jesper Juhl
  2012-04-17 20:23 ` Joe Perches
  0 siblings, 1 reply; 3+ messages in thread
From: Jesper Juhl @ 2012-04-16 21:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: trivial, devel, Xi Wang, Joe Perches, Dan Carpenter,
	Greg Kroah-Hartman, Forest Bond

This is just a small/trivial cleanup patch. It makes the following
changes to drivers/staging/vt6656/ioctl.c:

1. Remove some redundant casts.

2. Remove some redundant parantheses.

3. Remove some whitespace between casts and variables.

4. Use a consistent style for whether or not switch statements have a
   empty line between break; and the next case:.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
 drivers/staging/vt6656/ioctl.c |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/vt6656/ioctl.c b/drivers/staging/vt6656/ioctl.c
index d59456c..8295335 100644
--- a/drivers/staging/vt6656/ioctl.c
+++ b/drivers/staging/vt6656/ioctl.c
@@ -101,7 +101,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq)
 					 WLAN_CMD_BSSID_SCAN,
 					 abyScanSSID);
 		else
-			bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, NULL);
+			bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, NULL);
 
 		spin_unlock_irq(&pDevice->lock);
 		break;
@@ -150,6 +150,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq)
 			}
 		}
 		break;
+
 	case WLAN_CMD_BSS_JOIN:
 		if (copy_from_user(&sJoinCmd, pReq->data, sizeof(SCmdBSSJoin))) {
 			result = -EFAULT;
@@ -190,10 +191,9 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq)
 		netif_stop_queue(pDevice->dev);
 		spin_lock_irq(&pDevice->lock);
 		pMgmt->eCurrState = WMAC_STATE_IDLE;
-		bScheduleCommand((void *) pDevice,
-				 WLAN_CMD_BSSID_SCAN,
+		bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN,
 				 pMgmt->abyDesireSSID);
-		bScheduleCommand((void *) pDevice, WLAN_CMD_SSID, NULL);
+		bScheduleCommand((void *)pDevice, WLAN_CMD_SSID, NULL);
 		spin_unlock_irq(&pDevice->lock);
 		break;
 
@@ -299,7 +299,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq)
 			result = -EINVAL;
 			break;
 		}
-		pList = (PSBSSIDList)kmalloc(sizeof(SBSSIDList) + (sList.uItem * sizeof(SBSSIDItem)), (int)GFP_ATOMIC);
+		pList = kmalloc(sizeof(SBSSIDList) + sList.uItem * sizeof(SBSSIDItem), GFP_ATOMIC);
 		if (pList == NULL) {
 			result = -ENOMEM;
 			break;
@@ -313,7 +313,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq)
 				pList->sBSSIDList[ii].wBeaconInterval = pBSS->wBeaconInterval;
 				pList->sBSSIDList[ii].wCapInfo = pBSS->wCapInfo;
 				RFvRSSITodBm(pDevice, (BYTE)(pBSS->uRSSI), &ldBm);
-				pList->sBSSIDList[ii].uRSSI = (unsigned int) ldBm;
+				pList->sBSSIDList[ii].uRSSI = (unsigned int)ldBm;
 				/* pList->sBSSIDList[ii].uRSSI = pBSS->uRSSI; */
 				memcpy(pList->sBSSIDList[ii].abyBSSID, pBSS->abyBSSID, WLAN_BSSID_LEN);
 				pItemSSID = (PWLAN_IE_SSID)pBSS->abySSID;
@@ -335,7 +335,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq)
 			}
 		}
 
-		if (copy_to_user(pReq->data, pList, sizeof(SBSSIDList) + (sList.uItem * sizeof(SBSSIDItem)))) {
+		if (copy_to_user(pReq->data, pList, sizeof(SBSSIDList) + sList.uItem * sizeof(SBSSIDItem))) {
 			result = -EFAULT;
 			break;
 		}
@@ -356,6 +356,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq)
 			break;
 		}
 		break;
+
 	case WLAN_CMD_STOP_MAC:
 		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_STOP_MAC\n");
 		/* Todo xxxxxx */
@@ -565,7 +566,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq)
 			result = -ENOMEM;
 			break;
 		}
-		pNodeList = kmalloc(sizeof(SNodeList) + (sNodeList.uItem * sizeof(SNodeItem)), (int)GFP_ATOMIC);
+		pNodeList = kmalloc(sizeof(SNodeList) + sNodeList.uItem * sizeof(SNodeItem), GFP_ATOMIC);
 		if (pNodeList == NULL) {
 			result = -ENOMEM;
 			break;
-- 
1.7.10

-- 
Jesper Juhl <jj@chaosbits.net>       http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.


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

* Re: [PATCH][Trivial] staging: vt6656: Remove some redundant casts and parentheses + other style cleanups
  2012-04-16 21:20 [PATCH][Trivial] staging: vt6656: Remove some redundant casts and parentheses + other style cleanups Jesper Juhl
@ 2012-04-17 20:23 ` Joe Perches
  2012-04-18 22:21   ` Jesper Juhl
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2012-04-17 20:23 UTC (permalink / raw)
  To: Jesper Juhl
  Cc: linux-kernel, trivial, devel, Xi Wang, Dan Carpenter,
	Greg Kroah-Hartman, Forest Bond

On Mon, 2012-04-16 at 23:20 +0200, Jesper Juhl wrote:
> This is just a small/trivial cleanup patch. It makes the following
> changes to drivers/staging/vt6656/ioctl.c:
> 
> 1. Remove some redundant casts.

drivers/staging/vt6656/wcmd.h:BOOL bScheduleCommand(void *hDeviceContext,

so you could remove the casts of the first argument too.

> diff --git a/drivers/staging/vt6656/ioctl.c b/drivers/staging/vt6656/ioctl.c
[]
> @@ -101,7 +101,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq)
>  					 WLAN_CMD_BSSID_SCAN,
>  					 abyScanSSID);
>  		else
> -			bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, NULL);
> +			bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, NULL);

			bScheduleCommand(pDevice, WLAN_CMD_BSSID_SCAN, NULL);
[]
> @@ -190,10 +191,9 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq)
>  		netif_stop_queue(pDevice->dev);
>  		spin_lock_irq(&pDevice->lock);
>  		pMgmt->eCurrState = WMAC_STATE_IDLE;
> -		bScheduleCommand((void *) pDevice,
> -				 WLAN_CMD_BSSID_SCAN,
> +		bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN,
>  				 pMgmt->abyDesireSSID);
		bScheduleCommand(pDevice, WLAN_CMD_BSSID_SCAN,
				 pMgmt->abyDesireSSID);
etc



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

* Re: [PATCH][Trivial] staging: vt6656: Remove some redundant casts and parentheses + other style cleanups
  2012-04-17 20:23 ` Joe Perches
@ 2012-04-18 22:21   ` Jesper Juhl
  0 siblings, 0 replies; 3+ messages in thread
From: Jesper Juhl @ 2012-04-18 22:21 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-kernel, trivial, devel, Xi Wang, Dan Carpenter,
	Greg Kroah-Hartman, Forest Bond

On Tue, 17 Apr 2012, Joe Perches wrote:

> On Mon, 2012-04-16 at 23:20 +0200, Jesper Juhl wrote:
> > This is just a small/trivial cleanup patch. It makes the following
> > changes to drivers/staging/vt6656/ioctl.c:
> > 
> > 1. Remove some redundant casts.
> 
> drivers/staging/vt6656/wcmd.h:BOOL bScheduleCommand(void *hDeviceContext,
> 
> so you could remove the casts of the first argument too.
> 
Thank you for the review Joe. 
I'll get an updated patch together some time tomorrow.


-- 
Jesper Juhl <jj@chaosbits.net>       http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.


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

end of thread, other threads:[~2012-04-18 22:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-16 21:20 [PATCH][Trivial] staging: vt6656: Remove some redundant casts and parentheses + other style cleanups Jesper Juhl
2012-04-17 20:23 ` Joe Perches
2012-04-18 22:21   ` Jesper Juhl

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