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

This is a resubmit (as a small series) of a patch I submitted on
Mon, 16 Apr 2012 with subject "[PATCH][Trivial] staging: vt6656: Remove 
some redundant casts and parentheses + other style cleanups".

Feedback from Joe Perches has been addresed in this series.

-- 
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] 6+ messages in thread

* [PATCH 1/3] staging: vt6656: Remove redundant casts from ioctl.c
  2012-04-21 20:04 [PATCH 0/3][Trivial] staging: vt6656: Remove some redundant casts and parentheses + other style cleanups Jesper Juhl
@ 2012-04-21 20:04 ` Jesper Juhl
  2012-04-21 20:04 ` [PATCH 2/3] staging: vt6656: remove redundant parentheses " Jesper Juhl
  2012-04-21 20:04 ` [PATCH 3/3] staging: vt6656: trivial whitespace cleanups to ioctl.c Jesper Juhl
  2 siblings, 0 replies; 6+ messages in thread
From: Jesper Juhl @ 2012-04-21 20:04 UTC (permalink / raw)
  To: linux-kernel, Greg Kroah-Hartman
  Cc: trivial, devel, Xi Wang, Joe Perches, Dan Carpenter, Forest Bond

Remove some unneeded explicit casts from
drivers/staging/vt6656/ioctl.c

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

diff --git a/drivers/staging/vt6656/ioctl.c b/drivers/staging/vt6656/ioctl.c
index d59456c..8a918e9 100644
--- a/drivers/staging/vt6656/ioctl.c
+++ b/drivers/staging/vt6656/ioctl.c
@@ -90,18 +90,17 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq)
 		spin_lock_irq(&pDevice->lock);
 
 		if (memcmp(pMgmt->abyCurrBSSID, &abyNullAddr[0], 6) == 0)
-			BSSvClearBSSList((void *)pDevice, FALSE);
+			BSSvClearBSSList(pDevice, FALSE);
 		else
-			BSSvClearBSSList((void *)pDevice, pDevice->bLinkPass);
+			BSSvClearBSSList(pDevice, pDevice->bLinkPass);
 
 		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_BSS_SCAN..begin\n");
 
 		if (pItemSSID->len != 0)
-			bScheduleCommand((void *)pDevice,
-					 WLAN_CMD_BSSID_SCAN,
+			bScheduleCommand(pDevice, WLAN_CMD_BSSID_SCAN,
 					 abyScanSSID);
 		else
-			bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, NULL);
+			bScheduleCommand(pDevice, WLAN_CMD_BSSID_SCAN, NULL);
 
 		spin_unlock_irq(&pDevice->lock);
 		break;
@@ -190,10 +189,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(pDevice, WLAN_CMD_BSSID_SCAN,
 				 pMgmt->abyDesireSSID);
-		bScheduleCommand((void *) pDevice, WLAN_CMD_SSID, NULL);
+		bScheduleCommand(pDevice, WLAN_CMD_SSID, NULL);
 		spin_unlock_irq(&pDevice->lock);
 		break;
 
@@ -299,7 +297,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;
@@ -534,7 +532,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq)
 
 		netif_stop_queue(pDevice->dev);
 		spin_lock_irq(&pDevice->lock);
-		bScheduleCommand((void *)pDevice, WLAN_CMD_RUN_AP, NULL);
+		bScheduleCommand(pDevice, WLAN_CMD_RUN_AP, NULL);
 		spin_unlock_irq(&pDevice->lock);
 		break;
 
@@ -565,7 +563,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] 6+ messages in thread

* [PATCH 2/3] staging: vt6656: remove redundant parentheses from ioctl.c
  2012-04-21 20:04 [PATCH 0/3][Trivial] staging: vt6656: Remove some redundant casts and parentheses + other style cleanups Jesper Juhl
  2012-04-21 20:04 ` [PATCH 1/3] staging: vt6656: Remove redundant casts from ioctl.c Jesper Juhl
