Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756890AbbFQOTZ (ORCPT ); Wed, 17 Jun 2015 10:19:25 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:41905 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756642AbbFQOTN (ORCPT ); Wed, 17 Jun 2015 10:19:13 -0400 X-Sasl-enc: nkhcZE1DGbOJhfo6XdvVfEBw3wgJ47rRErzJExYG989h 1434550752 From: Sergei Zviagintsev To: Greg Kroah-Hartman , Daniel Mack , David Herrmann , Djalal Harouni Cc: Shuah Khan , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Sergei Zviagintsev Subject: [PATCH] selftests/kdbus: drop useless assignment Date: Wed, 17 Jun 2015 17:18:14 +0300 Message-Id: <1434550697-24785-2-git-send-email-sergei@s15v.net> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1081 Lines: 35 Assign returned file descriptor directly to `fd', without intermediate `ret' variable. Signed-off-by: Sergei Zviagintsev --- 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 a3e49b04f3a7..f9102264cfb9 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) { -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/