public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/2] soc: qcom: cmd-db: Fix incorrect errno checks
@ 2018-06-25 17:05 Andy Gross
  2018-06-25 17:05 ` [PATCH 2/2] soc: qcom: cmd-db: Fix compiler warnings Andy Gross
  2018-06-25 19:14 ` [PATCH 1/2] soc: qcom: cmd-db: Fix incorrect errno checks Bjorn Andersson
  0 siblings, 2 replies; 8+ messages in thread
From: Andy Gross @ 2018-06-25 17:05 UTC (permalink / raw)
  To: linux-arm-kernel

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-06-25 23:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 19:44   ` Andy Gross
2018-06-25 20:30   ` Arnd Bergmann
2018-06-25 20:54     ` Andy Gross
2018-06-25 21:08       ` Arnd Bergmann
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox