Commit 70003e65 authored by Cristina Moraru's avatar Cristina Moraru Committed by Greg Kroah-Hartman

staging: lustre: Replace sscanf with kstrtoint

Replace single variable sscanf with specialized function
kstrtoint at the suggestion of checkpatch.pl, to fix
'WARNING: Prefer kstrto<type> to single variable sscanf'
Signed-off-by: default avatarCristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 242b5325
...@@ -914,14 +914,12 @@ int lov_process_config_base(struct obd_device *obd, struct lustre_cfg *lcfg, ...@@ -914,14 +914,12 @@ int lov_process_config_base(struct obd_device *obd, struct lustre_cfg *lcfg,
obd_str2uuid(&obd_uuid, lustre_cfg_buf(lcfg, 1)); obd_str2uuid(&obd_uuid, lustre_cfg_buf(lcfg, 1));
if (sscanf(lustre_cfg_buf(lcfg, 2), "%d", indexp) != 1) { rc = kstrtoint(lustre_cfg_buf(lcfg, 2), 10, indexp);
rc = -EINVAL; if (rc < 0)
goto out; goto out;
} rc = kstrtoint(lustre_cfg_buf(lcfg, 3), 10, genp);
if (sscanf(lustre_cfg_buf(lcfg, 3), "%d", genp) != 1) { if (rc < 0)
rc = -EINVAL;
goto out; goto out;
}
index = *indexp; index = *indexp;
gen = *genp; gen = *genp;
if (cmd == LCFG_LOV_ADD_OBD) if (cmd == LCFG_LOV_ADD_OBD)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment