Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da320f05 authored by Joe Perches's avatar Joe Perches Committed by David Woodhouse
Browse files

jffs2: Convert printks to pr_<level>



Use the more current logging style.

Coalesce formats, align arguments.
Convert uses of embedded function names to %s, __func__.

A couple of long line checkpatch errors I don't care about exist.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 9c261b33
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -42,7 +42,8 @@ int jffs2_start_garbage_collect_thread(struct jffs2_sb_info *c)

	tsk = kthread_run(jffs2_garbage_collect_thread, c, "jffs2_gcd_mtd%d", c->mtd->index);
	if (IS_ERR(tsk)) {
		printk(KERN_WARNING "fork failed for JFFS2 garbage collect thread: %ld\n", -PTR_ERR(tsk));
		pr_warn("fork failed for JFFS2 garbage collect thread: %ld\n",
			-PTR_ERR(tsk));
		complete(&c->gc_thread_exit);
		ret = PTR_ERR(tsk);
	} else {
@@ -152,7 +153,7 @@ static int jffs2_garbage_collect_thread(void *_c)

		jffs2_dbg(1, "%s(): pass\n", __func__);
		if (jffs2_garbage_collect_pass(c) == -ENOSPC) {
			printk(KERN_NOTICE "No space for garbage collection. Aborting GC thread\n");
			pr_notice("No space for garbage collection. Aborting GC thread\n");
			goto die;
		}
	}
+10 −7
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ static int jffs2_selected_compress(u8 compr, unsigned char *data_in,

	output_buf = kmalloc(*cdatalen, GFP_KERNEL);
	if (!output_buf) {
		printk(KERN_WARNING "JFFS2: No memory for compressor allocation. Compression failed.\n");
		pr_warn("JFFS2: No memory for compressor allocation. Compression failed.\n");
		return ret;
	}
	orig_slen = *datalen;
@@ -188,7 +188,8 @@ uint16_t jffs2_compress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
				tmp_buf = kmalloc(orig_slen, GFP_KERNEL);
				spin_lock(&jffs2_compressor_list_lock);
				if (!tmp_buf) {
					printk(KERN_WARNING "JFFS2: No memory for compressor allocation. (%d bytes)\n", orig_slen);
					pr_warn("JFFS2: No memory for compressor allocation. (%d bytes)\n",
						orig_slen);
					continue;
				}
				else {
@@ -235,7 +236,7 @@ uint16_t jffs2_compress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
				cpage_out, datalen, cdatalen);
		break;
	default:
		printk(KERN_ERR "JFFS2: unknown compression mode.\n");
		pr_err("JFFS2: unknown compression mode\n");
	}

	if (ret == JFFS2_COMPR_NONE) {
@@ -277,7 +278,8 @@ int jffs2_decompress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
				ret = this->decompress(cdata_in, data_out, cdatalen, datalen);
				spin_lock(&jffs2_compressor_list_lock);
				if (ret) {
					printk(KERN_WARNING "Decompressor \"%s\" returned %d\n", this->name, ret);
					pr_warn("Decompressor \"%s\" returned %d\n",
						this->name, ret);
				}
				else {
					this->stat_decompr_blocks++;
@@ -287,7 +289,8 @@ int jffs2_decompress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
				return ret;
			}
		}
		printk(KERN_WARNING "JFFS2 compression type 0x%02x not available.\n", comprtype);
		pr_warn("JFFS2 compression type 0x%02x not available\n",
			comprtype);
		spin_unlock(&jffs2_compressor_list_lock);
		return -EIO;
	}
@@ -299,7 +302,7 @@ int jffs2_register_compressor(struct jffs2_compressor *comp)
	struct jffs2_compressor *this;

	if (!comp->name) {
		printk(KERN_WARNING "NULL compressor name at registering JFFS2 compressor. Failed.\n");
		pr_warn("NULL compressor name at registering JFFS2 compressor. Failed.\n");
		return -1;
	}
	comp->compr_buf_size=0;
