All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: vt6655: Fix sparse-indicated type mismatch to kmalloc
@ 2014-03-21  0:42 Conrad Meyer
  2014-03-25 20:30 ` [WIP] [PATCH 0/3] remove wrong cast of gfp_t flags silvio
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Conrad Meyer @ 2014-03-21  0:42 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Forest Bond, devel, linux-kernel, Conrad Meyer

Signed-off-by: Conrad Meyer <cse.cem@gmail.com>
---
Patch is against next-20140320. Fixes a minor sparse warning in the staging
driver vt6655. p->length is u16; implicit cast to size_t is fine. No reason to
cast GFP_KERNEL...
---
 drivers/staging/vt6655/wpactl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vt6655/wpactl.c b/drivers/staging/vt6655/wpactl.c
index d17224f..c27ed5d 100644
--- a/drivers/staging/vt6655/wpactl.c
+++ b/drivers/staging/vt6655/wpactl.c
@@ -855,11 +855,11 @@ int wpa_ioctl(PSDevice pDevice, struct iw_point *p)
 
 	if (p->length < sizeof(struct viawget_wpa_param) ||
 	    p->length > VIAWGET_WPA_MAX_BUF_SIZE || !p->pointer)
 		return -EINVAL;
 
-	param = kmalloc((int)p->length, (int)GFP_KERNEL);
+	param = kmalloc(p->length, GFP_KERNEL);
 	if (param == NULL)
 		return -ENOMEM;
 
 	if (copy_from_user(param, p->pointer, p->length)) {
 		ret = -EFAULT;
-- 
1.8.5.3


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

* [WIP] [PATCH 0/3] remove wrong cast of gfp_t flags
  2014-03-21  0:42 [PATCH] Staging: vt6655: Fix sparse-indicated type mismatch to kmalloc Conrad Meyer
@ 2014-03-25 20:30 ` silvio
  2014-03-25 20:30 ` [PATCH 1/3] staging: vt6655: removed incorrect casting in wpactl.c silvio
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 15+ messages in thread
From: silvio @ 2014-03-25 20:30 UTC (permalink / raw)
  To: linux-kernel; +Cc: silvio, Silvio F, devel

From: Silvio F <silvio.fricke@gmail.com>

Hi,

I have seen this patch, but in this and two other files we have the same wrong
casting.

This three little patches remove wrong cast for gfp_t-flags in kamlloc,
kzalloc, ...

Please review this patch.

These patches are WIP because I have no hardware and can only do a compile
test.

Cheers,
	Silvio

Silvio F (3):
  staging: vt6655: removed incorrect casting in wpactl.c
  staging: vt6655: removed incorrect casting in ioctl.c
  staging: vt6655: removed incorrect casting in iwctl.c

 drivers/staging/vt6655/ioctl.c  | 6 ++++--
 drivers/staging/vt6655/iwctl.c  | 2 +-
 drivers/staging/vt6655/wpactl.c | 6 +++---
 3 files changed, 8 insertions(+), 6 deletions(-)

-- 
1.9.0


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

* [PATCH 1/3] staging: vt6655: removed incorrect casting in wpactl.c
  2014-03-21  0:42 [PATCH] Staging: vt6655: Fix sparse-indicated type mismatch to kmalloc Conrad Meyer
  2014-03-25 20:30 ` [WIP] [PATCH 0/3] remove wrong cast of gfp_t flags silvio
@ 2014-03-25 20:30 ` silvio
  2014-04-03  9:43   ` Dan Carpenter
  2014-03-25 20:30 ` [PATCH 2/3] staging: vt6655: removed incorrect casting in ioctl.c silvio
  2014-03-25 20:30 ` [PATCH 3/3] staging: vt6655: removed incorrect casting in iwctl.c silvio
  3 siblings, 1 reply; 15+ messages in thread
