kernel/selftests-kdbus-drop-useless-assignment.patch
2015-07-08 10:30:06 -04:00

34 lines
1.1 KiB
Diff

From: Sergei Zviagintsev <sergei@s15v.net>
Date: Wed, 17 Jun 2015 19:33:25 +0300
Subject: [PATCH] selftests/kdbus: drop useless assignment
Assign returned file descriptor directly to `fd', without intermediate
`ret' variable.
Signed-off-by: Sergei Zviagintsev <sergei@s15v.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/testing/selftests/kdbus/kdbus-util.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/kdbus/kdbus-util.c b/tools/testing/selftests/kdbus/kdbus-util.c
index 6909fb9b1ce5..5b924531d938 100644
--- a/tools/testing/selftests/kdbus/kdbus-util.c
+++ b/tools/testing/selftests/kdbus/kdbus-util.c
@@ -408,11 +408,9 @@ int sys_memfd_create(const char *name, __u64 size)
{
int ret, fd;
- ret = syscall(__NR_memfd_create, name, MFD_ALLOW_SEALING);
- if (ret < 0)
- return ret;
-
- fd = ret;
+ fd = syscall(__NR_memfd_create, name, MFD_ALLOW_SEALING);
+ if (fd < 0)
+ return fd;
ret = ftruncate(fd, size);
if (ret < 0) {