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

Commit e45ca8ba authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds
Browse files

ncpfs: convert PPRINTK to ncp_vdbg



Use a more current logging style.

Convert the paranoia debug statement to vdbg.
Remove the embedded function names as dynamic_debug can do that.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Cc: Petr Vandrovec <petr@vandrovec.name>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d3b73ca1
Loading
Loading
Loading
Loading
+9 −10
Original line number Original line Diff line number Diff line
@@ -736,7 +736,7 @@ ncp_do_readdir(struct file *file, struct dir_context *ctx,
	size_t bufsize;
	size_t bufsize;


	ncp_dbg(1, "%pD2, fpos=%ld\n", file, (unsigned long)ctx->pos);
	ncp_dbg(1, "%pD2, fpos=%ld\n", file, (unsigned long)ctx->pos);
	PPRINTK("ncp_do_readdir: init %pD, volnum=%d, dirent=%u\n",
	ncp_vdbg("init %pD, volnum=%d, dirent=%u\n",
		 file, NCP_FINFO(dir)->volNumber, NCP_FINFO(dir)->dirEntNum);
		 file, NCP_FINFO(dir)->volNumber, NCP_FINFO(dir)->dirEntNum);


	err = ncp_initialize_search(server, dir, &seq);
	err = ncp_initialize_search(server, dir, &seq);
@@ -804,8 +804,7 @@ int ncp_conn_logged_in(struct super_block *sb)
			goto out;
			goto out;
		result = -ENOENT;
		result = -ENOENT;
		if (ncp_get_volume_root(server, __name, &volNumber, &dirEntNum, &DosDirNum)) {
		if (ncp_get_volume_root(server, __name, &volNumber, &dirEntNum, &DosDirNum)) {
			PPRINTK("ncp_conn_logged_in: %s not found\n",
			ncp_vdbg("%s not found\n", server->m.mounted_vol);
				server->m.mounted_vol);
			goto out;
			goto out;
		}
		}
		dent = sb->s_root;
		dent = sb->s_root;
@@ -842,7 +841,7 @@ static struct dentry *ncp_lookup(struct inode *dir, struct dentry *dentry, unsig
	if (!ncp_conn_valid(server))
	if (!ncp_conn_valid(server))
		goto finished;
		goto finished;


	PPRINTK("ncp_lookup: server lookup for %pd2\n", dentry);
	ncp_vdbg("server lookup for %pd2\n", dentry);


	len = sizeof(__name);
	len = sizeof(__name);
	if (ncp_is_server_root(dir)) {
	if (ncp_is_server_root(dir)) {
@@ -858,7 +857,7 @@ static struct dentry *ncp_lookup(struct inode *dir, struct dentry *dentry, unsig
		if (!res)
		if (!res)
			res = ncp_obtain_info(server, dir, __name, &(finfo.i));
			res = ncp_obtain_info(server, dir, __name, &(finfo.i));
	}
	}
	PPRINTK("ncp_lookup: looked for %pd2, res=%d\n", dentry, res);
	ncp_vdbg("looked for %pd2, res=%d\n", dentry, res);
	/*
	/*
	 * If we didn't find an entry, make a negative dentry.
	 * If we didn't find an entry, make a negative dentry.
	 */
	 */
@@ -882,7 +881,7 @@ static struct dentry *ncp_lookup(struct inode *dir, struct dentry *dentry, unsig
	}
	}


finished:
finished:
	PPRINTK("ncp_lookup: result=%d\n", error);
	ncp_vdbg("result=%d\n", error);
	return ERR_PTR(error);
	return ERR_PTR(error);
}
}


