public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] zram: include err.h in zram_drv
@ 2014-03-20 21:02 Sergey Senozhatsky
  2014-03-20 21:44 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Sergey Senozhatsky @ 2014-03-20 21:02 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Minchan Kim, Nitin Gupta, Arnd Bergmann, Jerome Marchand,
	linux-kernel, Sergey Senozhatsky

zcomp returns error-valued pointer, also include err.h header
in zram_drv.

Per Arnd Bergmann:
The zram driver uses the ERR_PTR macro defined in <linux/err.h>
and relies on this header to be included implicitly through
other headers, which is not (always) the case on the ARM architecture.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
 drivers/block/zram/zram_drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 8b13014..9849b52 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -31,6 +31,7 @@
 #include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/vmalloc.h>
+#include <linux/err.h>
 
 #include "zram_drv.h"
 
-- 
1.9.1.623.gfb8a990


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

* Re: [PATCH] zram: include err.h in zram_drv
  2014-03-20 21:02 [PATCH] zram: include err.h in zram_drv Sergey Senozhatsky
@ 2014-03-20 21:44 ` Andrew Morton
  2014-03-21  6:55   ` Sergey Senozhatsky
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2014-03-20 21:44 UTC (permalink / raw)
  To: Sergey Senozhatsky
  Cc: Minchan Kim, Nitin Gupta, Arnd Bergmann, Jerome Marchand,
	linux-kernel

On Fri, 21 Mar 2014 00:02:03 +0300 Sergey Senozhatsky <sergey.senozhatsky@gmail.com> wrote:

> zcomp returns error-valued pointer, also include err.h header
> in zram_drv.
> 
> Per Arnd Bergmann:
> The zram driver uses the ERR_PTR macro defined in <linux/err.h>
> and relies on this header to be included implicitly through
> other headers, which is not (always) the case on the ARM architecture.
> 
> ...
>
> --- a/drivers/block/zram/zram_drv.c
> +++ b/drivers/block/zram/zram_drv.c
> @@ -31,6 +31,7 @@
>  #include <linux/slab.h>
>  #include <linux/string.h>
>  #include <linux/vmalloc.h>
> +#include <linux/err.h>
>  
>  #include "zram_drv.h"

I can find no occurrence of ERR_PTR in any version of
drivers/block/zram/zram_drv.c which I can find.

zram-return-error-valued-pointer-from-zcomp_create.patch adds IS_ERR to
drivers/block/zram/zram_drv.c which is presumably what you meant.  

zram-return-error-valued-pointer-from-zcomp_create.patch also adds
ERR_PTR() calls into drivers/block/zram/zcomp.c so that file should
include err.h also.


Here's what I added, as
zram-return-error-valued-pointer-from-zcomp_create-fix-2.patch

From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: zram: include err.h

[akpm@linux-foundation.org: fix zcomp.h as well]
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/block/zram/zcomp.c    |    1 +
 drivers/block/zram/zram_drv.c |    1 +
 2 files changed, 2 insertions(+)

diff -puN drivers/block/zram/zram_drv.c~zram-include-errh-in-zram_drv drivers/block/zram/zram_drv.c
--- a/drivers/block/zram/zram_drv.c~zram-include-errh-in-zram_drv
+++ a/drivers/block/zram/zram_drv.c
@@ -31,6 +31,7 @@
 #include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/vmalloc.h>
+#include <linux/err.h>
 
 #include "zram_drv.h"
 
diff -puN drivers/block/zram/zcomp.c~zram-include-errh-in-zram_drv drivers/block/zram/zcomp.c
--- a/drivers/block/zram/zcomp.c~zram-include-errh-in-zram_drv
+++ a/drivers/block/zram/zcomp.c
@@ -9,6 +9,7 @@
 
 #include <linux/kernel.h>
 #include <linux/string.h>
+#include <linux/err.h>
 #include <linux/slab.h>
 #include <linux/wait.h>
 #include <linux/sched.h>
_


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

* Re: [PATCH] zram: include err.h in zram_drv
  2014-03-20 21:44 ` Andrew Morton
@ 2014-03-21  6:55   ` Sergey Senozhatsky
  0 siblings, 0 replies; 3+ messages in thread
From: Sergey Senozhatsky @ 2014-03-21  6:55 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Sergey Senozhatsky, Minchan Kim, Nitin Gupta, Arnd Bergmann,
	Jerome Marchand, linux-kernel

On (03/20/14 14:44), Andrew Morton wrote:
> > zcomp returns error-valued pointer, also include err.h header
> > in zram_drv.
> > 
> > Per Arnd Bergmann:
> > The zram driver uses the ERR_PTR macro defined in <linux/err.h>
> > and relies on this header to be included implicitly through
> > other headers, which is not (always) the case on the ARM architecture.
> > 
> > ...
> >
> > --- a/drivers/block/zram/zram_drv.c
> > +++ b/drivers/block/zram/zram_drv.c
> > @@ -31,6 +31,7 @@
> >  #include <linux/slab.h>
> >  #include <linux/string.h>
> >  #include <linux/vmalloc.h>
> > +#include <linux/err.h>
> >  
> >  #include "zram_drv.h"
> 
> I can find no occurrence of ERR_PTR in any version of
> drivers/block/zram/zram_drv.c which I can find.
> 
> zram-return-error-valued-pointer-from-zcomp_create.patch adds IS_ERR to
> drivers/block/zram/zram_drv.c which is presumably what you meant.  
> 

yes. sorry for inconvenience.

> zram-return-error-valued-pointer-from-zcomp_create.patch also adds
> ERR_PTR() calls into drivers/block/zram/zcomp.c so that file should
> include err.h also.
> 

missing direct include of err.h in zcomp.h was reported and fixed by
Arnd Bergmann
https://lkml.org/lkml/2014/3/15/39


	-ss

> 
> Here's what I added, as
> zram-return-error-valued-pointer-from-zcomp_create-fix-2.patch
> 
> From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> Subject: zram: include err.h
> 
> [akpm@linux-foundation.org: fix zcomp.h as well]
> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
> 
>  drivers/block/zram/zcomp.c    |    1 +
>  drivers/block/zram/zram_drv.c |    1 +
>  2 files changed, 2 insertions(+)
> 
> diff -puN drivers/block/zram/zram_drv.c~zram-include-errh-in-zram_drv drivers/block/zram/zram_drv.c
> --- a/drivers/block/zram/zram_drv.c~zram-include-errh-in-zram_drv
> +++ a/drivers/block/zram/zram_drv.c
> @@ -31,6 +31,7 @@
>  #include <linux/slab.h>
>  #include <linux/string.h>
>  #include <linux/vmalloc.h>
> +#include <linux/err.h>
>  
>  #include "zram_drv.h"
>  
> diff -puN drivers/block/zram/zcomp.c~zram-include-errh-in-zram_drv drivers/block/zram/zcomp.c
> --- a/drivers/block/zram/zcomp.c~zram-include-errh-in-zram_drv
> +++ a/drivers/block/zram/zcomp.c
> @@ -9,6 +9,7 @@
>  
>  #include <linux/kernel.h>
>  #include <linux/string.h>
> +#include <linux/err.h>
>  #include <linux/slab.h>
>  #include <linux/wait.h>
>  #include <linux/sched.h>
> _
> 

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

end of thread, other threads:[~2014-03-21  6:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-20 21:02 [PATCH] zram: include err.h in zram_drv Sergey Senozhatsky
2014-03-20 21:44 ` Andrew Morton
2014-03-21  6:55   ` Sergey Senozhatsky

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