From: silvio @ 2014-03-25 20:30 UTC (permalink / raw)
  To: linux-kernel; +Cc: silvio, Silvio F, devel

From: Silvio F <silvio.fricke@gmail.com>

This patch fixes the following type of sparse warnings:

drivers/staging/vt6655/wpactl.c:596:47: warning: cast from restricted gfp_t
drivers/staging/vt6655/wpactl.c:638:68: warning: cast from restricted gfp_t
drivers/staging/vt6655/wpactl.c:860:42: warning: cast from restricted gfp_t

Signed-off-by: Silvio F <silvio.fricke@gmail.com>
---
 drivers/staging/vt6655/wpactl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vt6655/wpactl.c b/drivers/staging/vt6655/wpactl.c
index d17224f..4745429 100644
--- a/drivers/staging/vt6655/wpactl.c
+++ b/drivers/staging/vt6655/wpactl.c
@@ -593,7 +593,7 @@ static int wpa_get_scan(PSDevice pDevice,
 
 	unsigned char *ptempBSS;
 
-	ptempBSS = kmalloc(sizeof(KnownBSS), (int)GFP_ATOMIC);
+	ptempBSS = kmalloc(sizeof(KnownBSS), GFP_ATOMIC);
 
 	if (ptempBSS == NULL) {
 		printk(KERN_ERR "bubble sort kmalloc memory fail@@@\n");
@@ -635,7 +635,7 @@ static int wpa_get_scan(PSDevice pDevice,
 		count++;
 	}
 
-	pBuf = kcalloc(count, sizeof(struct viawget_scan_result), (int)GFP_ATOMIC);
+	pBuf = kcalloc(count, sizeof(struct viawget_scan_result), GFP_ATOMIC);
 
 	if (pBuf == NULL) {
 		ret = -ENOMEM;
@@ -857,7 +857,7 @@ int wpa_ioctl(PSDevice pDevice, struct iw_point *p)
 	    p->length > VIAWGET_WPA_MAX_BUF_SIZE || !p->pointer)
 		return -EINVAL;
 
-	param = kmalloc((int)p->length, (int)GFP_KERNEL);
+	param = kmalloc((int)p->length, GFP_KERNEL);
 	if (param == NULL)
 		return -ENOMEM;
 
-- 
1.9.0


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

* [PATCH 2/3] staging: vt6655: removed incorrect casting in ioctl.c
  2014-03-21  0:42 [PATCH] Staging: vt6655: Fix sparse-indicated type mismatch to kmalloc Conrad Meyer
  2014-03-25 20:30 ` [WIP] [PATCH 0/3] remove wrong cast of gfp_t flags silvio
  2014-03-25 20:30 ` [PATCH 1/3] staging: vt6655: removed incorrect casting in wpactl.c silvio
@ 2014-03-25 20:30 ` silvio
  2014-03-25 20:30 ` [PATCH 3/3] staging: vt6655: removed incorrect casting in iwctl.c silvio
  3 siblings, 0 replies; 15+ messages in thread
From: silvio @ 2014-03-25 20:30 UTC (permalink / raw)
  To: linux-kernel; +Cc: silvio, Silvio F, devel

From: Silvio F <silvio.fricke@gmail.com>

This patch fixes the following type of sparse warnings:

drivers/staging/vt6655/ioctl.c:308:104: warning: cast from restricted gfp_t
drivers/staging/vt6655/ioctl.c:579:109: warning: cast from restricted gfp_t

Signed-off-by: Silvio F <silvio.fricke@gmail.com>
---
 drivers/staging/vt6655/ioctl.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vt6655/ioctl.c b/drivers/staging/vt6655/ioctl.c
index b5cd2e4..1de5d2c9 100644
--- a/drivers/staging/vt6655/ioctl.c
+++ b/drivers/staging/vt6655/ioctl.c
@@ -305,7 +305,8 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq)
 			result = -EINVAL;
 			break;
 		}