@@ -340,7 +343,7 @@ int jffs2_unregister_compressor(struct jffs2_compressor *comp)

	if (comp->usecount) {
		spin_unlock(&jffs2_compressor_list_lock);
		printk(KERN_WARNING "JFFS2: Compressor module is in use. Unregister failed.\n");
		pr_warn("JFFS2: Compressor module is in use. Unregister failed.\n");
		return -1;
	}
	list_del(&comp->list);
+3 −3
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ static int jffs2_zlib_compress(unsigned char *data_in,
	mutex_lock(&deflate_mutex);

	if (Z_OK != zlib_deflateInit(&def_strm, 3)) {
		printk(KERN_WARNING "deflateInit failed\n");
		pr_warn("deflateInit failed\n");
		mutex_unlock(&deflate_mutex);
		return -1;
	}
@@ -169,7 +169,7 @@ static int jffs2_zlib_decompress(unsigned char *data_in,


	if (Z_OK != zlib_inflateInit2(&inf_strm, wbits)) {
		printk(KERN_WARNING "inflateInit failed\n");
		pr_warn("inflateInit failed\n");
		mutex_unlock(&inflate_mutex);
		return 1;
	}
@@ -177,7 +177,7 @@ static int jffs2_zlib_decompress(unsigned char *data_in,
	while((ret = zlib_inflate(&inf_strm, Z_FINISH)) == Z_OK)
		;
	if (ret != Z_STREAM_END) {
		printk(KERN_NOTICE "inflate returned %d\n", ret);
		pr_notice("inflate returned %d\n", ret);
	}
	zlib_inflateEnd(&inf_strm);
	mutex_unlock(&inflate_mutex);
+12 −8
Original line number Diff line number Diff line
@@ -262,11 +262,14 @@ void __jffs2_dbg_superblock_counts(struct jffs2_sb_info *c)
	}

#define check(sz)							\
do {									\
	if (sz != c->sz##_size) {					\
		printk(KERN_WARNING #sz "_size mismatch counted 0x%x, c->" #sz "_size 0x%x\n", \
		       sz, c->sz##_size);		\
		pr_warn("%s_size mismatch counted 0x%x, c->%s_size 0x%x\n", \
			#sz, #sz, sz, c->sz##_size);			\
		dump = 1;						\
	}
	}								\
} while (0)

	check(free);
	check(dirty);
	check(used);
@@ -274,10 +277,11 @@ void __jffs2_dbg_superblock_counts(struct jffs2_sb_info *c)
	check(unchecked);
	check(bad);
	check(erasing);

#undef check

	if (nr_counted != c->nr_blocks) {
		printk(KERN_WARNING "%s counted only 0x%x blocks of 0x%x. Where are the others?\n",
		pr_warn("%s counted only 0x%x blocks of 0x%x. Where are the others?\n",
			__func__, nr_counted, c->nr_blocks);
		dump = 1;
	}
+4 −3
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ static struct dentry *jffs2_lookup(struct inode *dir_i, struct dentry *target,
	if (ino) {
		inode = jffs2_iget(dir_i->i_sb, ino);
		if (IS_ERR(inode))
			printk(KERN_WARNING "iget() failed for ino #%u\n", ino);
			pr_warn("iget() failed for ino #%u\n", ino);
	}

	return d_splice_alias(inode, target);
@@ -365,7 +365,7 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
	/* We use f->target field to store the target path. */
	f->target = kmemdup(target, targetlen + 1, GFP_KERNEL);
	if (!f->target) {
		printk(KERN_WARNING "Can't allocate %d bytes of memory\n", targetlen + 1);
		pr_warn("Can't allocate %d bytes of memory\n", targetlen + 1);
		mutex_unlock(&f->sem);
		jffs2_complete_reservation(c);
		ret = -ENOMEM;
@@ -860,7 +860,8 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry,
			f->inocache->pino_nlink++;
		mutex_unlock(&f->sem);

		printk(KERN_NOTICE "jffs2_rename(): Link succeeded, unlink failed (err %d). You now have a hard link\n", ret);
		pr_notice("%s(): Link succeeded, unlink failed (err %d). You now have a hard link\n",
			  __func__, ret);
		/* Might as well let the VFS know */
		d_instantiate(new_dentry, old_dentry->d_inode);
		ihold(old_dentry->d_inode);
Loading