selftests/filesystems/mount-notify: fix unused result compiler warning
Subsystems (2)
PATCH 1/1 selftests/filesystems/mount-notify: fix unused result compiler warning
From: LJ Fogelstrom <[email protected]>
Compiling with GCC emits Wwarn-unused-result for these two statements, so they are now wrapped in an assert similar to the rest of the code.
(Apologies for sending this twice; I am new and missed to include the maintainers the first time)
--- .../selftests/filesystems/mount-notify/mount-notify_test.c | 2 +- .../selftests/filesystems/mount-notify/mount-notify_test_ns.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c +1 -1
@@ -464,7 +464,7 @@ TEST_F(fanotify, rmdir)ASSERT_GE (ret,0 );if (ret ==0 ) { -chdir ("/" ); +ASSERT_EQ (chdir ("/" ),0 );unshare (CLONE_NEWNS );mount ("" ,"/" ,NULL ,MS_REC |MS_PRIVATE ,NULL );umount2 ("/a" ,MNT_DETACH );
tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c +1 -1
@@ -491,7 +491,7 @@ TEST_F(fanotify, rmdir)ASSERT_GE (ret,0 );if (ret ==0 ) { -chdir ("/" ); +ASSERT_EQ (chdir ("/" ),0 );unshare (CLONE_NEWNS );mount ("" ,"/" ,NULL ,MS_REC |MS_PRIVATE ,NULL );umount2 ("/a" ,MNT_DETACH );
Signature · 1 line
2.52.0
Quoted 9 lines · root
From: LJ Fogelstrom <[email protected]>
Compiling with GCC emits Wwarn-unused-result for these two statements, so they are now wrapped in an assert similar to the rest of the code.
(Apologies for sending this twice; I am new and missed to include the maintainers the first time)
Don't include this kind of thing in the commit message.
To be honest, I would just ignore the warning. I think the code looks worse at the end.
regards,
dan carpenter