linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix blkdev.h build errors when BLOCK=n
@ 2012-04-30  8:18 Russell King - ARM Linux
  2012-05-12 19:54 ` Russell King - ARM Linux
  2012-05-14  6:30 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Russell King - ARM Linux @ 2012-04-30  8:18 UTC (permalink / raw)
  To: linux-kernel, Andrew Morton, Jens Axboe

I see builds failing with:

  CC [M]  drivers/mmc/host/dw_mmc.o
In file included from drivers/mmc/host/dw_mmc.c:15:
include/linux/blkdev.h:1404: warning: 'struct task_struct' declared inside parameter list
include/linux/blkdev.h:1404: warning: its scope is only this definition or declaration, which is probably not what you want
include/linux/blkdev.h:1408: warning: 'struct task_struct' declared inside parameter list
include/linux/blkdev.h:1413: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'blk_needs_flush_plug'
make[4]: *** [drivers/mmc/host/dw_mmc.o] Error 1

This is because dw_mmc.c includes linux/blkdev.h as the very first file,
and when CONFIG_BLOCK=n, blkdev.h omits all includes.

As it requires linux/sched.h even when CONFIG_BLOCK=n, move this out of
the #ifdef.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 include/linux/blkdev.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 2aa2466..4d4ac24 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1,9 +1,10 @@
 #ifndef _LINUX_BLKDEV_H
 #define _LINUX_BLKDEV_H
 
+#include <linux/sched.h>
+
 #ifdef CONFIG_BLOCK
 
-#include <linux/sched.h>
 #include <linux/major.h>
 #include <linux/genhd.h>
 #include <linux/list.h>


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

* Re: [PATCH] Fix blkdev.h build errors when BLOCK=n
  2012-04-30  8:18 [PATCH] Fix blkdev.h build errors when BLOCK=n Russell King - ARM Linux
@ 2012-05-12 19:54 ` Russell King - ARM Linux
  2012-05-14  6:30 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Russell King - ARM Linux @ 2012-05-12 19:54 UTC (permalink / raw)
  To: linux-kernel, Andrew Morton, Jens Axboe

Ping.

On Mon, Apr 30, 2012 at 09:18:34AM +0100, Russell King - ARM Linux wrote:
> I see builds failing with:
> 
>   CC [M]  drivers/mmc/host/dw_mmc.o
> In file included from drivers/mmc/host/dw_mmc.c:15:
> include/linux/blkdev.h:1404: warning: 'struct task_struct' declared inside parameter list
> include/linux/blkdev.h:1404: warning: its scope is only this definition or declaration, which is probably not what you want
> include/linux/blkdev.h:1408: warning: 'struct task_struct' declared inside parameter list
> include/linux/blkdev.h:1413: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'blk_needs_flush_plug'
> make[4]: *** [drivers/mmc/host/dw_mmc.o] Error 1
> 
> This is because dw_mmc.c includes linux/blkdev.h as the very first file,
> and when CONFIG_BLOCK=n, blkdev.h omits all includes.
> 
> As it requires linux/sched.h even when CONFIG_BLOCK=n, move this out of
> the #ifdef.
> 
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
>  include/linux/blkdev.h |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index 2aa2466..4d4ac24 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -1,9 +1,10 @@
>  #ifndef _LINUX_BLKDEV_H
>  #define _LINUX_BLKDEV_H
>  
> +#include <linux/sched.h>
> +
>  #ifdef CONFIG_BLOCK
>  
> -#include <linux/sched.h>
>  #include <linux/major.h>
>  #include <linux/genhd.h>
>  #include <linux/list.h>
> 

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

* Re: [PATCH] Fix blkdev.h build errors when BLOCK=n
  2012-04-30  8:18 [PATCH] Fix blkdev.h build errors when BLOCK=n Russell King - ARM Linux
  2012-05-12 19:54 ` Russell King - ARM Linux
@ 2012-05-14  6:30 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2012-05-14  6:30 UTC (permalink / raw)
  To: Russell King - ARM Linux; +Cc: linux-kernel, Andrew Morton

On 04/30/2012 10:18 AM, Russell King - ARM Linux wrote:
> I see builds failing with:
> 
>   CC [M]  drivers/mmc/host/dw_mmc.o
> In file included from drivers/mmc/host/dw_mmc.c:15:
> include/linux/blkdev.h:1404: warning: 'struct task_struct' declared inside parameter list
> include/linux/blkdev.h:1404: warning: its scope is only this definition or declaration, which is probably not what you want
> include/linux/blkdev.h:1408: warning: 'struct task_struct' declared inside parameter list
> include/linux/blkdev.h:1413: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'blk_needs_flush_plug'
> make[4]: *** [drivers/mmc/host/dw_mmc.o] Error 1
> 
> This is because dw_mmc.c includes linux/blkdev.h as the very first file,
> and when CONFIG_BLOCK=n, blkdev.h omits all includes.
> 
> As it requires linux/sched.h even when CONFIG_BLOCK=n, move this out of
> the #ifdef.

Thanks Russell, applied.

-- 
Jens Axboe


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

end of thread, other threads:[~2012-05-14  6:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-30  8:18 [PATCH] Fix blkdev.h build errors when BLOCK=n Russell King - ARM Linux
2012-05-12 19:54 ` Russell King - ARM Linux
2012-05-14  6:30 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).