[MTD] mtdcore.c: share syms with mtd_blkdev.c

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Thu Jun 28 15:59:02 EDT 2007


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=356d70f19d949a11320ab626037b2d197a8e8b51
Commit:     356d70f19d949a11320ab626037b2d197a8e8b51
Parent:     029a9eb1f667ca71fe7eb3bf8962f01ac4d252a5
Author:     Ben Dooks <ben-linux at fluff.org>
AuthorDate: Mon May 28 20:28:34 2007 +0100
Committer:  David Woodhouse <dwmw2 at infradead.org>
CommitDate: Thu Jun 28 20:24:50 2007 +0100

    [MTD] mtdcore.c: share syms with mtd_blkdev.c
    
    Fix the sparse warnings generated by the implicit
    dependency of mtd_blkdevs.c and mtd_core.c for the
    two symbols mtd_table and mtd_table_mutex. This is
    done by adding an local header file mtdcore.h to
    define these (including the warning about the
    non-proliferation of these symbols).
    
    Signed-off-by: Ben Dooks <ben-linux at fluff.org>
    Signed-off-by: David Woodhouse <dwmw2 at infradead.org>
---
 drivers/mtd/mtd_blkdevs.c |    5 ++---
 drivers/mtd/mtdcore.c     |    2 ++
 drivers/mtd/mtdcore.h     |   11 +++++++++++
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 7816605..a8a1587 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -23,10 +23,9 @@
 #include <linux/kthread.h>
 #include <asm/uaccess.h>
 
-static LIST_HEAD(blktrans_majors);
+#include "mtdcore.h"
 
-extern struct mutex mtd_table_mutex;
-extern struct mtd_info *mtd_table[];
+static LIST_HEAD(blktrans_majors);
 
 struct mtd_blkcore_priv {
 	struct task_struct *thread;
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index c153b64..6c2645e 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -22,6 +22,8 @@
 
 #include <linux/mtd/mtd.h>
 
+#include "mtdcore.h"
+
 /* These are exported solely for the purpose of mtd_blkdevs.c. You
    should not use them for _anything_ else */
 DEFINE_MUTEX(mtd_table_mutex);
diff --git a/drivers/mtd/mtdcore.h b/drivers/mtd/mtdcore.h
new file mode 100644
index 0000000..a33251f
--- /dev/null
+++ b/drivers/mtd/mtdcore.h
@@ -0,0 +1,11 @@
+/* linux/drivers/mtd/mtdcore.h
+ *
+ * Header file for driver private mtdcore exports
+ *
+ */
+
+/* These are exported solely for the purpose of mtd_blkdevs.c. You
+   should not use them for _anything_ else */
+
+extern struct mutex mtd_table_mutex;
+extern struct mtd_info *mtd_table[MAX_MTD_DEVICES];



More information about the linux-mtd-cvs mailing list