All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Fix k.alloc switched arguments
@ 2010-10-31 22:33 ` Joe Perches
  0 siblings, 0 replies; 10+ messages in thread
From: Joe Perches @ 2010-10-31 22:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: David Airlie, Anil Ravindranath, James E.J. Bottomley,
	Greg Kroah-Hartman, Andy Whitcroft, dri-devel, linux-scsi, devel

Joe Perches (4):
  drivers/gpu/drm/vmwgfx: Fix k.alloc switched arguments
  drivers/scsi/pmcraid.c: Fix k.alloc switched arguments
  drivers/staging/udlfb/udlfb.c: Fix k.alloc switched arguments
  scripts/checkpatch.pl: Add check for k.alloc GFP as first argument

 drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c     |    2 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c |    2 +-
 drivers/scsi/pmcraid.c                  |    4 ++--
 drivers/staging/udlfb/udlfb.c           |    2 +-
 scripts/checkpatch.pl                   |    5 +++++
 5 files changed, 10 insertions(+), 5 deletions(-)

-- 
1.7.3.1.g432b3.dirty


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

* [PATCH 0/4] Fix k.alloc switched arguments
@ 2010-10-31 22:33 ` Joe Perches
  0 siblings, 0 replies; 10+ messages in thread
From: Joe Perches @ 2010-10-31 22:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: devel, Anil Ravindranath, linux-scsi, David Airlie,
	Greg Kroah-Hartman, dri-devel, James E.J. Bottomley,
	Andy Whitcroft

Joe Perches (4):
  drivers/gpu/drm/vmwgfx: Fix k.alloc switched arguments
  drivers/scsi/pmcraid.c: Fix k.alloc switched arguments
  drivers/staging/udlfb/udlfb.c: Fix k.alloc switched arguments
  scripts/checkpatch.pl: Add check for k.alloc GFP as first argument

 drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c     |    2 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c |    2 +-
 drivers/scsi/pmcraid.c                  |    4 ++--
 drivers/staging/udlfb/udlfb.c           |    2 +-
 scripts/checkpatch.pl                   |    5 +++++
 5 files changed, 10 insertions(+), 5 deletions(-)

-- 
1.7.3.1.g432b3.dirty

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

* [PATCH 1/4] drivers/gpu/drm/vmwgfx: Fix k.alloc switched arguments
  2010-10-31 22:33 ` Joe Perches
  (?)
@ 2010-10-31 22:33 ` Joe Perches
  2010-10-31 23:52   ` Matt Turner
  -1 siblings, 1 reply; 10+ messages in thread
From: Joe Perches @ 2010-10-31 22:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: David Airlie, dri-devel

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c     |    2 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
index a01c47d..29113c9 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
@@ -557,7 +557,7 @@ int vmw_kms_init_legacy_display_system(struct vmw_private *dev_priv)
 		return -EINVAL;
 	}
 
-	dev_priv->ldu_priv = kmalloc(GFP_KERNEL, sizeof(*dev_priv->ldu_priv));
+	dev_priv->ldu_priv = kmalloc(sizeof(*dev_priv->ldu_priv), GFP_KERNEL);
 
 	if (!dev_priv->ldu_priv)
 		return -ENOMEM;
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c b/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c
index df2036e..f1a52f9 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c
@@ -585,7 +585,7 @@ int vmw_overlay_init(struct vmw_private *dev_priv)
 		return -ENOSYS;
 	}
 
-	overlay = kmalloc(GFP_KERNEL, sizeof(*overlay));
+	overlay = kmalloc(sizeof(*overlay), GFP_KERNEL);
 	if (!overlay)
 		return -ENOMEM;
 
-- 
1.7.3.1.g432b3.dirty


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

* [PATCH 2/4] drivers/scsi/pmcraid.c: Fix k.alloc switched arguments
  2010-10-31 22:33 ` Joe Perches
  (?)
  (?)
@ 2010-10-31 22:33 ` Joe Perches
  -1 siblings, 0 replies; 10+ messages in thread
From: Joe Perches @ 2010-10-31 22:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: Anil Ravindranath, James E.J. Bottomley, linux-scsi

And a typo fix of faile to failed.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/scsi/pmcraid.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index 4b87657..e5a694a 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -4094,10 +4094,10 @@ static long pmcraid_chr_ioctl(
 	struct pmcraid_ioctl_header *hdr = NULL;
 	int retval = -ENOTTY;
 
-	hdr = kmalloc(GFP_KERNEL, sizeof(struct pmcraid_ioctl_header));
+	hdr = kmalloc(sizeof(struct pmcraid_ioctl_header), GFP_KERNEL);
 
 	if (!hdr) {
-		pmcraid_err("faile to allocate memory for ioctl header\n");
+		pmcraid_err("failed to allocate memory for ioctl header\n");
 		return -ENOMEM;
 	}
 
-- 
1.7.3.1.g432b3.dirty


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

* [PATCH 3/4] drivers/staging/udlfb/udlfb.c: Fix k.alloc switched arguments
  2010-10-31 22:33 ` Joe Perches
                   ` (2 preceding siblings ...)
  (?)
@ 2010-10-31 22:33 ` Joe Perches
  -1 siblings, 0 replies; 10+ messages in thread
