linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers: crypto: cpt: cpt_bind_vq_to_grp could return an error code
@ 2017-02-14  9:23 George Cherian
  2017-02-15  5:35 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: George Cherian @ 2017-02-14  9:23 UTC (permalink / raw)
  To: herbert, davem, dan.carpenter; +Cc: linux-kernel, linux-crypto, George Cherian

cpt_bind_vq_to_grp() could return an error code. However, it currently
returns a u8. This produce the static checker warning.

drivers/crypto/cavium/cpt/cptpf_mbox.c:70 cpt_bind_vq_to_grp() warn: signedness bug returning '(-22)'

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: George Cherian <george.cherian@cavium.com>
---
 drivers/crypto/cavium/cpt/cptpf_mbox.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/cavium/cpt/cptpf_mbox.c b/drivers/crypto/cavium/cpt/cptpf_mbox.c
index 5818b41..20f2c6e 100644
--- a/drivers/crypto/cavium/cpt/cptpf_mbox.c
+++ b/drivers/crypto/cavium/cpt/cptpf_mbox.c
@@ -59,7 +59,7 @@ static void cpt_cfg_vq_priority(struct cpt_device *cpt, int vf, u32 pri)
 	cpt_write_csr64(cpt->reg_base, CPTX_PF_QX_CTL(0, vf), pf_qx_ctl.u);
 }
 
-static u8 cpt_bind_vq_to_grp(struct cpt_device *cpt, u8 q, u8 grp)
+static int cpt_bind_vq_to_grp(struct cpt_device *cpt, u8 q, u8 grp)
 {
 	struct microcode *mcode = cpt->mcode;
 	union cptx_pf_qx_ctl pf_qx_ctl;
@@ -90,7 +90,7 @@ static void cpt_handle_mbox_intr(struct cpt_device *cpt, int vf)
 {
 	struct cpt_vf_info *vfx = &cpt->vfinfo[vf];
 	struct cpt_mbox mbx = {};
-	u8 vftype;
+	int vftype;
 	struct device *dev = &cpt->pdev->dev;
 	/*
 	 * MBOX[0] contains msg
-- 
2.1.4

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

* Re: [PATCH] drivers: crypto: cpt: cpt_bind_vq_to_grp could return an error code
  2017-02-14  9:23 [PATCH] drivers: crypto: cpt: cpt_bind_vq_to_grp could return an error code George Cherian
@ 2017-02-15  5:35 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2017-02-15  5:35 UTC (permalink / raw)
  To: George Cherian; +Cc: davem, dan.carpenter, linux-kernel, linux-crypto

On Tue, Feb 14, 2017 at 09:23:17AM +0000, George Cherian wrote:
> cpt_bind_vq_to_grp() could return an error code. However, it currently
> returns a u8. This produce the static checker warning.
> 
> drivers/crypto/cavium/cpt/cptpf_mbox.c:70 cpt_bind_vq_to_grp() warn: signedness bug returning '(-22)'
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: George Cherian <george.cherian@cavium.com>

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

end of thread, other threads:[~2017-02-15  5:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-14  9:23 [PATCH] drivers: crypto: cpt: cpt_bind_vq_to_grp could return an error code George Cherian
2017-02-15  5:35 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).