All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Gross <andy.gross@linaro.org>
To: linux-arm-msm@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>, Stephen Boyd <sboyd@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	mahesh sivasubramanian <msivasub@codeaurora.org>,
	Andy Gross <andy.gross@linaro.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] soc: qcom: cmd-db: Fix incorrect errno checks
Date: Mon, 25 Jun 2018 12:05:46 -0500	[thread overview]
Message-ID: <1529946347-12740-1-git-send-email-andy.gross@linaro.org> (raw)

This patch fixes a couple of checks for errno that should have been
checking for ret < 0.

Signed-off-by: Andy Gross <andy.gross@linaro.org>
---
 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);
-- 
2.7.4

WARNING: multiple messages have this Message-ID (diff)
From: andy.gross@linaro.org (Andy Gross)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] soc: qcom: cmd-db: Fix incorrect errno checks
Date: Mon, 25 Jun 2018 12:05:46 -0500	[thread overview]
Message-ID: <1529946347-12740-1-git-send-email-andy.gross@linaro.org> (raw)

This patch fixes a couple of checks for errno that should have been
checking for ret < 0.

Signed-off-by: Andy Gross <andy.gross@linaro.org>
---
 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);
-- 
2.7.4

             reply	other threads:[~2018-06-25 17:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-25 17:05 Andy Gross [this message]
2018-06-25 17:05 ` [PATCH 1/2] soc: qcom: cmd-db: Fix incorrect errno checks Andy Gross
2018-06-25 17:05 ` [PATCH 2/2] soc: qcom: cmd-db: Fix compiler warnings Andy Gross
2018-06-25 17:05   ` Andy Gross
2018-06-25 19:44   ` Andy Gross
2018-06-25 19:44     ` Andy Gross
2018-06-25 20:30   ` Arnd Bergmann
2018-06-25 20:30     ` Arnd Bergmann
2018-06-25 20:54     ` Andy Gross
2018-06-25 20:54       ` Andy Gross
2018-06-25 21:08       ` Arnd Bergmann
2018-06-25 21:08         ` Arnd Bergmann
2018-06-25 23:26         ` Bjorn Andersson
2018-06-25 23:26           ` Bjorn Andersson
2018-06-25 19:14 ` [PATCH 1/2] soc: qcom: cmd-db: Fix incorrect errno checks Bjorn Andersson
2018-06-25 19:14   ` Bjorn Andersson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1529946347-12740-1-git-send-email-andy.gross@linaro.org \
    --to=andy.gross@linaro.org \
    --cc=arnd@arndb.de \
    --cc=bjorn.andersson@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=msivasub@codeaurora.org \
    --cc=sboyd@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.