Skip to content

Commit cabdb4f

Browse files
zhengbin13Miklos Szeredi
authored andcommitted
fuse: use true,false for bool variable
Fixes coccicheck warning: fs/fuse/readdir.c:335:1-19: WARNING: Assignment of 0/1 to bool variable fs/fuse/file.c:1398:2-19: WARNING: Assignment of 0/1 to bool variable fs/fuse/file.c:1400:2-20: WARNING: Assignment of 0/1 to bool variable fs/fuse/cuse.c:454:1-20: WARNING: Assignment of 0/1 to bool variable fs/fuse/cuse.c:455:1-19: WARNING: Assignment of 0/1 to bool variable fs/fuse/inode.c:497:2-17: WARNING: Assignment of 0/1 to bool variable fs/fuse/inode.c:504:2-23: WARNING: Assignment of 0/1 to bool variable fs/fuse/inode.c:511:2-22: WARNING: Assignment of 0/1 to bool variable fs/fuse/inode.c:518:2-23: WARNING: Assignment of 0/1 to bool variable fs/fuse/inode.c:522:2-26: WARNING: Assignment of 0/1 to bool variable fs/fuse/inode.c:526:2-18: WARNING: Assignment of 0/1 to bool variable fs/fuse/inode.c:1000:1-20: WARNING: Assignment of 0/1 to bool variable Reported-by: Hulk Robot <[email protected]> Signed-off-by: zhengbin <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
1 parent 8ab13bc commit cabdb4f

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

fs/fuse/cuse.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,8 @@ static int cuse_send_init(struct cuse_conn *cc)
451451
ap->args.out_args[0].size = sizeof(ia->out);
452452
ap->args.out_args[0].value = &ia->out;
453453
ap->args.out_args[1].size = CUSE_INIT_INFO_MAX;
454-
ap->args.out_argvar = 1;
455-
ap->args.out_pages = 1;
454+
ap->args.out_argvar = true;
455+
ap->args.out_pages = true;
456456
ap->num_pages = 1;
457457
ap->pages = &ia->page;
458458
ap->descs = &ia->desc;

fs/fuse/file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,9 +1409,9 @@ static int fuse_get_user_pages(struct fuse_args_pages *ap, struct iov_iter *ii,
14091409
}
14101410

14111411
if (write)
1412-
ap->args.in_pages = 1;
1412+
ap->args.in_pages = true;
14131413
else
1414-
ap->args.out_pages = 1;
1414+
ap->args.out_pages = true;
14151415

14161416
*nbytesp = nbytes;
14171417

fs/fuse/inode.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -494,36 +494,36 @@ static int fuse_parse_param(struct fs_context *fc, struct fs_parameter *param)
494494

495495
case OPT_FD:
496496
ctx->fd = result.uint_32;
497-
ctx->fd_present = 1;
497+
ctx->fd_present = true;
498498
break;
499499

500500
case OPT_ROOTMODE:
501501
if (!fuse_valid_type(result.uint_32))
502502
return invalf(fc, "fuse: Invalid rootmode");
503503
ctx->rootmode = result.uint_32;
504-
ctx->rootmode_present = 1;
504+
ctx->rootmode_present = true;
505505
break;
506506

507507
case OPT_USER_ID:
508508
ctx->user_id = make_kuid(fc->user_ns, result.uint_32);
509509
if (!uid_valid(ctx->user_id))
510510
return invalf(fc, "fuse: Invalid user_id");
511-
ctx->user_id_present = 1;
511+
ctx->user_id_present = true;
512512
break;
513513

514514
case OPT_GROUP_ID:
515515
ctx->group_id = make_kgid(fc->user_ns, result.uint_32);
516516
if (!gid_valid(ctx->group_id))
517517
return invalf(fc, "fuse: Invalid group_id");
518-
ctx->group_id_present = 1;
518+
ctx->group_id_present = true;
519519
break;
520520

521521
case OPT_DEFAULT_PERMISSIONS:
522-
ctx->default_permissions = 1;
522+
ctx->default_permissions = true;
523523
break;
524524

525525
case OPT_ALLOW_OTHER:
526-
ctx->allow_other = 1;
526+
ctx->allow_other = true;
527527
break;
528528

529529
case OPT_MAX_READ:
@@ -997,7 +997,7 @@ void fuse_send_init(struct fuse_conn *fc)
997997
/* Variable length argument used for backward compatibility
998998
with interface version < 7.5. Rest of init_out is zeroed
999999
by do_get_request(), so a short reply is not a problem */
1000-
ia->args.out_argvar = 1;
1000+
ia->args.out_argvar = true;
10011001
ia->args.out_args[0].size = sizeof(ia->out);
10021002
ia->args.out_args[0].value = &ia->out;
10031003
ia->args.force = true;

fs/fuse/readdir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ static int fuse_readdir_uncached(struct file *file, struct dir_context *ctx)
332332
return -ENOMEM;
333333

334334
plus = fuse_use_readdirplus(inode, ctx);
335-
ap->args.out_pages = 1;
335+
ap->args.out_pages = true;
336336
ap->num_pages = 1;
337337
ap->pages = &page;
338338
ap->descs = &desc;

0 commit comments

Comments
 (0)