syscalls/capget02: remove useless getpid()
PATCH v2 1/1 syscalls/capget02: remove useless getpid()
Since pid=0 returns the capabilities for the calling thread, we can remove getpid. Also we can cover this test point.
-----------------
v1-v2:
remove pid = 0 assignment, because it has been initialized as 0. add comment
-----------------
--- testcases/kernel/syscalls/capget/capget02.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
testcases/kernel/syscalls/capget/capget02.c +6 -6
@@ -69,15 +69,15 @@ static void verify_capget(unsigned int n)static void setup (void ) { -unsigned int i, pid; - - pid =getpid (); +unsigned int i; +/* +* Don't need to assign value to header.pid and bad_version_header.pid. +* Because they have been initialized as 0 that it returns the capabilities +* for the calling thread, equivalently to getpid(). +*/ header.version =0x19980330 ; - header.pid = pid; - bad_version_header.version =0 ; - bad_version_header.pid = pid; bad_pid_header.version =0x19980330 ; bad_pid_header.pid =-1 ;
Signature · 1 line
2.18.0
PATCH v2 1/1 syscalls/capget02: remove useless getpid()
Hi Xu,
Quoted 8 lines
Since pid=0 returns the capabilities for the calling thread, we can remove getpid. Also we can cover this test point.
Signed-off-by Yang Xu <[email protected]>-----------------
v1-v2:
remove pid = 0 assignment, because it has been initialized as 0. add comment
Note, waiting for merge before current git get's fixed. (v2 of https://patchwork.ozlabs.org/patch/1220180/).
Kind regards,
Petr
PATCH v2 1/1 syscalls/capget02: remove useless getpid()
Hi Xu,
Quoted 8 lines
Quoted 8 lines
Since pid=0 returns the capabilities for the calling thread, we can remove getpid. Also we can cover this test point.
Signed-off-by Yang Xu <[email protected]>-----------------
v1-v2:
remove pid = 0 assignment, because it has been initialized as 0. add comment
Quoted 4 lines
Reviewed-by Petr Vorel <[email protected]>Note, waiting for merge before current git get's fixed. (v2 of https://patchwork.ozlabs.org/patch/1220180/).
Thanks for your patch, merged.
Kind regards,
Petr