mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* mtdsuper.c BLOCK=n compile error
@ 2008-08-01 22:30 Adrian Bunk
  2008-08-01 22:48 ` David Woodhouse
  0 siblings, 1 reply; 5+ messages in thread
From: Adrian Bunk @ 2008-08-01 22:30 UTC (permalink / raw)
  To: nAl Viro, dwmw2; +Cc: linux-mtd, linux-kernel

Commit d5686b444ff3f72808d2b3fbd58672a86cdf38e7
(switch mtd and dm-table to lookup_bdev()) causes
the following compile error with CONFIG_BLOCK=n:

<--  snip  -->

...
  CC      drivers/mtd/mtdsuper.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/mtd/mtdsuper.c: In function `get_sb_mtd':
/home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/mtd/mtdsuper.c:184: error: implicit declaration of function 'lookup_bdev'
/home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/mtd/mtdsuper.c:184: warning: assignment makes pointer from integer without a cast
/home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/mtd/mtdsuper.c:197: error: implicit declaration of function 'bdput'
make[3]: *** [drivers/mtd/mtdsuper.o] Error 1

<--  snip  -->

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

* Re: mtdsuper.c BLOCK=n compile error
  2008-08-01 22:30 mtdsuper.c BLOCK=n compile error Adrian Bunk
@ 2008-08-01 22:48 ` David Woodhouse
  2008-08-01 22:58   ` Adrian Bunk
  0 siblings, 1 reply; 5+ messages in thread
From: David Woodhouse @ 2008-08-01 22:48 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Al Viro, linux-mtd, linux-kernel

On Sat, 2008-08-02 at 01:30 +0300, Adrian Bunk wrote:
> Commit d5686b444ff3f72808d2b3fbd58672a86cdf38e7
> (switch mtd and dm-table to lookup_bdev()) causes
> the following compile error with CONFIG_BLOCK=n:
> 
> <--  snip  -->
> 
> ...
>   CC      drivers/mtd/mtdsuper.o
> /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/mtd/mtdsuper.c: In function `get_sb_mtd':
> /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/mtd/mtdsuper.c:184: error: implicit declaration of function 'lookup_bdev'
> /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/mtd/mtdsuper.c:184: warning: assignment makes pointer from integer without a cast
> /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/mtd/mtdsuper.c:197: error: implicit declaration of function 'bdput'
> make[3]: *** [drivers/mtd/mtdsuper.o] Error 1
> 
> <--  snip  -->

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

diff --git a/drivers/mtd/mtdsuper.c b/drivers/mtd/mtdsuper.c
index 9b6af7e..e03250b 100644
--- a/drivers/mtd/mtdsuper.c
+++ b/drivers/mtd/mtdsuper.c
@@ -178,6 +178,7 @@ int get_sb_mtd(struct file_system_type *fs_type, int
flags,
 		}
 	}
 
+#ifdef CONFIG_BLOCK
 	/* try the old way - the hack where we allowed users to mount
 	 * /dev/mtdblock$(n) but didn't actually _use_ the blockdev
 	 */
@@ -200,6 +201,7 @@ int get_sb_mtd(struct file_system_type *fs_type, int
flags,
 			     mnt);
 
 not_an_MTD_device:
+#endif /* CONFIG_BLOCK */
 	if (!(flags & MS_SILENT))
 		printk(KERN_NOTICE
 		       "MTD: Attempt to mount non-MTD device \"%s\"\n",

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation


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

* Re: mtdsuper.c BLOCK=n compile error
  2008-08-01 22:48 ` David Woodhouse
@ 2008-08-01 22:58   ` Adrian Bunk
  2008-08-01 23:20     ` David Woodhouse
  0 siblings, 1 reply; 5+ messages in thread
From: Adrian Bunk @ 2008-08-01 22:58 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Al Viro, linux-mtd, linux-kernel

On Fri, Aug 01, 2008 at 11:48:31PM +0100, David Woodhouse wrote:
> On Sat, 2008-08-02 at 01:30 +0300, Adrian Bunk wrote:
> > Commit d5686b444ff3f72808d2b3fbd58672a86cdf38e7
> > (switch mtd and dm-table to lookup_bdev()) causes
> > the following compile error with CONFIG_BLOCK=n:
> > 
> > <--  snip  -->
> > 
> > ...
> >   CC      drivers/mtd/mtdsuper.o
> > /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/mtd/mtdsuper.c: In function `get_sb_mtd':
> > /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/mtd/mtdsuper.c:184: error: implicit declaration of function 'lookup_bdev'
> > /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/mtd/mtdsuper.c:184: warning: assignment makes pointer from integer without a cast
> > /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/mtd/mtdsuper.c:197: error: implicit declaration of function 'bdput'
> > make[3]: *** [drivers/mtd/mtdsuper.o] Error 1
> > 
> > <--  snip  -->
> 
> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
> 
> diff --git a/drivers/mtd/mtdsuper.c b/drivers/mtd/mtdsuper.c
> index 9b6af7e..e03250b 100644
> --- a/drivers/mtd/mtdsuper.c
> +++ b/drivers/mtd/mtdsuper.c
> @@ -178,6 +178,7 @@ int get_sb_mtd(struct file_system_type *fs_type, int
> flags,
>  		}
>  	}
>  
> +#ifdef CONFIG_BLOCK
>  	/* try the old way - the hack where we allowed users to mount
>  	 * /dev/mtdblock$(n) but didn't actually _use_ the blockdev
>  	 */
> @@ -200,6 +201,7 @@ int get_sb_mtd(struct file_system_type *fs_type, int
> flags,
>  			     mnt);
>  
>  not_an_MTD_device:
> +#endif /* CONFIG_BLOCK */
>  	if (!(flags & MS_SILENT))
>  		printk(KERN_NOTICE
>  		       "MTD: Attempt to mount non-MTD device \"%s\"\n",


Still gives a compile error for the second bdput().


cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

* Re: mtdsuper.c BLOCK=n compile error
  2008-08-01 22:58   ` Adrian Bunk
