Thread (32 messages) 32 messages, 4 authors, 2021-08-27

Re: [PATCH v34 07/13] mm/damon: Implement a debugfs-based user space interface

From: SeongJae Park <hidden>
Date: 2021-08-06 11:47:28
Also in: linux-mm, lkml

From: SeongJae Park <redacted>

On Thu, 5 Aug 2021 17:43:16 -0700 Andrew Morton [off-list ref] wrote:
quoted hunk ↗ jump to hunk
On Fri, 16 Jul 2021 08:14:43 +0000 SeongJae Park [off-list ref] wrote:
quoted
+#define targetid_is_pid(ctx)	\
+	(ctx->primitive.target_valid == damon_va_target_valid)
+
I think this can be implemented as a static inline C function?
--- a/mm/damon/dbgfs.c~mm-damon-implement-a-debugfs-based-user-space-interface-fix-fix
+++ a/mm/damon/dbgfs.c
@@ -97,8 +97,10 @@ out:
 	return ret;
 }
 
-#define targetid_is_pid(ctx)	\
-	(ctx->primitive.target_valid == damon_va_target_valid)
+static inline bool targetid_is_pid(const struct damon_ctx *ctx)
+{
+	return ctx->primitive.target_valid == damon_va_target_valid;
+}
 
 static ssize_t sprint_target_ids(struct damon_ctx *ctx, char *buf, ssize_t len)
 {
We prefer this because it looks better, provides typechecking and can
in some situations suppress unused variable warnings.
Agreed, I will keep that preference in my mind.  I also found that you already
nicely made the change in the the -mm tree[1], appreciate!

[1] https://www.ozlabs.org/~akpm/mmotm/broken-out/mm-damon-implement-a-debugfs-based-user-space-interface-fix-fix.patch


Thanks,
SeongJae Park
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help