diff options
| author | Gou Hao <gouhao@uniontech.com> | 2024-11-14 09:32:47 +0800 |
|---|---|---|
| committer | Gao Xiang <hsiangkao@linux.alibaba.com> | 2024-11-18 18:50:13 +0800 |
| commit | 90655ee279b299c33dc51be87787b54222d3d2fb (patch) | |
| tree | 79387c058f785bce7c6c7497516e063fb24a3abe /fs/erofs/super.c | |
| parent | db80b98305f73ca83891e4228ead5f0324118b00 (diff) | |
| download | linux-next-90655ee279b299c33dc51be87787b54222d3d2fb.tar.gz linux-next-90655ee279b299c33dc51be87787b54222d3d2fb.zip | |
erofs: simplify definition of the log functions
Use printk instead of pr_info/err to reduce
redundant code.
Signed-off-by: Gou Hao <gouhao@uniontech.com>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20241114013247.30821-1-gouhao@uniontech.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Diffstat (limited to 'fs/erofs/super.c')
| -rw-r--r-- | fs/erofs/super.c | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/fs/erofs/super.c b/fs/erofs/super.c index bed3dbe5b7cb..961ee47e2b4d 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -18,37 +18,22 @@ static struct kmem_cache *erofs_inode_cachep __read_mostly; -void _erofs_err(struct super_block *sb, const char *func, const char *fmt, ...) +void _erofs_printk(struct super_block *sb, const char *fmt, ...) { struct va_format vaf; va_list args; + int level; va_start(args, fmt); - vaf.fmt = fmt; + level = printk_get_level(fmt); + vaf.fmt = printk_skip_level(fmt); vaf.va = &args; - - if (sb) - pr_err("(device %s): %s: %pV", sb->s_id, func, &vaf); - else - pr_err("%s: %pV", func, &vaf); - va_end(args); -} - -void _erofs_info(struct super_block *sb, const char *func, const char *fmt, ...) -{ - struct va_format vaf; - va_list args; - - va_start(args, fmt); - - vaf.fmt = fmt; - vaf.va = &args; - if (sb) - pr_info("(device %s): %pV", sb->s_id, &vaf); + printk("%c%cerofs (device %s): %pV", + KERN_SOH_ASCII, level, sb->s_id, &vaf); else - pr_info("%pV", &vaf); + printk("%c%cerofs: %pV", KERN_SOH_ASCII, level, &vaf); va_end(args); } |