@ 2012-04-21 20:04 ` Jesper Juhl
  2012-04-24 18:35   ` Greg Kroah-Hartman
  2012-04-21 20:04 ` [PATCH 3/3] staging: vt6656: trivial whitespace cleanups to ioctl.c Jesper Juhl
  2 siblings, 1 reply; 6+ messages in thread
From: Jesper Juhl @ 2012-04-21 20:04 UTC (permalink / raw)
  To: linux-kernel, Greg Kroah-Hartman
  Cc: trivial, devel, Xi Wang, Joe Perches, Dan Carpenter, Forest Bond

I seriously doubt that anyone is confused about the precedence rules
for "*" and "+" - remove redundant extra parentheses.

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

diff --git a/drivers/staging/vt6656/ioctl.c b/drivers/staging/vt6656/ioctl.c
index 8a918e9..deea69b 100644
--- a/drivers/staging/vt6656/ioctl.c
+++ b/drivers/staging/vt6656/ioctl.c
@@ -297,7 +297,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq)
 			result = -EINVAL;
 			break;
 		}
-		pList = kmalloc(sizeof(SBSSIDList) + (sList.uItem * sizeof(SBSSIDItem)), GFP_ATOMIC);
+		pList = kmalloc(sizeof(SBSSIDList) + sList.uItem * sizeof(SBSSIDItem), GFP_ATOMIC);
 		if (pList == NULL) {
 			result = -ENOMEM;
 			break;
@@ -333,7 +333,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;
 		}
@@ -563,7 +563,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq)
 			result = -ENOMEM;
 			break;
 		}
-		pNodeList = kmalloc(sizeof(SNodeList) + (sNodeList.uItem * sizeof(SNodeItem)), GFP_ATOMIC);
+		pNodeList = kmalloc(sizeof(SNodeList) + sNodeList.uItem * sizeof(SNodeItem), GFP_ATOMIC);
 		if (pNodeList == NULL) {
 			result = -ENOMEM;
 			break;
@@ -598,7 +598,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq)
 					break;
 			}
 		}
-		if (copy_to_user(pReq->data, pNodeList, sizeof(SNodeList) + (sNodeList.uItem * sizeof(SNodeItem)))) {
+		if (copy_to_user(pReq->data, pNodeList, sizeof(SNodeList) + sNodeList.uItem * sizeof(SNodeItem))) {
 			kfree(pNodeList);
 			result = -EFAULT;
 			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] 6+ messages in thread

* [PATCH 3/3] staging: vt6656: trivial whitespace cleanups to ioctl.c
  2012-04-21 20:04 [PATCH 0/3][Trivial] staging: vt6656: Remove some redundant casts and parentheses + other style cleanups Jesper Juhl
  2012-04-21 20:04 ` [PATCH 1/3] staging: vt6656: Remove redundant casts from ioctl.c Jesper Juhl
  2012-04-21 20:04 ` [PATCH 2/3] staging: vt6656: remove redundant parentheses " Jesper Juhl
@ 2012-04-21 20:04 ` Jesper Juhl
  2 siblings, 0 replies; 6+ messages in thread
From: Jesper Juhl @ 2012-04-21 20:04 UTC (permalink / raw)
  To: linux-kernel, Greg Kroah-Hartman
  Cc: trivial, devel, Xi Wang, Joe Perches, Dan Carpenter, Forest Bond

This removes a space between a cast and the variable and makes the
case statements in the switch stylewise consistent as to whether
there's a blank line before each 'case' or not.

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

diff --git a/drivers/staging/vt6656/ioctl.c b/drivers/staging/vt6656/ioctl.c
index deea69b..4f29778 100644
--- a/drivers/staging/vt6656/ioctl.c
+++ b/drivers/staging/vt6656/ioctl.c
@@ -149,6 +149,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;
@@ -311,7 +312,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;
@@ -354,6 +355,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 */
-- 
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] 6+ messages in thread

* Re: [PATCH 2/3] staging: vt6656: remove redundant parentheses from ioctl.c
  2012-04-21 20:04 ` [PATCH 2/3] staging: vt6656: remove redundant parentheses " Jesper Juhl
@ 2012-04-24 18:35   ` Greg Kroah-Hartman
  2012-04-26  9:01     ` Jesper Juhl
  0 siblings, 1 reply; 6+ messages in thread
From: Greg Kroah-Hartman @ 2012-04-24 18:35 UTC (permalink / raw)
  To: Jesper Juhl
  Cc: linux-kernel, devel, trivial, Xi Wang, Joe Perches,
	Dan Carpenter, Forest Bond

On Sat, Apr 21, 2012 at 10:04:37PM +0200, Jesper Juhl wrote:
> I seriously doubt that anyone is confused about the precedence rules
> for "*" and "+" - remove redundant extra parentheses.

You never really know, and as such, I'd prefer to just leave this as-is.

thanks,

greg k-h

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

* Re: [PATCH 2/3] staging: vt6656: remove redundant parentheses from ioctl.c
  2012-04-24 18:35   ` Greg Kroah-Hartman
@ 2012-04-26  9:01     ` Jesper Juhl
  0 siblings, 0 replies; 6+ messages in thread
From: Jesper Juhl @ 2012-04-26  9:01 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, devel, trivial, Xi Wang, Joe Perches,
	Dan Carpenter, Forest Bond

On Tue, 24 Apr 2012, Greg Kroah-Hartman wrote:

> On Sat, Apr 21, 2012 at 10:04:37PM +0200, Jesper Juhl wrote:
> > I seriously doubt that anyone is confused about the precedence rules
> > for "*" and "+" - remove redundant extra parentheses.
> 
> You never really know, and as such, I'd prefer to just leave this as-is.
> 
Fair enough :)

-- 
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] 6+ messages in thread

end of thread, other threads:[~2012-04-26  9:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-21 20:04 [PATCH 0/3][Trivial] staging: vt6656: Remove some redundant casts and parentheses + other style cleanups Jesper Juhl
2012-04-21 20:04 ` [PATCH 1/3] staging: vt6656: Remove redundant casts from ioctl.c Jesper Juhl
2012-04-21 20:04 ` [PATCH 2/3] staging: vt6656: remove redundant parentheses " Jesper Juhl
2012-04-24 18:35   ` Greg Kroah-Hartman
2012-04-26  9:01     ` Jesper Juhl
2012-04-21 20:04 ` [PATCH 3/3] staging: vt6656: trivial whitespace cleanups to ioctl.c Jesper Juhl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.