Skip to content

Commit

Permalink
libceph: use kbasename() and kill ceph_file_part()
Browse files Browse the repository at this point in the history
Signed-off-by: Ilya Dryomov <[email protected]>
Reviewed-by: Alex Elder <[email protected]>
  • Loading branch information
idryomov committed May 23, 2017
1 parent 0833289 commit 6f4dbd1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
6 changes: 3 additions & 3 deletions include/linux/ceph/ceph_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/string.h>

#ifdef CONFIG_CEPH_LIB_PRETTYDEBUG

/*
Expand All @@ -12,12 +14,10 @@
*/

# if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
extern const char *ceph_file_part(const char *s, int len);
# define dout(fmt, ...) \
pr_debug("%.*s %12.12s:%-4d : " fmt, \
8 - (int)sizeof(KBUILD_MODNAME), " ", \
ceph_file_part(__FILE__, sizeof(__FILE__)), \
__LINE__, ##__VA_ARGS__)
kbasename(__FILE__), __LINE__, ##__VA_ARGS__)
# else
/* faux printk call just to see any compiler warnings. */
# define dout(fmt, ...) do { \
Expand Down
13 changes: 0 additions & 13 deletions net/ceph/ceph_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,6 @@ static const struct kernel_param_ops param_ops_supported_features = {
module_param_cb(supported_features, &param_ops_supported_features, NULL,
S_IRUGO);

/*
* find filename portion of a path (/foo/bar/baz -> baz)
*/
const char *ceph_file_part(const char *s, int len)
{
const char *e = s + len;

while (e != s && *(e-1) != '/')
e--;
return e;
}
EXPORT_SYMBOL(ceph_file_part);

const char *ceph_msg_type_name(int type)
{
switch (type) {
Expand Down

0 comments on commit 6f4dbd1

Please sign in to comment.