All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: re: firmware: qcom: scm: Add support for ARM64 SoCs
Date: Tue, 24 May 2016 08:30:07 +0000	[thread overview]
Message-ID: <20160524083007.GA23462@mwanda> (raw)

Hello Kumar Gala,

The patch 93a30f70d97e: "firmware: qcom: scm: Add support for ARM64
SoCs" from May 12, 2016, leads to the following static checker
warning:

	drivers/firmware/qcom_scm-64.c:154 qcom_scm_call()
	warn: unsigned 'desc->res.a0' is never less than zero.

drivers/firmware/qcom_scm-64.c
   127          do {
   128                  mutex_lock(&qcom_scm_lock);
   129  
   130                  cmd = ARM_SMCCC_CALL_VAL(ARM_SMCCC_STD_CALL,
   131                                           qcom_smccc_convention,
   132                                           ARM_SMCCC_OWNER_SIP, fn_id);
   133  
   134                  do {
   135                          arm_smccc_smc(cmd, desc->arginfo, desc->args[0],
   136                                        desc->args[1], desc->args[2], x5, 0, 0,
   137                                        &desc->res);
   138                  } while (desc->res.a0 = QCOM_SCM_INTERRUPTED);
   139  
   140                  mutex_unlock(&qcom_scm_lock);
   141  
   142                  if (desc->res.a0 = QCOM_SCM_V2_EBUSY) {
   143                          if (retry_count++ > QCOM_SCM_EBUSY_MAX_RETRY)
   144                                  break;
   145                          msleep(QCOM_SCM_EBUSY_WAIT_MS);
   146                  }
   147          }  while (desc->res.a0 = QCOM_SCM_V2_EBUSY);
   148  
   149          if (args_virt) {
   150                  dma_unmap_single(dev, args_phys, alloc_len, DMA_TO_DEVICE);
   151                  kfree(args_virt);
   152          }
   153  
   154          if (desc->res.a0 < 0)
                    ^^^^^^^^^^^^^^^^
This is never true.  It's an unsigned long now but probably it should be
changed to an int?

   155                  return qcom_scm_remap_error(desc->res.a0);
   156  
   157          return 0;
   158  }

regards,
dan carpenter

                 reply	other threads:[~2016-05-24  8:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20160524083007.GA23462@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.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.