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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210805174316.ff4b6eee629f9f05259058d9@linux-foundation.org>
Date:   Thu, 5 Aug 2021 17:43:16 -0700
From:   Andrew Morton <akpm@...ux-foundation.org>
To:     SeongJae Park <sj38.park@...il.com>
Cc:     SeongJae Park <sjpark@...zon.de>, Jonathan.Cameron@...wei.com,
        acme@...nel.org, alexander.shishkin@...ux.intel.com,
        amit@...nel.org, benh@...nel.crashing.org,
        brendanhiggins@...gle.com, corbet@....net, david@...hat.com,
        dwmw@...zon.com, elver@...gle.com, fan.du@...el.com,
        foersleo@...zon.de, greg@...ah.com, gthelen@...gle.com,
        guoju.fgj@...baba-inc.com, jgowans@...zon.com, joe@...ches.com,
        mgorman@...e.de, mheyne@...zon.de, minchan@...nel.org,
        mingo@...hat.com, namhyung@...nel.org, peterz@...radead.org,
        riel@...riel.com, rientjes@...gle.com, rostedt@...dmis.org,
        rppt@...nel.org, shakeelb@...gle.com, shuah@...nel.org,
        sieberf@...zon.com, snu@...le79.org, vbabka@...e.cz,
        vdavydov.dev@...il.com, zgf574564920@...il.com,
        linux-damon@...zon.com, linux-mm@...ck.org,
        linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v34 07/13] mm/damon: Implement a debugfs-based user
 space interface

On Fri, 16 Jul 2021 08:14:43 +0000 SeongJae Park <sj38.park@...il.com> wrote:

> +#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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