From d0d3399a554cd4a3b58e72b6e76594edba557b27 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Fri, 20 Jan 2023 09:40:12 -0700 Subject: [PATCH] ANDROID: fuse: Restore upstream type of bitfields in fuse_args Commit 88b7179fcdb59 ("ANDROID: fuse: Move functions in preparation for fuse-bpf") changed the type of these bitfields from the upstream type of 'bool' to 'int', which causes several warnings with recent versions of clang: /builds/linux/fs/fuse/dir.c:168:19: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion] args->out_argvar = true; ^ ~~~~ /builds/linux/fs/fuse/dir.c:492:18: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion] args.out_argvar = 1; ^ ~ /builds/linux/fs/fuse/dir.c:1649:20: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion] ap.args.out_pages = true; ^ ~~~~ /builds/linux/fs/fuse/dir.c:1650:21: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion] ap.args.out_argvar = true; ^ ~~~~ /builds/linux/fs/fuse/dir.c:1651:23: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion] ap.args.page_zeroing = true; ^ ~~~~ 5 errors generated. When fuse_args was moved back to the internal implementation in commit 9a5023967b4d2 ("ANDROID: fuse-bpf: Use fuse_bpf_args in uapi"), the type was not restored. Do so now to fix the warnings and reduce the delta with upstream. Bug: 265200230 Change-Id: I4d51f331d842a1faff9a937140f0275130e70d73 Signed-off-by: Nathan Chancellor --- fs/fuse/fuse_i.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 87de62763a6c..a1fee82265ea 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -332,16 +332,16 @@ struct fuse_args { uint32_t error_in; unsigned short in_numargs; unsigned short out_numargs; - int force:1; - int noreply:1; - int nocreds:1; - int in_pages:1; - int out_pages:1; - int user_pages:1; - int out_argvar:1; - int page_zeroing:1; - int page_replace:1; - int may_block:1; + bool force:1; + bool noreply:1; + bool nocreds:1; + bool in_pages:1; + bool out_pages:1; + bool user_pages:1; + bool out_argvar:1; + bool page_zeroing:1; + bool page_replace:1; + bool may_block:1; struct fuse_in_arg in_args[FUSE_MAX_IN_ARGS]; struct fuse_arg out_args[FUSE_MAX_OUT_ARGS]; void (*end)(struct fuse_mount *fm, struct fuse_args *args, int error);