Skip to contentSkip to conversation

target: fixup error message in target_tg_pt_gp_tg_pt_gp_id_store()

PATCH Hannes Reinecke 2 participants 2 messages Apr 27, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

When setting up an ALUA target port group with an invalid ID the error message

kstrtoul() returned -22 for tg_pt_gp_id

is displayed, which is not really helpful.
Convert it to something sane.

---
 drivers/target/target_core_configfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/target/target_core_configfs.c +2 -2
index 1f229cc..27f7411 100644
@@ -2691,8 +2691,8 @@ static ssize_t target_tg_pt_gp_tg_pt_gp_id_store(struct config_item *item,
 
 	ret = kstrtoul(page, 0, &tg_pt_gp_id);
 	if (ret < 0) {
-		pr_err("kstrtoul() returned %d for"
-			" tg_pt_gp_id\n", ret);
+		pr_err("ALUA tg_pt_gp_id: invalid value '%s' for"
+			" tg_pt_gp_id\n", page);
 		return ret;
 	}
 	if (tg_pt_gp_id > 0x0000ffff) {
Signature · 1 line
1.8.5.6
#1 lore raw
Quoted 9 lines · Hannes Reinecke

When setting up an ALUA target port group with an invalid ID the error message

kstrtoul() returned -22 for tg_pt_gp_id

is displayed, which is not really helpful.
Convert it to something sane.

Did you perhaps mean "Signed-off-by"?

Quoted 8 lines
 drivers/target/target_core_configfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/target/target_core_configfs.c +0 -0
index 1f229cc..27f7411 100644

drivers/target/target_core_configfs.c static ssize_t target_tg_pt_gp_tg_pt_gp_id_store(struct config_item *item, · line 2698

Quoted 10 lines
drivers/target/target_core_configfs.c +2 -2
@@ -2691,8 +2691,8 @@ static ssize_t target_tg_pt_gp_tg_pt_gp_id_store(struct config_item *item,
 
 	ret = kstrtoul(page, 0, &tg_pt_gp_id);
 	if (ret < 0) {
-		pr_err("kstrtoul() returned %d for"
-			" tg_pt_gp_id\n", ret);
+		pr_err("ALUA tg_pt_gp_id: invalid value '%s' for"
+			" tg_pt_gp_id\n", page);
 		return ret;
 	}
 	if (tg_pt_gp_id > 0x0000ffff) {

Although this patch looks fine to me, this would have been a good opportunity to join the two parts of the error message such that these appear on the same source code line.

Bart.