From: Joe Perches @ 2010-10-31 22:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, devel

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/staging/udlfb/udlfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/udlfb/udlfb.c b/drivers/staging/udlfb/udlfb.c
index 5969e84..fed2510 100644
--- a/drivers/staging/udlfb/udlfb.c
+++ b/drivers/staging/udlfb/udlfb.c
@@ -887,7 +887,7 @@ static int dlfb_ops_open(struct fb_info *info, int user)
 
 		struct fb_deferred_io *fbdefio;
 
-		fbdefio = kmalloc(GFP_KERNEL, sizeof(struct fb_deferred_io));
+		fbdefio = kmalloc(sizeof(struct fb_deferred_io), GFP_KERNEL);
 
 		if (fbdefio) {
 			fbdefio->delay = DL_DEFIO_WRITE_DELAY;
-- 
1.7.3.1.g432b3.dirty


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

* [PATCH 4/4] scripts/checkpatch.pl: Add check for k.alloc GFP as first argument
  2010-10-31 22:33 ` Joe Perches
                   ` (3 preceding siblings ...)
  (?)
@ 2010-10-31 22:33 ` Joe Perches
  2010-11-01 21:57   ` Jesper Juhl
  -1 siblings, 1 reply; 10+ messages in thread
From: Joe Perches @ 2010-10-31 22:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andy Whitcroft

Signed-off-by: Joe Perches <joe@perches.com>
---
 scripts/checkpatch.pl |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 90b54d4..114f667 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2789,6 +2789,11 @@ sub process {
 			WARN("unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr);
 		}
 
+# check for k.alloc GFP in wrong location
+		if ($line =~ /\bk[czm]alloc\s*\(\s*\(?\s*GFP_/) {
+			ERROR("alloc has GFP_<level> as last argument\n" . $herecurr);
+		}
+
 # check for gcc specific __FUNCTION__
 		if ($line =~ /__FUNCTION__/) {
 			WARN("__func__ should be used instead of gcc specific __FUNCTION__\n"  . $herecurr);
-- 
1.7.3.1.g432b3.dirty


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

* Re: [PATCH 1/4] drivers/gpu/drm/vmwgfx: Fix k.alloc switched arguments
  2010-10-31 22:33 ` [PATCH 1/4] drivers/gpu/drm/vmwgfx: " Joe Perches
@ 2010-10-31 23:52   ` Matt Turner
  2010-11-01 22:00     ` Thomas Hellstrom
  0 siblings, 1 reply; 10+ messages in thread
From: Matt Turner @ 2010-10-31 23:52 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-kernel, dri-devel

On Sun, Oct 31, 2010 at 6:33 PM, Joe Perches <joe@perches.com> wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c     |    2 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
> index a01c47d..29113c9 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
> @@ -557,7 +557,7 @@ int vmw_kms_init_legacy_display_system(struct vmw_private *dev_priv)
>                return -EINVAL;
>        }
>
> -       dev_priv->ldu_priv = kmalloc(GFP_KERNEL, sizeof(*dev_priv->ldu_priv));
> +       dev_priv->ldu_priv = kmalloc(sizeof(*dev_priv->ldu_priv), GFP_KERNEL);
>
>        if (!dev_priv->ldu_priv)
>                return -ENOMEM;
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c b/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c
> index df2036e..f1a52f9 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c
> @@ -585,7 +585,7 @@ int vmw_overlay_init(struct vmw_private *dev_priv)
>                return -ENOSYS;
>        }
>
> -       overlay = kmalloc(GFP_KERNEL, sizeof(*overlay));
> +       overlay = kmalloc(sizeof(*overlay), GFP_KERNEL);
>        if (!overlay)
>                return -ENOMEM;
>
> --
> 1.7.3.1.g432b3.dirty

Oh! That's a bad one.

Reviewed-by: Matt Turner <mattst88@gmail.com>

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

* Re: [PATCH 4/4] scripts/checkpatch.pl: Add check for k.alloc GFP as first argument
  2010-10-31 22:33 ` [PATCH 4/4] scripts/checkpatch.pl: Add check for k.alloc GFP as first argument Joe Perches
@ 2010-11-01 21:57   ` Jesper Juhl
  0 siblings, 0 replies; 10+ messages in thread
From: Jesper Juhl @ 2010-11-01 21:57 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-kernel, Andy Whitcroft

On Sun, 31 Oct 2010, Joe Perches wrote:

> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  scripts/checkpatch.pl |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 90b54d4..114f667 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2789,6 +2789,11 @@ sub process {
>  			WARN("unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr);
>  		}
>  
> +# check for k.alloc GFP in wrong location
> +		if ($line =~ /\bk[czm]alloc\s*\(\s*\(?\s*GFP_/) {

Just off the top of my head, but shouldn't this check for \s*_*GFP_ in 
order to catch things like __GFP_ZERO as well?
And what about functions like kmalloc_node()/vmalloc_node() which may also 
have this problem?

> +			ERROR("alloc has GFP_<level> as last argument\n" . $herecurr);
> +		}
> +
>  # check for gcc specific __FUNCTION__
>  		if ($line =~ /__FUNCTION__/) {
>  			WARN("__func__ should be used instead of gcc specific __FUNCTION__\n"  . $herecurr);
> 

-- 
Jesper Juhl <jj@chaosbits.net>             http://www.chaosbits.net/
Plain text mails only, please      http://www.expita.com/nomime.html
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html


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

* Re: [PATCH 1/4] drivers/gpu/drm/vmwgfx: Fix k.alloc switched arguments
  2010-10-31 23:52   ` Matt Turner
@ 2010-11-01 22:00     ` Thomas Hellstrom
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Hellstrom @ 2010-11-01 22:00 UTC (permalink / raw)
  To: Matt Turner; +Cc: Joe Perches, linux-kernel, dri-devel

On 11/01/2010 12:52 AM, Matt Turner wrote:
> On Sun, Oct 31, 2010 at 6:33 PM, Joe Perches<joe@perches.com>  wrote:
>    
>> Signed-off-by: Joe Perches<joe@perches.com>
>> ---
>>   drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c     |    2 +-
>>   drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c |    2 +-
>>   2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
>> index a01c47d..29113c9 100644
>> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
>> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
>> @@ -557,7 +557,7 @@ int vmw_kms_init_legacy_display_system(struct vmw_private *dev_priv)
>>                 return -EINVAL;
>>         }
>>
>> -       dev_priv->ldu_priv = kmalloc(GFP_KERNEL, sizeof(*dev_priv->ldu_priv));
>> +       dev_priv->ldu_priv = kmalloc(sizeof(*dev_priv->ldu_priv), GFP_KERNEL);
>>
>>         if (!dev_priv->ldu_priv)
>>                 return -ENOMEM;
>> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c b/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c
>> index df2036e..f1a52f9 100644
>> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c
>> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c
>> @@ -585,7 +585,7 @@ int vmw_overlay_init(struct vmw_private *dev_priv)
>>                 return -ENOSYS;
>>         }
>>
>> -       overlay = kmalloc(GFP_KERNEL, sizeof(*overlay));
>> +       overlay = kmalloc(sizeof(*overlay), GFP_KERNEL);
>>         if (!overlay)
>>                 return -ENOMEM;
>>
>> --
>> 1.7.3.1.g432b3.dirty
>>      
> Oh! That's a bad one.
>    
Indeed.

> Reviewed-by: Matt Turner<mattst88@gmail.com>
>    
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>

> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>    


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

* [RESEND PATCH 2/4] drivers/scsi/pmcraid.c: Fix k.alloc switched arguments
  2010-10-31 22:33 ` Joe Perches
                   ` (4 preceding siblings ...)
  (?)
@ 2010-11-02 22:47 ` Joe Perches
  -1 siblings, 0 replies; 10+ messages in thread
From: Joe Perches @ 2010-11-02 22:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: Anil Ravindranath, James E.J. Bottomley, linux-scsi

And a typo fix of faile to failed.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/scsi/pmcraid.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index 4b87657..e5a694a 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -4094,10 +4094,10 @@ static long pmcraid_chr_ioctl(
 	struct pmcraid_ioctl_header *hdr = NULL;
 	int retval = -ENOTTY;
 
-	hdr = kmalloc(GFP_KERNEL, sizeof(struct pmcraid_ioctl_header));
+	hdr = kmalloc(sizeof(struct pmcraid_ioctl_header), GFP_KERNEL);
 
 	if (!hdr) {
-		pmcraid_err("faile to allocate memory for ioctl header\n");
+		pmcraid_err("failed to allocate memory for ioctl header\n");
 		return -ENOMEM;
 	}
 
-- 
1.7.3.1.g432b3.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



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

end of thread, other threads:[~2010-11-02 22:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-31 22:33 [PATCH 0/4] Fix k.alloc switched arguments Joe Perches
2010-10-31 22:33 ` Joe Perches
2010-10-31 22:33 ` [PATCH 1/4] drivers/gpu/drm/vmwgfx: " Joe Perches
2010-10-31 23:52   ` Matt Turner
2010-11-01 22:00     ` Thomas Hellstrom
2010-10-31 22:33 ` [PATCH 2/4] drivers/scsi/pmcraid.c: " Joe Perches
2010-10-31 22:33 ` [PATCH 3/4] drivers/staging/udlfb/udlfb.c: " Joe Perches
2010-10-31 22:33 ` [PATCH 4/4] scripts/checkpatch.pl: Add check for k.alloc GFP as first argument Joe Perches
2010-11-01 21:57   ` Jesper Juhl
2010-11-02 22:47 ` [RESEND PATCH 2/4] drivers/scsi/pmcraid.c: Fix k.alloc switched arguments Joe Perches

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.