From patchwork Mon Jun 25 17:05:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Gross X-Patchwork-Id: 139867 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp4226803lji; Mon, 25 Jun 2018 10:06:06 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL0ygcemNxdXWWEtTeDsLN4gfmMXVsL8AqXmbhYHcTHVbvrCPWA2+BSS3TCoQcT6QOs2MxQ X-Received: by 2002:a62:ec48:: with SMTP id k69-v6mr5400686pfh.85.1529946366295; Mon, 25 Jun 2018 10:06:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529946366; cv=none; d=google.com; s=arc-20160816; b=sXKwXzvqodsyOw60GG9nD0Ze97PoI7M1bDKmRW40Wp0Vwi3GfsoIy9WTudq7exz5I/ aa4KgPdUw6PW+nCPQbDc7lBjKL6Pl1OOSUsn8paM4psXdu9a86wnAYUToys9Oquyl5IO VoeUm5zMdbhE8pEw50z2X2Sa+POO1a/niO2UkDSp0c1B5rT4Fyw6uvJ0pER2+uofSLl2 N726vzFMdYcSurEM6rPEfO/rVwXkFkfoo2UKuafhK5+jhdRC5rbbDWACDch1c+c+uC6W r+tGrHbadJCUaN538JEEFJZRe4KgF6i7W1nonILSip69gSPWTfY3Dp4e/Ts2FIijnfYP i6Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=zz1Gd0CJ4dL0OpWOWcWIhFE9lqiROnFWeFHNhL0fAbs=; b=M6wPmfwE/DcmFYzSkQvZvwWJ5w18vMdymO3c7SU3GVkXfWrBl+/lh/vWBXDAfeY81w x6tX+MEtZOFyhu9iU782YQfkwX0cBlYoIKrS/CmEsyeW9zxC2TRJwU1KNnAmV+2Z/cea CU58TzqwUkkCNbDBEys5NhUmUBQUqfMV3H8A/94tSkbN8KgH72oDIwDi13pXmsGtzPOy VMn2XPpg3k48MVNeiG9OLDH3jDLyaU1ucGw1K3M1ikkEqDji4NWug+VzNgsbGw4X7y7B UXngKNt9MBSo/Rq0ufmSZS2omC8SPZPAHWXXiE0Q/x0QwHJUEvxgaMJf1GG8q/xiIhdx 2Zgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CVLGxjuu; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q13-v6si14986400plr.220.2018.06.25.10.06.05; Mon, 25 Jun 2018 10:06:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CVLGxjuu; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934327AbeFYRGD (ORCPT + 13 others); Mon, 25 Jun 2018 13:06:03 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:37824 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933724AbeFYRGC (ORCPT ); Mon, 25 Jun 2018 13:06:02 -0400 Received: by mail-oi0-f65.google.com with SMTP id l22-v6so13193093oib.4 for ; Mon, 25 Jun 2018 10:06:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=vS/Rkz1ezzwRYGtrUcXOFOjNKWKGX/LOIhUbBcIy8+8=; b=CVLGxjuucFstKOluLBUxaFh3LeGlKWpheoF7AR9yutlieIBI33iBrKil03Z4JamNuV 0UdumWkoESoKpTAr0fYSwYKEJWN3yZklAX7bB0RxocPzPCWfN1MnEX+199KLyCj3MppQ ENfnJLuAw+hW4IiOmob2DxlsxPOjQ0Z6xtjRU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=vS/Rkz1ezzwRYGtrUcXOFOjNKWKGX/LOIhUbBcIy8+8=; b=sZ6Cp7keN+RsESwEAik3+dyieF/u4M+9sW1TtGvhbVb3w7DuT3JHVzygs9dgeUkugi dSDZkyLfuXNaWMF7IhUqf5dQVkbJV/Uz0UN2oD9Jz7TYtoaNRVS6HXRrcBKY1ny4Q7Ol Od4W5QeflHjkjFrR+62HxpbPeq5HjbFd0iMvU1GQbmx2xlQCsFCnyLF1mAdyrela7Z2p 9qjS+Rvu3pLkPkZ9Jwu4wnojBksSQXlH6iJAJJlKhsiWgFKnwkg0nFLEQddN9AG40mi6 RBNDQKAupbmmutWT61Xv3V47yDOsTAnP5Jd2YoE0JdzsXZfPWbcLTIeWVv8HPO0Pl0BZ Q3zw== X-Gm-Message-State: APt69E3RzmSyYl9kb0zBflUCxFFZXUUgoqVVHY4In6O3mbjzC8ZbJ7E9 q10aXEx3JjDSeMbY1Sa42DpZrszjV5U= X-Received: by 2002:aca:dd83:: with SMTP id u125-v6mr7692575oig.39.1529946360930; Mon, 25 Jun 2018 10:06:00 -0700 (PDT) Received: from localhost ([2600:1700:141:4960:88f5:ab30:e569:4ad6]) by smtp.gmail.com with ESMTPSA id t204-v6sm8333778oig.24.2018.06.25.10.05.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 10:05:59 -0700 (PDT) From: Andy Gross To: linux-arm-msm@vger.kernel.org Cc: Bjorn Andersson , mahesh sivasubramanian , Linus Torvalds , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, Stephen Boyd , Andy Gross Subject: [PATCH 1/2] soc: qcom: cmd-db: Fix incorrect errno checks Date: Mon, 25 Jun 2018 12:05:46 -0500 Message-Id: <1529946347-12740-1-git-send-email-andy.gross@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This patch fixes a couple of checks for errno that should have been checking for ret < 0. Signed-off-by: Andy Gross --- drivers/soc/qcom/cmd-db.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Bjorn Andersson diff --git a/drivers/soc/qcom/cmd-db.c b/drivers/soc/qcom/cmd-db.c index a6f6462..deb2b90 100644 --- a/drivers/soc/qcom/cmd-db.c +++ b/drivers/soc/qcom/cmd-db.c @@ -121,7 +121,7 @@ rsc_offset(struct rsc_hdr *hdr, struct entry_header *ent) /** * cmd_db_ready - Indicates if command DB is available * - * Return: 0 on success, errno otherwise + * Return: 0 on success, -errno otherwise */ int cmd_db_ready(void) { @@ -143,7 +143,7 @@ static int cmd_db_get_header(const char *id, struct entry_header *eh, u8 query[8]; ret = cmd_db_ready(); - if (ret) + if (ret < 0) return ret; if (!eh || !rh) @@ -202,7 +202,7 @@ EXPORT_SYMBOL(cmd_db_read_addr); * @data: Data buffer to copy returned aux data to. Returns size on NULL * @len: Caller provides size of data buffer passed in. * - * Return: size of data on success, errno otherwise + * Return: size of data on success, -errno otherwise */ int cmd_db_read_aux_data(const char *id, u8 *data, size_t len) { @@ -215,7 +215,7 @@ int cmd_db_read_aux_data(const char *id, u8 *data, size_t len) return -EINVAL; ret = cmd_db_get_header(id, &ent, &rsc_hdr); - if (ret) + if (ret < 0) return ret; ent_len = le16_to_cpu(ent.len);