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

* Re: [PATCH v3] Staging: vt6655: iwctl.c: fix a sparse warning
  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
  2 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2014-04-08 11:19 UTC (permalink / raw)
  To: Jimmy Li
  Cc: 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, devel, linux-kernel

On Tue, Apr 08, 2014 at 07:09:27PM +0800, Jimmy Li wrote:
> 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(-)

Please try applying your patch.  Save the email as raw text including
headers and everything.  `cat raw_email.txt | git am`.  Then review the
log with `git log`.  You'll see that the format is still messed up.  :(

The part which should be discarded is saved and the part which should be
saved is deleted.

regards,
dan carpenter


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

* Re: [PATCH v4] Staging: vt6655: iwctl.c: fix a sparse warning
  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 ` Joe Perches
  2014-04-08 14:26 ` [PATCH v5] " Dan Carpenter
  2 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2014-04-08 12:45 UTC (permalink / raw)
  To: Jimmy Li
  Cc: Dan Carpenter, Greg Kroah-Hartman, Teodora Baluta,
	Peter P Waskiewicz Jr, Michael Gunselmann, Lisa Nguyen,
	Martin Hofmann, Malcolm Priestley, =?utf-8?B?VMO8bGluIMSwemVy?=,
	Archana kumari, devel, linux-kernel

On Tue, 2014-04-08 at 20:36 +0800, Jimmy Li wrote:
> fix a sparse warning and do some clean up.
> 
> Signed-off-by: Jimmy Li <coder.liss@gmail.com>

The --- line should go here

> 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.
> v4 fix patch format again.
> 
> ---

not here

As is, the versioning information would end up
in the changlog and that isn't the desired style.

> diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c
[]
> @@ -1835,19 +1835,14 @@ int iwctl_siwencodeext(struct net_device *dev,
[]
> +	param = kzalloc(sizeof(struct viawget_wpa_param), GFP_KERNEL);

Also, param is a struct viawget_wpa_param * so
this should use:

	param = kzalloc(sizeof(*param), GFP_KERNEL);



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

* Re: [PATCH v5] Staging: vt6655: iwctl.c: fix a sparse warning
  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 ` Dan Carpenter
  2 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2014-04-08 14:26 UTC (permalink / raw)
  To: Jimmy Li
  Cc: Greg Kroah-Hartman, Teodora Baluta, Joe Perches,
	Peter P Waskiewicz Jr, Michael Gunselmann, Lisa Nguyen,
	Martin Hofmann, Malcolm Priestley,
	=?us-ascii?B?PT91cy1hc2NpaT9RPz0zRD0zRnV0Zi04PTNGQj0zRlZNTzhiR2x1SU1T?= =?us-ascii?B?d2VtVnk9M0Y9M0Q/PQ==?=,
	Archana kumari, devel, linux-kernel

On Tue, Apr 08, 2014 at 09:35:02PM +0800, Jimmy Li wrote:
> fix a sparse warning and do some clean up.
> iwctl.c:1846:35: expected restricted gfp_t [usertype] flags
> 
> Signed-off-by: Jimmy Li <coder.liss@gmail.com>
> ---

Looks good.

regards,
dan carpenter


^ permalink raw reply	[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