@ 2008-08-01 23:20     ` David Woodhouse
  2008-08-01 23:26       ` David Woodhouse
  0 siblings, 1 reply; 5+ messages in thread
From: David Woodhouse @ 2008-08-01 23:20 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Al Viro, linux-mtd, linux-kernel

On Sat, 2008-08-02 at 01:58 +0300, Adrian Bunk wrote:
> Still gives a compile error for the second bdput().

Er, why is the second bdput() there _anyway_?

[MTD] Fix !CONFIG_BLOCK compile for mtdsuper.c
    
As reported by Adrian Bunk, commit d5686b444ff3f72808d2b3fbd58672a86cdf38e7
(switch mtd and dm-table to lookup_bdev()) causes the following compile
error with CONFIG_BLOCK=n:
    
  CC      drivers/mtd/mtdsuper.o
drivers/mtd/mtdsuper.c: In function `get_sb_mtd':
drivers/mtd/mtdsuper.c:184: error: implicit declaration of function 'lookup_bdev'
drivers/mtd/mtdsuper.c:184: warning: assignment makes pointer from integer without a cast
drivers/mtd/mtdsuper.c:197: error: implicit declaration of function 'bdput'
make[3]: *** [drivers/mtd/mtdsuper.o] Error 1
    
Fix it by putting the block device lookup inside #ifdef CONFIG_BLOCK
    
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

diff --git a/drivers/mtd/mtdsuper.c b/drivers/mtd/mtdsuper.c
index 9b6af7e..78114e3 100644
--- a/drivers/mtd/mtdsuper.c
+++ b/drivers/mtd/mtdsuper.c
@@ -125,8 +125,11 @@ int get_sb_mtd(struct file_system_type *fs_type,
int flags,
 	       int (*fill_super)(struct super_block *, void *, int),
 	       struct vfsmount *mnt)
 {
+#ifdef CONFIG_BLOCK
 	struct block_device *bdev;
-	int mtdnr, ret;
+	int ret;
+#endif
+	int mtdnr;
 
 	if (!dev_name)
 		return -EINVAL;
@@ -178,6 +181,7 @@ int get_sb_mtd(struct file_system_type *fs_type, int
flags,
 		}
 	}
 
+#ifdef CONFIG_BLOCK
 	/* try the old way - the hack where we allowed users to mount
 	 * /dev/mtdblock$(n) but didn't actually _use_ the blockdev
 	 */
@@ -200,12 +204,13 @@ int get_sb_mtd(struct file_system_type *fs_type,
int flags,
 			     mnt);
 
 not_an_MTD_device:
+#endif /* CONFIG_BLOCK */
+
 	if (!(flags & MS_SILENT))
 		printk(KERN_NOTICE
 		       "MTD: Attempt to mount non-MTD device \"%s\"\n",
 		       dev_name);
-	bdput(bdev);
-	return ret;
+	return -EINVAL;
 }
 
 EXPORT_SYMBOL_GPL(get_sb_mtd);

-- 
dwmw2


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

* Re: mtdsuper.c BLOCK=n compile error
  2008-08-01 23:20     ` David Woodhouse
@ 2008-08-01 23:26       ` David Woodhouse
  0 siblings, 0 replies; 5+ messages in thread
From: David Woodhouse @ 2008-08-01 23:26 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Al Viro, linux-mtd, linux-kernel

On Sat, 2008-08-02 at 00:20 +0100, David Woodhouse wrote:
> Er, why is the second bdput() there _anyway_?

Oh, I see. I have to stop posting patches -- I think it's past my
bedtime.

http://git.infradead.org/users/dwmw2/random-2.6.git?a=commitdiff;h=10f8e16418a5a69eda36cdbfc4ad17531c52fe92


-- 
dwmw2


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

end of thread, other threads:[~2008-08-01 23:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-01 22:30 mtdsuper.c BLOCK=n compile error Adrian Bunk
2008-08-01 22:48 ` David Woodhouse
2008-08-01 22:58   ` Adrian Bunk
2008-08-01 23:20     ` David Woodhouse
2008-08-01 23:26       ` David Woodhouse

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

all inboxes | Powered by JetHome®