public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] Staging: vt6655: iwctl.c: fix a sparse warning
@ 2014-04-08 11:09 Jimmy Li
  2014-04-08 11:19 ` Dan Carpenter
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jimmy Li @ 2014-04-08 11:09 UTC (permalink / raw)
  To: Dan Carpenter, Greg Kroah-Hartman, Teodora Baluta, Joe Perches,
	Peter P Waskiewicz Jr, Michael Gunselmann, Lisa Nguyen,
	Martin Hofmann, Malcolm Priestley,
	=?us-ascii?Q?=3D=3Futf-8=3FB=3FVMO8bGluIMSwemVy=3F=3D?=,
	Archana kumari
  Cc: devel, linux-kernel

thanks for correcting my patch format.

Signed-off-by: Jimmy Li <coder.liss@gmail.com>
---
v1 fix a sparse warning.
	(iwctl.c:1846:35: expected restricted gfp_t [usertype] flags)
v2 clear up two unnecessary variable, buf and blen.
v3 fix patch format.
 drivers/staging/vt6655/iwctl.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c
index ac3fc16..394031b 100644
--- a/drivers/staging/vt6655/iwctl.c
+++ b/drivers/staging/vt6655/iwctl.c
@@ -1835,19 +1835,14 @@ int iwctl_siwencodeext(struct net_device *dev,
 	size_t seq_len = 0, key_len = 0;
 //
 	// int ii;
-	u8 *buf;
-	size_t blen;
 	u8 key_array[64];
 	int ret = 0;
 
 	PRINT_K("SIOCSIWENCODEEXT...... \n");
 
-	blen = sizeof(*param);
-	buf = kmalloc((int)blen, (int)GFP_KERNEL);
-	if (buf == NULL)
+	param = kzalloc(sizeof(struct viawget_wpa_param), GFP_KERNEL);
+	if (param == NULL)
 		return -ENOMEM;
-	memset(buf, 0, blen);
-	param = (struct viawget_wpa_param *)buf;
 
 //recover alg_name
 	switch (ext->alg) {
-- 
1.7.9.5


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

end of thread, other threads:[~2014-04-08 14:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-08 11:09 [PATCH v3] Staging: vt6655: iwctl.c: fix a sparse warning Jimmy Li
2014-04-08 11:19 ` Dan Carpenter
2014-04-08 12:45 ` [PATCH v4] " Joe Perches
2014-04-08 14:26 ` [PATCH v5] " Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox