mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Adrian Bunk <bunk@kernel.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: mtdsuper.c BLOCK=n compile error
Date: Sat, 02 Aug 2008 00:20:51 +0100	[thread overview]
Message-ID: <1217632851.3719.47.camel@shinybook.infradead.org> (raw)
In-Reply-To: <20080801225858.GM19682@cs181140183.pp.htv.fi>

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


  reply	other threads:[~2008-08-01 23:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-01 22:30 Adrian Bunk
2008-08-01 22:48 ` David Woodhouse
2008-08-01 22:58   ` Adrian Bunk
2008-08-01 23:20     ` David Woodhouse [this message]
2008-08-01 23:26       ` David Woodhouse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1217632851.3719.47.camel@shinybook.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=bunk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®