Skip to contentSkip to conversation

jffs2 build fixes

DISCUSSION David Brownell 3 participants 7 messages May 16, 2006 – May 25, 2006 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 2 lines · David Brownell

against today's GIT; there's a section error and
several printk format warnings. x86_64.

I see that Andrew also got tired of such printk warnings, so his fix is now in the kernel.org tree ... here's a resend of this patch, updated against today's GIT by removing two of the printk warning fixes.

- Dave

Resolve some JFFS2 build problems:
(a) section mismatch error
(b) wrong printk format warnings

The section mismatch issue was fixed by making a few more routines as belonging in init or exit sections, but there are more routines that could (should!) get such annotations.

fs/jffs2/compr.c +2 -2
Index: g26/fs/jffs2/compr.c
===================================================================
@@ -412,7 +412,7 @@ void jffs2_free_comprbuf(unsigned char *
                 kfree(comprbuf);
 }
 
-int jffs2_compressors_init(void)
+int __init jffs2_compressors_init(void)
 {
 /* Registering compressors */
 #ifdef CONFIG_JFFS2_ZLIB
@@ -440,7 +440,7 @@ int jffs2_compressors_init(void)
         return 0;
 }
 
-int jffs2_compressors_exit(void)
+int __exit jffs2_compressors_exit(void)
 {
 /* Unregistering compressors */
 #ifdef CONFIG_JFFS2_RUBIN
fs/jffs2/compr_zlib.c +2 -2
Index: g26/fs/jffs2/compr_zlib.c
===================================================================
@@ -60,7 +60,7 @@ static int __init alloc_workspaces(void)
 	return 0;
 }
 
-static void free_workspaces(void)
+static void __exit free_workspaces(void)
 {
 	vfree(def_strm.workspace);
 	vfree(inf_strm.workspace);
@@ -216,7 +216,7 @@ int __init jffs2_zlib_init(void)
     return ret;
 }
 
