Skip to contentSkip to conversation

staging: luster: lnet: return of an errno should be negative.

PATCH In review Rakhi Sharma 2 participants 2 messages Feb 22, 2016 – Feb 23, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: luster: lnet: return of an errno should be negative.

Return of an errno should typically be negative (ie: return -ENOENT) , as warning is generated by checkpatch.

---
 drivers/staging/lustre/lnet/lnet/lib-move.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/lustre/lnet/lnet/lib-move.c +2 -2
index fb8f7be0..018949b 100644
@@ -1521,7 +1521,7 @@ lnet_parse_reply(lnet_ni_t *ni, lnet_msg_t *msg)
 			       md->md_me->me_portal);
 
 		lnet_res_unlock(cpt);
-		return ENOENT;		  /* +ve: OK but no match */
+		return -ENOENT;		  /* +ve: OK but no match */
 	}
 
 	LASSERT(md->md_offset == 0);
@@ -1536,7 +1536,7 @@ lnet_parse_reply(lnet_ni_t *ni, lnet_msg_t *msg)
 			rlength, hdr->msg.reply.dst_wmd.wh_object_cookie,
 			mlength);
 		lnet_res_unlock(cpt);
-		return ENOENT;	  /* +ve: OK but no match */
+		return -ENOENT;	  /* +ve: OK but no match */
 	}
 
 	CDEBUG(D_NET, "%s: Reply from %s of length %d/%d into md %#llx\n",
Signature · 1 line
1.9.1
#1 lore raw
Quoted 2 lines · Rakhi Sharma

Return of an errno should typically be negative (ie: return -ENOENT) , as warning is generated by checkpatch.

The comma should be on the line before.

Are you sure that that calling context is able to cope with a negative value? You commit message should explain why this is so.

julia

Quoted 38 lines
---
 drivers/staging/lustre/lnet/lnet/lib-move.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/lustre/lnet/lnet/lib-move.c +2 -2
index fb8f7be0..018949b 100644
@@ -1521,7 +1521,7 @@ lnet_parse_reply(lnet_ni_t *ni, lnet_msg_t *msg)
 			       md->md_me->me_portal);
 
 		lnet_res_unlock(cpt);
-		return ENOENT;		  /* +ve: OK but no match */
+		return -ENOENT;		  /* +ve: OK but no match */
 	}
 
 	LASSERT(md->md_offset == 0);
@@ -1536,7 +1536,7 @@ lnet_parse_reply(lnet_ni_t *ni, lnet_msg_t *msg)
 			rlength, hdr->msg.reply.dst_wmd.wh_object_cookie,
 			mlength);
 		lnet_res_unlock(cpt);
-		return ENOENT;	  /* +ve: OK but no match */
+		return -ENOENT;	  /* +ve: OK but no match */
 	}
 
 	CDEBUG(D_NET, "%s: Reply from %s of length %d/%d into md %#llx\n",
Signature · 8 lines
1.9.1

-- 
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1456157506-6590-1-git-send-email-rakhish1994%40gmail.com.
For more options, visit https://groups.google.com/d/optout.