@@ -905,7 +904,7 @@ static int ncp_instantiate(struct inode *dir, struct dentry *dentry,
	return error;
	return error;


out_close:
out_close:
	PPRINTK("ncp_instantiate: %pd2 failed, closing file\n", dentry);
	ncp_vdbg("%pd2 failed, closing file\n", dentry);
	ncp_close_file(NCP_SERVER(dir), finfo->file_handle);
	ncp_close_file(NCP_SERVER(dir), finfo->file_handle);
	goto out;
	goto out;
}
}
@@ -919,7 +918,7 @@ int ncp_create_new(struct inode *dir, struct dentry *dentry, umode_t mode,
	int opmode;
	int opmode;
	__u8 __name[NCP_MAXPATHLEN + 1];
	__u8 __name[NCP_MAXPATHLEN + 1];
	
	
	PPRINTK("ncp_create_new: creating %pd2, mode=%hx\n", dentry, mode);
	ncp_vdbg("creating %pd2, mode=%hx\n", dentry, mode);


	ncp_age_dentry(server, dentry);
	ncp_age_dentry(server, dentry);
	len = sizeof(__name);
	len = sizeof(__name);
@@ -1069,7 +1068,7 @@ static int ncp_unlink(struct inode *dir, struct dentry *dentry)
	 * Check whether to close the file ...
	 * Check whether to close the file ...
	 */
	 */
	if (inode) {
	if (inode) {
		PPRINTK("ncp_unlink: closing file\n");
		ncp_vdbg("closing file\n");
		ncp_make_closed(inode);
		ncp_make_closed(inode);
	}
	}


+2 −2
Original line number Original line Diff line number Diff line
@@ -73,7 +73,7 @@ int ncp_make_open(struct inode *inode, int right)
				break;
				break;
		}
		}
		if (result) {
		if (result) {
			PPRINTK("ncp_make_open: failed, result=%d\n", result);
			ncp_vdbg("failed, result=%d\n", result);
			goto out_unlock;
			goto out_unlock;
		}
		}
		/*
		/*
@@ -85,7 +85,7 @@ int ncp_make_open(struct inode *inode, int right)
	}
	}


	access = NCP_FINFO(inode)->access;
	access = NCP_FINFO(inode)->access;
	PPRINTK("ncp_make_open: file open, access=%x\n", access);
	ncp_vdbg("file open, access=%x\n", access);
	if (access == right || access == O_RDWR) {
	if (access == right || access == O_RDWR) {
		atomic_inc(&NCP_FINFO(inode)->opened);
		atomic_inc(&NCP_FINFO(inode)->opened);
		error = 0;
		error = 0;
+7 −2
Original line number Original line Diff line number Diff line
@@ -7,9 +7,14 @@


#undef NCPFS_PARANOIA
#undef NCPFS_PARANOIA
#ifdef NCPFS_PARANOIA
#ifdef NCPFS_PARANOIA
#define PPRINTK(format, args...) PRINTK(format , ## args)
#define ncp_vdbg(fmt, ...)					\
	pr_debug(fmt, ##__VA_ARGS__)
#else
#else
#define PPRINTK(format, args...)
#define ncp_vdbg(fmt, ...)					\
do {								\
	if (0)							\
		pr_debug(fmt, ##__VA_ARGS__);			\
} while (0)
#endif
#endif


#ifndef DEBUG_NCP
#ifndef DEBUG_NCP
+3 −3
Original line number Original line Diff line number Diff line
@@ -295,7 +295,7 @@ ncp_make_closed(struct inode *inode)
		err = ncp_close_file(NCP_SERVER(inode), NCP_FINFO(inode)->file_handle);
		err = ncp_close_file(NCP_SERVER(inode), NCP_FINFO(inode)->file_handle);


		if (!err)
		if (!err)
			PPRINTK("ncp_make_closed: volnum=%d, dirent=%u, error=%d\n",
			ncp_vdbg("volnum=%d, dirent=%u, error=%d\n",
				 NCP_FINFO(inode)->volNumber,
				 NCP_FINFO(inode)->volNumber,
				 NCP_FINFO(inode)->dirEntNum, err);
				 NCP_FINFO(inode)->dirEntNum, err);
	}
	}
+1 −1
Original line number Original line Diff line number Diff line
@@ -823,7 +823,7 @@ int ncp_request2(struct ncp_server *server, int function,
	result = reply->completion_code;
	result = reply->completion_code;


	if (result != 0)
	if (result != 0)
		PPRINTK("ncp_request: completion code=%x\n", result);
		ncp_vdbg("completion code=%x\n", result);
out:
out:
	return result;
	return result;
}
}