-void jffs2_zlib_exit(void)
+void __exit jffs2_zlib_exit(void)
 {
     jffs2_unregister_compressor(&jffs2_zlib_comp);
     free_workspaces();
fs/jffs2/readinode.c +4 -3
Index: g26/fs/jffs2/readinode.c
===================================================================
@@ -204,7 +204,7 @@ static inline int read_dnode(struct jffs
 
 	tn = jffs2_alloc_tmp_dnode_info();
 	if (!tn) {
-		JFFS2_ERROR("failed to allocate tn (%d bytes).\n", sizeof(*tn));
+		JFFS2_ERROR("failed to allocate tn (%zd bytes).\n", sizeof(*tn));
 		return -ENOMEM;
 	}
 
@@ -434,7 +434,7 @@ static int read_more(struct jffs2_sb_inf
 	}
 
 	if (retlen < len) {
-		JFFS2_ERROR("short read at %#08x: %d instead of %d.\n",
+		JFFS2_ERROR("short read at %#08x: %zu instead of %d.\n",
 				offs, retlen, len);
 		return -EIO;
 	}
@@ -542,7 +542,8 @@ static int jffs2_get_inode_nodes(struct 
 		}
 
 		if (retlen < len) {
-			JFFS2_ERROR("short read at %#08x: %d instead of %d.\n", ref_offset(ref), retlen, len);
+			JFFS2_ERROR("short read at %#08x: %zd instead of %d.\n",
+					ref_offset(ref), retlen, len);
 			err = -EIO;
 			goto free_out;
 		}
maintainer
#2 lore raw
Quoted 4 lines · David Brownell

I see that Andrew also got tired of such printk warnings, so his fix is now in the kernel.org tree ... here's a resend of this patch, updated against today's GIT by removing two of the printk warning fixes.

The other three printk watning fixes don't seem to apply any more either. I've committed the __init and __exit bits though. Thanks.

Signature · 1 line
dwmw2
#3 lore raw
Quoted 8 lines · David Woodhouse
Quoted 4 lines · David Brownell

I see that Andrew also got tired of such printk warnings, so his fix is now in the kernel.org tree ... here's a resend of this patch, updated against today's GIT by removing two of the printk warning fixes.

The other three printk watning fixes don't seem to apply any more either. I've committed the __init and __exit bits though. Thanks.

I'm getting section warnings with RC5 building JFFS2 as an x86 module; the ZLIB compressors it seems.

You might want to push those __init and __exit bits soon ...

- Dave

#4 lore raw
In reply to David Brownell
Quoted 8 lines · David Brownell
Quoted 2 lines · David Brownell

against today's GIT; there's a section error and
several printk format warnings. x86_64.

I see that Andrew also got tired of such printk warnings, so his fix is now in the kernel.org tree ... here's a resend of this patch, updated against today's GIT by removing two of the printk warning fixes.

[email protected] is practically dead. Iirc, the list was used for the old jffs[1] code. Jffs2 is usually discussed on [email protected] (added to Cc:).

Quoted 7 lines

Resolve some JFFS2 build problems:
(a) section mismatch error
(b) wrong printk format warnings

The section mismatch issue was fixed by making a few more routines as belonging in init or exit sections, but there are more routines that could (should!) get such annotations.

Patch looks sane. Does it still apply against dwmw2's latest tree?
http://git.infradead.org/?p=mtd-2.6.git

[ Patch kept for the benefit of linux-mtd ]

Quoted 69 lines

Index: g26/fs/jffs2/compr.c
===================================================================

fs/jffs2/compr.c +2 -2
@@ -412,7 +412,7 @@ void jffs2_free_comprbuf(unsigned char *
                 kfree(comprbuf);
 }
 
-int jffs2_compressors_init(void)
+int __init jffs2_compressors_init(void)
 {
 /* Registering compressors */
 #ifdef CONFIG_JFFS2_ZLIB
@@ -440,7 +440,7 @@ int jffs2_compressors_init(void)
         return 0;
 }
 
-int jffs2_compressors_exit(void)
+int __exit jffs2_compressors_exit(void)
 {
 /* Unregistering compressors */
 #ifdef CONFIG_JFFS2_RUBIN

Index: g26/fs/jffs2/compr_zlib.c
===================================================================

fs/jffs2/compr_zlib.c +2 -2
@@ -60,7 +60,7 @@ static int __init alloc_workspaces(void)
 	return 0;
 }
 
-static void free_workspaces(void)
+static void __exit free_workspaces(void)
 {
 	vfree(def_strm.workspace);
 	vfree(inf_strm.workspace);
@@ -216,7 +216,7 @@ int __init jffs2_zlib_init(void)
     return ret;
 }
 
-void jffs2_zlib_exit(void)
+void __exit jffs2_zlib_exit(void)
 {
     jffs2_unregister_compressor(&jffs2_zlib_comp);
     free_workspaces();

Index: g26/fs/jffs2/readinode.c
===================================================================

fs/jffs2/readinode.c +2 -2
@@ -204,7 +204,7 @@ static inline int read_dnode(struct jffs
 
 	tn = jffs2_alloc_tmp_dnode_info();
 	if (!tn) {
-		JFFS2_ERROR("failed to allocate tn (%d bytes).\n", sizeof(*tn));
+		JFFS2_ERROR("failed to allocate tn (%zd bytes).\n", sizeof(*tn));
 		return -ENOMEM;
 	}
 
@@ -434,7 +434,7 @@ static int read_more(struct jffs2_sb_inf
 	}
 
 	if (retlen < len) {
-		JFFS2_ERROR("short read at %#08x: %d instead of %d.\n",
+		JFFS2_ERROR("short read at %#08x: %zu instead of %d.\n",
 				offs, retlen, len);
 		return -EIO;
 	}

fs/jffs2/readinode.c static int jffs2_get_inode_nodes(struct · line 549

Quoted 9 lines
fs/jffs2/readinode.c +2 -1
@@ -542,7 +542,8 @@ static int jffs2_get_inode_nodes(struct 
 		}
 
 		if (retlen < len) {
-			JFFS2_ERROR("short read at %#08x: %d instead of %d.\n", ref_offset(ref), retlen, len);
+			JFFS2_ERROR("short read at %#08x: %zd instead of %d.\n",
+					ref_offset(ref), retlen, len);
 			err = -EIO;
 			goto free_out;
 		}

Jörn

Signature · 3 lines
They laughed at Galileo.  They laughed at Copernicus.  They laughed at
Columbus. But remember, they also laughed at Bozo the Clown.
-- unknown
#5 lore raw
Quoted 3 lines · Jörn Engel

[email protected] is practically dead. Iirc, the list was used for the old jffs[1] code. Jffs2 is usually discussed on [email protected] (added to Cc:).

Then it's overdue for the MAINTAINERS file to be updated ... it seems wrong that the official "where to go" listing for JFFS2 points at a black hole.

#6 lore raw
Quoted 9 lines · David Brownell
Quoted 3 lines · Jörn Engel

[email protected] is practically dead. Iirc, the list was used for the old jffs[1] code. Jffs2 is usually discussed on [email protected] (added to Cc:).

Then it's overdue for the MAINTAINERS file to be updated ... it seems wrong that the official "where to go" listing for JFFS2 points at a black hole.

Ouch! Yes, you are correct.

Can you send a patch to dwmw2?

Jörn

Signature · 4 lines
Write programs that do one thing and do it well. Write programs to work
together. Write programs to handle text streams, because that is a
universal interface. 
-- Doug MacIlroy
maintainer
#7 lore raw
Quoted 3 lines · Jörn Engel

Ouch! Yes, you are correct.

Can you send a patch to dwmw2?

dwmw2 is still subscribed to jffs-dev and responds... when the moderators eventually approve non-subscriber posts, at least :)

Changing it to [email protected] would seem to make sense though.

Signature · 1 line
dwmw2