OSDN Git Service

crypto: cavium - cpt_bind_vq_to_grp could return an error code
authorGeorge Cherian <george.cherian@cavium.com>
Tue, 14 Feb 2017 09:23:17 +0000 (09:23 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 15 Feb 2017 05:23:50 +0000 (13:23 +0800)
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>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/cavium/cpt/cptpf_mbox.c

index 5818b41..20f2c6e 100644 (file)
@@ -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