lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241016152430.3456-2-gouhao@uniontech.com>
Date: Wed, 16 Oct 2024 23:24:30 +0800
From: Gou Hao <gouhao@...ontech.com>
To: xiang@...nel.org,
	chao@...nel.org
Cc: linux-erofs@...ts.ozlabs.org,
	linux-kernel@...r.kernel.org,
	gouhaojake@....com
Subject: [PATCH 2/2] erofs: simplify declaration of the log functions

remove the macro of the log declarations.

Signed-off-by: Gou Hao <gouhao@...ontech.com>
---
 fs/erofs/internal.h | 13 +++++--------
 fs/erofs/super.c    | 12 ++++++------
 2 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h
index 4efd578d7c62..0c3d6b9f85b5 100644
--- a/fs/erofs/internal.h
+++ b/fs/erofs/internal.h
@@ -24,14 +24,11 @@
 #undef pr_fmt
 #define pr_fmt(fmt) "erofs: " fmt
 
-__printf(3, 4) void _erofs_err(struct super_block *sb,
-			       const char *function, const char *fmt, ...);
-#define erofs_err(sb, fmt, ...)	\
-	_erofs_err(sb, __func__, fmt "\n", ##__VA_ARGS__)
-__printf(3, 4) void _erofs_info(struct super_block *sb,
-			       const char *function, const char *fmt, ...);
-#define erofs_info(sb, fmt, ...) \
-	_erofs_info(sb, __func__, fmt "\n", ##__VA_ARGS__)
+#define erofs_log_declare(name) \
+	__printf(2, 3) void erofs_##name(struct super_block *sb, const char *fmt, ...)
+erofs_log_declare(err);
+erofs_log_declare(info);
+
 #ifdef CONFIG_EROFS_FS_DEBUG
 #define DBG_BUGON               BUG_ON
 #else
diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index b04f888c8123..587a56e390ff 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -18,8 +18,8 @@
 
 static struct kmem_cache *erofs_inode_cachep __read_mostly;
 
-#define _erofs_log_def(name) \
-	void _erofs_##name(struct super_block *sb, const char *func, const char *fmt, ...) \
+#define erofs_log_def(name) \
+	__printf(2, 3) void erofs_##name(struct super_block *sb, const char *fmt, ...) \
 	{ \
 		struct va_format vaf; \
 		va_list args; \
@@ -30,14 +30,14 @@ static struct kmem_cache *erofs_inode_cachep __read_mostly;
 		vaf.va = &args; \
 		\
 		if ((sb)) \
-			pr_##name("(device %s): %s: %pV", (sb)->s_id, (func), &vaf); \
+			pr_##name("(device %s): %s: %pV\n", (sb)->s_id, __func__, &vaf); \
 		else \
-			pr_##name("%s: %pV", (func), &vaf); \
+			pr_##name("%s: %pV\n", __func__, &vaf); \
 		va_end(args); \
 	}
 
-_erofs_log_def(err);
-_erofs_log_def(info);
+erofs_log_def(err);
+erofs_log_def(info);
 
 static int erofs_superblock_csum_verify(struct super_block *sb, void *sbdata)
 {
-- 
2.20.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