staging: lustre: lmv: change type of lmv_obd->tgts_size to u32
authorDmitry Eremin <dmitry.eremin@intel.com>
Sun, 18 Sep 2016 20:37:42 +0000 (16:37 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Sep 2016 07:40:36 +0000 (09:40 +0200)
tgts_size is used as unsigned.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5577
Reviewed-on: http://review.whamcloud.com/11881
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/include/obd.h
drivers/staging/lustre/lustre/lmv/lmv_obd.c

index 4b72fb9ebf591a81984f8362041ecc784cd18aaf..27fb4d7b85af7d2ea53583d1011734bbfac85980 100644 (file)
@@ -435,7 +435,7 @@ struct lmv_obd {
        int                     max_def_cookiesize;
        int                     server_timeout;
 
-       int                     tgts_size; /* size of tgts array */
+       u32                     tgts_size; /* size of tgts array */
        struct lmv_tgt_desc     **tgts;
 
        struct obd_connect_data conn_data;
index e1428cbf9d7a97b45fb43e35c58b9314fb159249..8d9e3b811dddcdc0b03aafc7a960e02e87ffdb7f 100644 (file)
@@ -1353,10 +1353,10 @@ static int lmv_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
                return -EINVAL;
        }
 
-       lmv->tgts = kcalloc(32, sizeof(*lmv->tgts), GFP_NOFS);
+       lmv->tgts_size = 32U;
+       lmv->tgts = kcalloc(lmv->tgts_size, sizeof(*lmv->tgts), GFP_NOFS);
        if (!lmv->tgts)
                return -ENOMEM;
-       lmv->tgts_size = 32;
 
        obd_str2uuid(&lmv->desc.ld_uuid, desc->ld_uuid.uuid);
        lmv->desc.ld_tgt_count = 0;