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: 10486985 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 104DF6023A for ; Mon, 25 Jun 2018 17:06:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03EFF28501 for ; Mon, 25 Jun 2018 17:06:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECC912857F; Mon, 25 Jun 2018 17:06:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 990D928501 for ; Mon, 25 Jun 2018 17:06:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934327AbeFYRGD (ORCPT ); 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-Google-Smtp-Source: ADUXVKLvANAmIp7OxYcC++rFcq7UHAodMMWsufyUq/lj4aU+y1EYvfkg8t8I0R2MiVJYNGEd/KERdQ== 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 X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes a couple of checks for errno that should have been checking for ret < 0. Signed-off-by: Andy Gross Reviewed-by: Bjorn Andersson --- drivers/soc/qcom/cmd-db.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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);