-		pList = (PSBSSIDList)kmalloc(sizeof(SBSSIDList) + (sList.uItem * sizeof(SBSSIDItem)), (int)GFP_ATOMIC);
+		pList = (PSBSSIDList)kmalloc(sizeof(SBSSIDList) + (sList.uItem * sizeof(SBSSIDItem)),
+					     GFP_ATOMIC);
 		if (pList == NULL) {
 			result = -ENOMEM;
 			break;
@@ -576,7 +577,8 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq)
 			result = -EINVAL;
 			break;
 		}
-		pNodeList = (PSNodeList)kmalloc(sizeof(SNodeList) + (sNodeList.uItem * sizeof(SNodeItem)), (int)GFP_ATOMIC);
+		pNodeList = (PSNodeList)kmalloc(sizeof(SNodeList) + (sNodeList.uItem * sizeof(SNodeItem)),
+						GFP_ATOMIC);
 		if (pNodeList == NULL) {
 			result = -ENOMEM;
 			break;
-- 
1.9.0


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

* [PATCH 3/3] staging: vt6655: removed incorrect casting in iwctl.c
  2014-03-21  0:42 [PATCH] Staging: vt6655: Fix sparse-indicated type mismatch to kmalloc Conrad Meyer
                   ` (2 preceding siblings ...)
  2014-03-25 20:30 ` [PATCH 2/3] staging: vt6655: removed incorrect casting in ioctl.c silvio
@ 2014-03-25 20:30 ` silvio
  3 siblings, 0 replies; 15+ messages in thread
From: silvio @ 2014-03-25 20:30 UTC (permalink / raw)
  To: linux-kernel; +Cc: silvio, Silvio F, devel

From: Silvio F <silvio.fricke@gmail.com>

This patch fixes the following type of sparse warning:

drivers/staging/vt6655/iwctl.c:1846:35: warning: cast from restricted gfp_t

Signed-off-by: Silvio F <silvio.fricke@gmail.com>
---
 drivers/staging/vt6655/iwctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c
index ac3fc16..5e25535 100644
--- a/drivers/staging/vt6655/iwctl.c
+++ b/drivers/staging/vt6655/iwctl.c
@@ -1843,7 +1843,7 @@ int iwctl_siwencodeext(struct net_device *dev,
 	PRINT_K("SIOCSIWENCODEEXT...... \n");
 
 	blen = sizeof(*param);
-	buf = kmalloc((int)blen, (int)GFP_KERNEL);
+	buf = kmalloc((int)blen, GFP_KERNEL);
 	if (buf == NULL)
 		return -ENOMEM;
 	memset(buf, 0, blen);
-- 
1.9.0


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

* Re: [PATCH 1/3] staging: vt6655: removed incorrect casting in wpactl.c
  2014-03-25 20:30 ` [PATCH 1/3] staging: vt6655: removed incorrect casting in wpactl.c silvio
@ 2014-04-03  9:43   ` Dan Carpenter
  2014-04-04 22:32     ` [WIP] [PATCH v2 0/3] remove wrong cast of gfp_t flags Silvio Fricke
                       ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Dan Carpenter @ 2014-04-03  9:43 UTC (permalink / raw)
  To: silvio; +Cc: linux-kernel, devel, Silvio F

On Tue, Mar 25, 2014 at 09:30:18PM +0100, silvio@port1024.net wrote:
> From: Silvio F <silvio.fricke@gmail.com>

Don't use this header for your own patches.

> 
> This patch fixes the following type of sparse warnings:
> 
> drivers/staging/vt6655/wpactl.c:596:47: warning: cast from restricted gfp_t
> drivers/staging/vt6655/wpactl.c:638:68: warning: cast from restricted gfp_t
> drivers/staging/vt6655/wpactl.c:860:42: warning: cast from restricted gfp_t
> 
> Signed-off-by: Silvio F <silvio.fricke@gmail.com>

We can't verify this is you if you don't send from the same email you
sign off by.  We can't really verify perfectly anyway, of course, but
at least we try do the minimum.

regards,
dan carpenter


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

* [WIP] [PATCH v2 0/3] remove wrong cast of gfp_t flags
  2014-04-03  9:43   ` Dan Carpenter
@ 2014-04-04 22:32     ` Silvio Fricke
  2014-04-10 20:16       ` Greg KH
  2014-04-04 22:32     ` [WIP] [PATCH v2 1/3] staging: vt6655: removed incorrect casting in wpactl.c Silvio Fricke
                       ` (2 subsequent siblings)
  3 siblings, 1 reply; 15+ messages in thread
From: Silvio Fricke @ 2014-04-04 22:32 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Silvio Fricke, linux-kernel, devel

Hi Dan,

thanks for your review.
Attached second version of this series.

Cheers,
	Silvio


Silvio Fricke (3):
  staging: vt6655: removed incorrect casting in wpactl.c
  staging: vt6655: removed incorrect casting in ioctl.c
  staging: vt6655: removed incorrect casting in iwctl.c

 drivers/staging/vt6655/ioctl.c  | 6 ++++--
 drivers/staging/vt6655/iwctl.c  | 2 +-
 drivers/staging/vt6655/wpactl.c | 6 +++---
 3 files changed, 8 insertions(+), 6 deletions(-)

-- 
1.9.0


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

* [WIP] [PATCH v2 1/3] staging: vt6655: removed incorrect casting in wpactl.c
  2014-04-03  9:43   ` Dan Carpenter
  2014-04-04 22:32     ` [WIP] [PATCH v2 0/3] remove wrong cast of gfp_t flags Silvio Fricke
@ 2014-04-04 22:32     ` Silvio Fricke
  2014-04-04 22:32     ` [WIP] [PATCH v2 2/3] staging: vt6655: removed incorrect casting in ioctl.c Silvio Fricke
  2014-04-04 22:32     ` [WIP] [PATCH v2 3/3] staging: vt6655: removed incorrect casting in iwctl.c Silvio Fricke
  3 siblings, 0 replies; 15+ messages in thread
From: Silvio Fricke @ 2014-04-04 22:32 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Silvio Fricke, linux-kernel, devel

This patch fixes the following type of sparse warnings:

drivers/staging/vt6655/wpactl.c:596:47: warning: cast from restricted gfp_t
drivers/staging/vt6655/wpactl.c:638:68: warning: cast from restricted gfp_t
drivers/staging/vt6655/wpactl.c:860:42: warning: cast from restricted gfp_t

Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
---
 drivers/staging/vt6655/wpactl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vt6655/wpactl.c b/drivers/staging/vt6655/wpactl.c
index d17224f..4745429 100644
--- a/drivers/staging/vt6655/wpactl.c
+++ b/drivers/staging/vt6655/wpactl.c
@@ -593,7 +593,7 @@ static int wpa_get_scan(PSDevice pDevice,
 
 	unsigned char *ptempBSS;
 
-	ptempBSS = kmalloc(sizeof(KnownBSS), (int)GFP_ATOMIC);
+	ptempBSS = kmalloc(sizeof(KnownBSS), GFP_ATOMIC);
 
 	if (ptempBSS == NULL) {
 		printk(KERN_ERR "bubble sort kmalloc memory fail@@@\n");
@@ -635,7 +635,7 @@ static int wpa_get_scan(PSDevice pDevice,
 		count++;
 	}
 
-	pBuf = kcalloc(count, sizeof(struct viawget_scan_result), (int)GFP_ATOMIC);
+	pBuf = kcalloc(count, sizeof(struct viawget_scan_result), GFP_ATOMIC);
 
 	if (pBuf == NULL) {
 		ret = -ENOMEM;
@@ -857,7 +857,7 @@ int wpa_ioctl(PSDevice pDevice, struct iw_point *p)
 	    p->length > VIAWGET_WPA_MAX_BUF_SIZE || !p->pointer)
 		return -EINVAL;
 
-	param = kmalloc((int)p->length, (int)GFP_KERNEL);
+	param = kmalloc((int)p->length, GFP_KERNEL);
 	if (param == NULL)
 		return -ENOMEM;
 
-- 
1.9.0


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

* [WIP] [PATCH v2 2/3] staging: vt6655: removed incorrect casting in ioctl.c
  2014-04-03  9:43   ` Dan Carpenter
  2014-04-04 22:32     ` [WIP] [PATCH v2 0/3] remove wrong cast of gfp_t flags Silvio Fricke
  2014-04-04 22:32     ` [WIP] [PATCH v2 1/3] staging: vt6655: removed incorrect casting in wpactl.c Silvio Fricke
@ 2014-04-04 22:32     ` Silvio Fricke
  2014-04-04 22:32     ` [WIP] [PATCH v2 3/3] staging: vt6655: removed incorrect casting in iwctl.c Silvio Fricke
  3 siblings, 0 replies; 15+ messages in thread
From: Silvio Fricke @ 2014-04-04 22:32 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Silvio Fricke, linux-kernel, devel

This patch fixes the following type of sparse warnings:

drivers/staging/vt6655/ioctl.c:308:104: warning: cast from restricted gfp_t
drivers/staging/vt6655/ioctl.c:579:109: warning: cast from restricted gfp_t

Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
---
 drivers/staging/vt6655/ioctl.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vt6655/ioctl.c b/drivers/staging/vt6655/ioctl.c
index b5cd2e4..1de5d2c9 100644
--- a/drivers/staging/vt6655/ioctl.c
+++ b/drivers/staging/vt6655/ioctl.c
@@ -305,7 +305,8 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq)
 			result = -EINVAL;
 			break;
 		}
-		pList = (PSBSSIDList)kmalloc(sizeof(SBSSIDList) + (sList.uItem * sizeof(SBSSIDItem)), (int)GFP_ATOMIC);
+		pList = (PSBSSIDList)kmalloc(sizeof(SBSSIDList) + (sList.uItem * sizeof(SBSSIDItem)),
+					     GFP_ATOMIC);
 		if (pList == NULL) {
 			result = -ENOMEM;
 			break;
@@ -576,7 +577,8 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq)
 			result = -EINVAL;
 			break;
 		}
-		pNodeList = (PSNodeList)kmalloc(sizeof(SNodeList) + (sNodeList.uItem * sizeof(SNodeItem)), (int)GFP_ATOMIC);
+		pNodeList = (PSNodeList)kmalloc(sizeof(SNodeList) + (sNodeList.uItem * sizeof(SNodeItem)),
+						GFP_ATOMIC);
 		if (pNodeList == NULL) {
 			result = -ENOMEM;
 			break;
-- 
1.9.0


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

* [WIP] [PATCH v2 3/3] staging: vt6655: removed incorrect casting in iwctl.c
  2014-04-03  9:43   ` Dan Carpenter
                       ` (2 preceding siblings ...)
  2014-04-04 22:32     ` [WIP] [PATCH v2 2/3] staging: vt6655: removed incorrect casting in ioctl.c Silvio Fricke
@ 2014-04-04 22:32     ` Silvio Fricke
  3 siblings, 0 replies; 15+ messages in thread
From: Silvio Fricke @ 2014-04-04 22:32 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Silvio Fricke, linux-kernel, devel

This patch fixes the following type of sparse warning:

drivers/staging/vt6655/iwctl.c:1846:35: warning: cast from restricted gfp_t

Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
---
 drivers/staging/vt6655/iwctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c
index ac3fc16..5e25535 100644
--- a/drivers/staging/vt6655/iwctl.c
+++ b/drivers/staging/vt6655/iwctl.c
@@ -1843,7 +1843,7 @@ int iwctl_siwencodeext(struct net_device *dev,
 	PRINT_K("SIOCSIWENCODEEXT...... \n");
 
 	blen = sizeof(*param);
-	buf = kmalloc((int)blen, (int)GFP_KERNEL);
+	buf = kmalloc((int)blen, GFP_KERNEL);
 	if (buf == NULL)
 		return -ENOMEM;
 	memset(buf, 0, blen);
-- 
1.9.0


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

* Re: [WIP] [PATCH v2 0/3] remove wrong cast of gfp_t flags
  2014-04-04 22:32     ` [WIP] [PATCH v2 0/3] remove wrong cast of gfp_t flags Silvio Fricke
@ 2014-04-10 20:16       ` Greg KH
  2014-04-12  0:30         ` [PATCH v3 " Silvio Fricke
                           ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Greg KH @ 2014-04-10 20:16 UTC (permalink / raw)
  To: Silvio Fricke; +Cc: Dan Carpenter, devel, linux-kernel

On Sat, Apr 05, 2014 at 12:32:07AM +0200, Silvio Fricke wrote:
> Hi Dan,
> 
> thanks for your review.
> Attached second version of this series.

I don't understand what the [WIP] marking is.  Please just resend these
as "real" patches if you feel they are ready to be merged.  If we have
issues with them, we will be sure to let you know :)

thanks,

greg k-h

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

* [PATCH v3 0/3] remove wrong cast of gfp_t flags
  2014-04-10 20:16       ` Greg KH
@ 2014-04-12  0:30         ` Silvio Fricke
  2014-04-12  0:30         ` [PATCH v3 1/3] staging: vt6655: removed incorrect casting in wpactl.c Silvio Fricke
                           ` (2 subsequent siblings)
  3 siblings, 0 replies; 15+ messages in thread
From: Silvio Fricke @ 2014-04-12  0:30 UTC (permalink / raw)
  To: Greg KH; +Cc: Silvio Fricke, Dan Carpenter, linux-kernel, devel

Hi,

> > thanks for your review.
> > Attached second version of this series.
> 
> I don't understand what the [WIP] marking is.  Please just resend these
> as "real" patches if you feel they are ready to be merged.  If we have
> issues with them, we will be sure to let you know :)

I removed it. 


Bye,
Silvio


v3: * no 'WIP'! Don't do that!

v2: * signed-off and message are not the same address



Silvio Fricke (3):
  staging: vt6655: removed incorrect casting in wpactl.c
  staging: vt6655: removed incorrect casting in ioctl.c
  staging: vt6655: removed incorrect casting in iwctl.c

 drivers/staging/vt6655/ioctl.c  | 6 ++++--
 drivers/staging/vt6655/iwctl.c  | 2 +-
 drivers/staging/vt6655/wpactl.c | 6 +++---
 3 files changed, 8 insertions(+), 6 deletions(-)

-- 
1.9.2


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

* [PATCH v3 1/3] staging: vt6655: removed incorrect casting in wpactl.c
  2014-04-10 20:16       ` Greg KH
  2014-04-12  0:30         ` [PATCH v3 " Silvio Fricke
@ 2014-04-12  0:30         ` Silvio Fricke
  2014-04-12  0:30         ` [PATCH v3 2/3] staging: vt6655: removed incorrect casting in ioctl.c Silvio Fricke
  2014-04-12  0:30         ` [PATCH v3 3/3] staging: vt6655: removed incorrect casting in iwctl.c Silvio Fricke
  3 siblings, 0 replies; 15+ messages in thread
From: Silvio Fricke @ 2014-04-12  0:30 UTC (permalink / raw)
  To: Greg KH; +Cc: Silvio Fricke, Dan Carpenter, linux-kernel, devel

This patch fixes the following type of sparse warnings:

drivers/staging/vt6655/wpactl.c:596:47: warning: cast from restricted gfp_t
drivers/staging/vt6655/wpactl.c:638:68: warning: cast from restricted gfp_t
drivers/staging/vt6655/wpactl.c:860:42: warning: cast from restricted gfp_t

Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
---
 drivers/staging/vt6655/wpactl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vt6655/wpactl.c b/drivers/staging/vt6655/wpactl.c
index d17224f..4745429 100644
--- a/drivers/staging/vt6655/wpactl.c
+++ b/drivers/staging/vt6655/wpactl.c
@@ -593,7 +593,7 @@ static int wpa_get_scan(PSDevice pDevice,
 
 	unsigned char *ptempBSS;
 
-	ptempBSS = kmalloc(sizeof(KnownBSS), (int)GFP_ATOMIC);
+	ptempBSS = kmalloc(sizeof(KnownBSS), GFP_ATOMIC);
 
 	if (ptempBSS == NULL) {
 		printk(KERN_ERR "bubble sort kmalloc memory fail@@@\n");
@@ -635,7 +635,7 @@ static int wpa_get_scan(PSDevice pDevice,
 		count++;
 	}
 
-	pBuf = kcalloc(count, sizeof(struct viawget_scan_result), (int)GFP_ATOMIC);
+	pBuf = kcalloc(count, sizeof(struct viawget_scan_result), GFP_ATOMIC);
 
 	if (pBuf == NULL) {
 		ret = -ENOMEM;
@@ -857,7 +857,7 @@ int wpa_ioctl(PSDevice pDevice, struct iw_point *p)
 	    p->length > VIAWGET_WPA_MAX_BUF_SIZE || !p->pointer)
 		return -EINVAL;
 
-	param = kmalloc((int)p->length, (int)GFP_KERNEL);
+	param = kmalloc((int)p->length, GFP_KERNEL);
 	if (param == NULL)
 		return -ENOMEM;
 
-- 
1.9.2


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

* [PATCH v3 2/3] staging: vt6655: removed incorrect casting in ioctl.c
  2014-04-10 20:16       ` Greg KH
  2014-04-12  0:30         ` [PATCH v3 " Silvio Fricke
  2014-04-12  0:30         ` [PATCH v3 1/3] staging: vt6655: removed incorrect casting in wpactl.c Silvio Fricke
@ 2014-04-12  0:30         ` Silvio Fricke
  2014-04-12  0:30         ` [PATCH v3 3/3] staging: vt6655: removed incorrect casting in iwctl.c Silvio Fricke
  3 siblings, 0 replies; 15+ messages in thread
From: Silvio Fricke @ 2014-04-12  0:30 UTC (permalink / raw)
  To: Greg KH; +Cc: Silvio Fricke, Dan Carpenter, linux-kernel, devel

This patch fixes the following type of sparse warnings:

drivers/staging/vt6655/ioctl.c:308:104: warning: cast from restricted gfp_t
drivers/staging/vt6655/ioctl.c:579:109: warning: cast from restricted gfp_t

Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
---
 drivers/staging/vt6655/ioctl.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vt6655/ioctl.c b/drivers/staging/vt6655/ioctl.c
index b5cd2e4..1de5d2c9 100644
--- a/drivers/staging/vt6655/ioctl.c
+++ b/drivers/staging/vt6655/ioctl.c
@@ -305,7 +305,8 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq)
 			result = -EINVAL;
 			break;
 		}
-		pList = (PSBSSIDList)kmalloc(sizeof(SBSSIDList) + (sList.uItem * sizeof(SBSSIDItem)), (int)GFP_ATOMIC);
+		pList = (PSBSSIDList)kmalloc(sizeof(SBSSIDList) + (sList.uItem * sizeof(SBSSIDItem)),
+					     GFP_ATOMIC);
 		if (pList == NULL) {
 			result = -ENOMEM;
 			break;
@@ -576,7 +577,8 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq)
 			result = -EINVAL;
 			break;
 		}
