Skip to contentSkip to conversation

drivers/staging/vt6655/iwctl.c fix a sparse warning

PATCH Superseded Jimmy Li 2 participants 2 messages Apr 3, 2014 Staging

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Jimmy Li

author
#0 lore raw

PATCH v2 1/1 drivers/staging/vt6655/iwctl.c fix a sparse warning

---
v2: additional cleanups as well.

 drivers/staging/vt6655/iwctl.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/staging/vt6655/iwctl.c +2 -7
index ac3fc16..394031b 100644
@@ -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) {
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 1 line · Jimmy Li

You dropped the commit message which said which sparse warnings were fixed. It should say something about the other cleanups as well. Also the subject prefix isn't right. Use:

[PATCH v3] Staging: vt6655: iwctl.c: fix a sparse warning

Or something. "drivers/" doesn't add any information.

regards,
dan carpenter