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

Commit 6b38d03f authored by Artem Bityutskiy's avatar Artem Bityutskiy
Browse files

UBIFS: use pr_ helper instead of printk



Use 'pr_err()' instead of 'printk(KERN_ERR', etc.

Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
parent 79fda517
Loading
Loading
Loading
Loading
+211 −271

File changed.

Preview size limit exceeded, changes collapsed.

+3 −3
Original line number Diff line number Diff line
@@ -150,7 +150,7 @@ struct ubifs_global_debug_info {

#define ubifs_assert(expr) do {                                                \
	if (unlikely(!(expr))) {                                               \
		printk(KERN_CRIT "UBIFS assert failed in %s at %u (pid %d)\n", \
		pr_crit("UBIFS assert failed in %s at %u (pid %d)\n",          \
		       __func__, __LINE__, current->pid);                      \
		dump_stack();                                                  \
	}                                                                      \
@@ -159,7 +159,7 @@ struct ubifs_global_debug_info {
#define ubifs_assert_cmt_locked(c) do {                                        \
	if (unlikely(down_write_trylock(&(c)->commit_sem))) {                  \
		up_write(&(c)->commit_sem);                                    \
		printk(KERN_CRIT "commit lock is not locked!\n");              \
		pr_crit("commit lock is not locked!\n");                       \
		ubifs_assert(0);                                               \
	}                                                                      \
} while (0)
@@ -178,7 +178,7 @@ struct ubifs_global_debug_info {

/* Just a debugging messages not related to any specific UBIFS subsystem */
#define dbg_msg(fmt, ...)                                                      \
	printk(KERN_DEBUG "UBIFS DBG (pid %d): %s: " fmt "\n", current->pid,   \
	pr_err("UBIFS DBG (pid %d): %s: " fmt "\n", current->pid,              \
	       __func__, ##__VA_ARGS__)

/* General messages */
+15 −21
Original line number Diff line number Diff line
@@ -1886,8 +1886,7 @@ static void dump_lpt_leb(const struct ubifs_info *c, int lnum)
	int err, len = c->leb_size, node_type, node_num, node_len, offs;
	void *buf, *p;

	printk(KERN_DEBUG "(pid %d) start dumping LEB %d\n",
	       current->pid, lnum);
	pr_err("(pid %d) start dumping LEB %d\n", current->pid, lnum);
	buf = p = __vmalloc(c->leb_size, GFP_NOFS, PAGE_KERNEL);
	if (!buf) {
		ubifs_err("cannot allocate memory to dump LPT");
@@ -1905,14 +1904,14 @@ static void dump_lpt_leb(const struct ubifs_info *c, int lnum)

			pad_len = get_pad_len(c, p, len);
			if (pad_len) {
				printk(KERN_DEBUG "LEB %d:%d, pad %d bytes\n",
				pr_err("LEB %d:%d, pad %d bytes\n",
				       lnum, offs, pad_len);
				p += pad_len;
				len -= pad_len;
				continue;
			}
			if (len)
				printk(KERN_DEBUG "LEB %d:%d, free %d bytes\n",
				pr_err("LEB %d:%d, free %d bytes\n",
				       lnum, offs, len);
			break;
		}
@@ -1923,11 +1922,10 @@ static void dump_lpt_leb(const struct ubifs_info *c, int lnum)
		{
			node_len = c->pnode_sz;
			if (c->big_lpt)
				printk(KERN_DEBUG "LEB %d:%d, pnode num %d\n",
				pr_err("LEB %d:%d, pnode num %d\n",
				       lnum, offs, node_num);
			else
				printk(KERN_DEBUG "LEB %d:%d, pnode\n",
				       lnum, offs);
				pr_err("LEB %d:%d, pnode\n", lnum, offs);
			break;
		}
		case UBIFS_LPT_NNODE:
@@ -1937,29 +1935,28 @@ static void dump_lpt_leb(const struct ubifs_info *c, int lnum)

			node_len = c->nnode_sz;
			if (c->big_lpt)
				printk(KERN_DEBUG "LEB %d:%d, nnode num %d, ",
				pr_err("LEB %d:%d, nnode num %d, ",
				       lnum, offs, node_num);
			else
				printk(KERN_DEBUG "LEB %d:%d, nnode, ",
				pr_err("LEB %d:%d, nnode, ",
				       lnum, offs);
			err = ubifs_unpack_nnode(c, p, &nnode);
			for (i = 0; i < UBIFS_LPT_FANOUT; i++) {
				printk(KERN_CONT "%d:%d", nnode.nbranch[i].lnum,
				pr_cont("%d:%d", nnode.nbranch[i].lnum,
				       nnode.nbranch[i].offs);
				if (i != UBIFS_LPT_FANOUT - 1)
					printk(KERN_CONT ", ");
					pr_cont(", ");
			}
			printk(KERN_CONT "\n");
			pr_cont("\n");
			break;
		}
		case UBIFS_LPT_LTAB:
			node_len = c->ltab_sz;
			printk(KERN_DEBUG "LEB %d:%d, ltab\n",
			       lnum, offs);
			pr_err("LEB %d:%d, ltab\n", lnum, offs);
			break;
		case UBIFS_LPT_LSAVE:
			node_len = c->lsave_sz;
			printk(KERN_DEBUG "LEB %d:%d, lsave len\n", lnum, offs);
			pr_err("LEB %d:%d, lsave len\n", lnum, offs);
			break;
		default:
			ubifs_err("LPT node type %d not recognized", node_type);
@@ -1970,8 +1967,7 @@ static void dump_lpt_leb(const struct ubifs_info *c, int lnum)
		len -= node_len;
	}

	printk(KERN_DEBUG "(pid %d) finish dumping LEB %d\n",
	       current->pid, lnum);
	pr_err("(pid %d) finish dumping LEB %d\n", current->pid, lnum);
out:
	vfree(buf);
	return;
@@ -1988,12 +1984,10 @@ void ubifs_dump_lpt_lebs(const struct ubifs_info *c)
{
	int i;

	printk(KERN_DEBUG "(pid %d) start dumping all LPT LEBs\n",
	       current->pid);
	pr_err("(pid %d) start dumping all LPT LEBs\n", current->pid);
	for (i = 0; i < c->lpt_lebs; i++)
		dump_lpt_leb(c, i + c->lpt_first);
	printk(KERN_DEBUG "(pid %d) finish dumping all LPT LEBs\n",
	       current->pid);
	pr_err("(pid %d) finish dumping all LPT LEBs\n", current->pid);
}

/**
+6 −7
Original line number Diff line number Diff line
@@ -42,15 +42,14 @@
#define UBIFS_VERSION 1

/* Normal UBIFS messages */
#define ubifs_msg(fmt, ...) \
		printk(KERN_NOTICE "UBIFS: " fmt "\n", ##__VA_ARGS__)
#define ubifs_msg(fmt, ...) pr_notice("UBIFS: " fmt "\n", ##__VA_ARGS__)
/* UBIFS error messages */
#define ubifs_err(fmt, ...)                                         \
	printk(KERN_ERR "UBIFS error (pid %d): %s: " fmt "\n", current->pid, \
	pr_err("UBIFS error (pid %d): %s: " fmt "\n", current->pid, \
	       __func__, ##__VA_ARGS__)
/* UBIFS warning messages */
#define ubifs_warn(fmt, ...)                                        \
	printk(KERN_WARNING "UBIFS warning (pid %d): %s: " fmt "\n", \
	pr_warn("UBIFS warning (pid %d): %s: " fmt "\n",            \
		current->pid, __func__, ##__VA_ARGS__)

/* UBIFS file system VFS magic number */