Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932382AbcDDNb7 (ORCPT ); Mon, 4 Apr 2016 09:31:59 -0400 Received: from mga04.intel.com ([192.55.52.120]:43254 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755386AbcDDNaU (ORCPT ); Mon, 4 Apr 2016 09:30:20 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,440,1455004800"; d="scan'208";a="777711599" From: Andy Shevchenko To: Arnd Bergmann , "Theodore Ts'o" , Matt Fleming , Andrew Morton , Rasmus Villemoes , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, linux-api@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v2 5/8] sysctl: drop away useless label Date: Mon, 4 Apr 2016 16:30:07 +0300 Message-Id: <1459776610-68469-6-git-send-email-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.8.0.rc3 In-Reply-To: <1459776610-68469-1-git-send-email-andriy.shevchenko@linux.intel.com> References: <1459776610-68469-1-git-send-email-andriy.shevchenko@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1237 Lines: 50 We have no locking in bin_uuid(). Thus, we may remove the out label and use return statements directly. Signed-off-by: Andy Shevchenko --- kernel/sysctl_binary.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/kernel/sysctl_binary.c b/kernel/sysctl_binary.c index 10a1d7d..055ad65 100644 --- a/kernel/sysctl_binary.c +++ b/kernel/sysctl_binary.c @@ -1123,15 +1123,14 @@ static ssize_t bin_uuid(struct file *file, result = kernel_read(file, 0, buf, sizeof(buf) - 1); if (result < 0) - goto out; + return result; buf[result] = '\0'; /* Convert the uuid to from a string to binary */ for (i = 0; i < 16; i++) { - result = -EIO; if (!isxdigit(str[0]) || !isxdigit(str[1])) - goto out; + return -EIO; uuid[i] = (hex_to_bin(str[0]) << 4) | hex_to_bin(str[1]); @@ -1143,15 +1142,12 @@ static ssize_t bin_uuid(struct file *file, if (oldlen > 16) oldlen = 16; - result = -EFAULT; if (copy_to_user(oldval, uuid, oldlen)) - goto out; + return -EFAULT; copied = oldlen; } - result = copied; -out: - return result; + return copied; } static ssize_t bin_dn_node_address(struct file *file, -- 2.8.0.rc3