All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: lustre: Replace sscanf with kstrtoint
@ 2015-10-18 13:02 Cristina Moraru
  2015-10-18 16:51 ` [Outreachy kernel] " Daniel Baluta
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Cristina Moraru @ 2015-10-18 13:02 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Cristina Moraru

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: Cristina Moraru <cristina.moraru09@gmail.com>
---
 drivers/staging/lustre/lustre/lov/lov_obd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c
index c3be0b5..725bcf6 100644
--- a/drivers/staging/lustre/lustre/lov/lov_obd.c
+++ b/drivers/staging/lustre/lustre/lov/lov_obd.c
@@ -914,11 +914,11 @@ int lov_process_config_base(struct obd_device *obd, struct lustre_cfg *lcfg,
 
 		obd_str2uuid(&obd_uuid,  lustre_cfg_buf(lcfg, 1));
 
-		if (sscanf(lustre_cfg_buf(lcfg, 2), "%d", indexp) != 1) {
+		if (kstrtoint(lustre_cfg_buf(lcfg, 2), 10, indexp)) {
 			rc = -EINVAL;
 			goto out;
 		}
-		if (sscanf(lustre_cfg_buf(lcfg, 3), "%d", genp) != 1) {
+		if (kstrtoint(lustre_cfg_buf(lcfg, 3), 10, genp)) {
 			rc = -EINVAL;
 			goto out;
 		}
-- 
1.9.1



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

end of thread, other threads:[~2015-10-26 22:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-18 13:02 [PATCH] staging: lustre: Replace sscanf with kstrtoint Cristina Moraru
2015-10-18 16:51 ` [Outreachy kernel] " Daniel Baluta
2015-10-18 21:41 ` [PATCH v2] " Cristina Moraru
2015-10-19  5:26   ` [Outreachy kernel] " Julia Lawall
2015-10-19 20:48 ` [PATCH v3] " Cristina Moraru
2015-10-25  1:40   ` [Outreachy kernel] " Greg KH
2015-10-26 22:30 ` Cristina Moraru

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.