public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: bjorn.andersson@linaro.org (Bjorn Andersson)
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:14:53 -0700	[thread overview]
Message-ID: <20180625191453.GB1860@tuxbook-pro> (raw)
In-Reply-To: <1529946347-12740-1-git-send-email-andy.gross@linaro.org>

On Mon 25 Jun 10:05 PDT 2018, Andy Gross wrote:

> 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>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> ---
>  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
> 

      parent reply	other threads:[~2018-06-25 19:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Bjorn Andersson [this message]

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=20180625191453.GB1860@tuxbook-pro \
    --to=bjorn.andersson@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox