Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: pingchao.yang@intel.com
Cc: qat-linux@intel.com, linux-crypto@vger.kernel.org
Subject: re: crypto: qat - add support for new devices to FW loader
Date: Fri, 11 Dec 2015 01:03:04 +0300	[thread overview]
Message-ID: <20151210220304.GB21797@mwanda> (raw)

Hello Pingchao Yang,

The patch b0272276d903: "crypto: qat - add support for new devices to
FW loader" from Dec 4, 2015, leads to the following static checker
warning:

	drivers/crypto/qat/qat_common/qat_hal.c:421 qat_hal_check_ae_active()
	warn: bitwise AND condition is false here

drivers/crypto/qat/qat_common/qat_hal.c
   414  int qat_hal_check_ae_active(struct icp_qat_fw_loader_handle *handle,
   415                              unsigned int ae)
   416  {
   417          unsigned int enable = 0, active = 0;
   418  
   419          qat_hal_rd_ae_csr(handle, ae, CTX_ENABLES, &enable);
   420          qat_hal_rd_ae_csr(handle, ae, ACTIVE_CTX_STATUS, &active);
   421          if ((enable & (0xff >> CE_ENABLE_BITPOS)) ||
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Never true.
CE_ENABLE_BITPOS is 8.
Perhaps the intention was to left shift like we do with ACS_ABO_BITPOS
on the next line?

   422              (active & (1 << ACS_ABO_BITPOS)))
   423                  return 1;
   424          else
   425                  return 0;
   426  }

regards,
dan carpenter

             reply	other threads:[~2015-12-10 22:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-10 22:03 Dan Carpenter [this message]
2015-12-11  2:00 ` crypto: qat - add support for new devices to FW loader Yang, Pingchao

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=20151210220304.GB21797@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=pingchao.yang@intel.com \
    --cc=qat-linux@intel.com \
    /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