-		pNodeList = (PSNodeList)kmalloc(sizeof(SNodeList) + (sNodeList.uItem * sizeof(SNodeItem)), (int)GFP_ATOMIC);
+		pNodeList = (PSNodeList)kmalloc(sizeof(SNodeList) + (sNodeList.uItem * sizeof(SNodeItem)),
+						GFP_ATOMIC);
 		if (pNodeList == NULL) {
 			result = -ENOMEM;
 			break;
-- 
1.9.2


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

* [PATCH v3 3/3] staging: vt6655: removed incorrect casting in iwctl.c
  2014-04-10 20:16       ` Greg KH
                           ` (2 preceding siblings ...)
  2014-04-12  0:30         ` [PATCH v3 2/3] staging: vt6655: removed incorrect casting in ioctl.c Silvio Fricke
@ 2014-04-12  0:30         ` Silvio Fricke
  3 siblings, 0 replies; 15+ messages in thread
From: Silvio Fricke @ 2014-04-12  0:30 UTC (permalink / raw)
  To: Greg KH; +Cc: Silvio Fricke, Dan Carpenter, linux-kernel, devel

This patch fixes the following type of sparse warning:

drivers/staging/vt6655/iwctl.c:1846:35: warning: cast from restricted gfp_t

Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
---
 drivers/staging/vt6655/iwctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c
index ac3fc16..5e25535 100644
--- a/drivers/staging/vt6655/iwctl.c
+++ b/drivers/staging/vt6655/iwctl.c
@@ -1843,7 +1843,7 @@ int iwctl_siwencodeext(struct net_device *dev,
 	PRINT_K("SIOCSIWENCODEEXT...... \n");
 
 	blen = sizeof(*param);
-	buf = kmalloc((int)blen, (int)GFP_KERNEL);
+	buf = kmalloc((int)blen, GFP_KERNEL);
 	if (buf == NULL)
 		return -ENOMEM;
 	memset(buf, 0, blen);
-- 
1.9.2


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

end of thread, other threads:[~2014-04-12  0:31 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-21  0:42 [PATCH] Staging: vt6655: Fix sparse-indicated type mismatch to kmalloc Conrad Meyer
2014-03-25 20:30 ` [WIP] [PATCH 0/3] remove wrong cast of gfp_t flags silvio
2014-03-25 20:30 ` [PATCH 1/3] staging: vt6655: removed incorrect casting in wpactl.c silvio
2014-04-03  9:43   ` Dan Carpenter
2014-04-04 22:32     ` [WIP] [PATCH v2 0/3] remove wrong cast of gfp_t flags Silvio Fricke
2014-04-10 20:16       ` Greg KH
2014-04-12  0:30         ` [PATCH v3 " Silvio Fricke
2014-04-12  0:30         ` [PATCH v3 1/3] staging: vt6655: removed incorrect casting in wpactl.c Silvio Fricke
2014-04-12  0:30         ` [PATCH v3 2/3] staging: vt6655: removed incorrect casting in ioctl.c Silvio Fricke
2014-04-12  0:30         ` [PATCH v3 3/3] staging: vt6655: removed incorrect casting in iwctl.c Silvio Fricke
2014-04-04 22:32     ` [WIP] [PATCH v2 1/3] staging: vt6655: removed incorrect casting in wpactl.c Silvio Fricke
2014-04-04 22:32     ` [WIP] [PATCH v2 2/3] staging: vt6655: removed incorrect casting in ioctl.c Silvio Fricke
2014-04-04 22:32     ` [WIP] [PATCH v2 3/3] staging: vt6655: removed incorrect casting in iwctl.c Silvio Fricke
2014-03-25 20:30 ` [PATCH 2/3] staging: vt6655: removed incorrect casting in ioctl.c silvio
2014-03-25 20:30 ` [PATCH 3/3] staging: vt6655: removed incorrect casting in iwctl.c silvio

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.