aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernd Schubert <bernd@bsbernd.com>2025-03-23 00:19:04 +0100
committerBernd Schubert <bernd@bsbernd.com>2025-03-24 09:38:06 +0100
commit14520a6ef7eaf010d0d9354d3431fed362e205ce (patch)
tree6bdf8377e8e692ef224531dcdd1c135f32acfd27
parent9f7597a576eb6329ece28a4baee007970a2f278c (diff)
downloadlibfuse-14520a6ef7eaf010d0d9354d3431fed362e205ce.tar.gz
convert LL_ENABLE/LL_DISABLE to do-while-loop
This is to avoid checkpatch reports and might potentially avoid future issues if these macros would be part of conditions. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
-rw-r--r--lib/helper.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/helper.c b/lib/helper.c
index a7b2fe0..1fe3fde 100644
--- a/lib/helper.c
+++ b/lib/helper.c
@@ -423,10 +423,17 @@ void fuse_apply_conn_info_opts(struct fuse_conn_info_opts *opts,
if(opts->set_max_readahead)
conn->max_readahead = opts->max_readahead;
-#define LL_ENABLE(cond,cap) \
- if (cond) conn->want |= (cap)
-#define LL_DISABLE(cond,cap) \
- if (cond) conn->want &= ~(cap)
+#define LL_ENABLE(cond, cap) \
+ do { \
+ if (cond) \
+ conn->want |= (cap); \
+ } while (0)
+
+#define LL_DISABLE(cond, cap) \
+ do { \
+ if (cond) \
+ conn->want &= ~(cap); \
+ } while (0)
LL_ENABLE(opts->splice_read, FUSE_CAP_SPLICE_READ);
LL_DISABLE(opts->no_splice_read, FUSE_CAP_SPLICE_READ);