Skip to contentSkip to conversation

Remove an unnecessary check on socket restart

PATCH In review Dan Smith 3 participants 3 messages Oct 1, 2009 1 message not in the archive Networking

lore
Share & tools
lore

Dan Smith

author
#0 lore raw

PATCH 1/1 Remove an unnecessary check on socket restart

This check is removed because it cannot be true because of the unsigned nature of the value being examined.

---
 net/checkpoint.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
net/checkpoint.c +1 -2
index a11ec7a..0087a8a 100644
@@ -484,8 +484,7 @@ static int sock_cptrst(struct ckpt_ctx *ctx, struct sock *sk,
 		   (h->sock.state >= TCP_MAX_STATES)) {
 		ckpt_debug("sock in invalid state: %i", h->sock.state);
 		return -EINVAL;
-	} else if ((h->socket.state < SS_FREE) ||
-		   (h->socket.state > SS_DISCONNECTING)) {
+	} else if (h->socket.state > SS_DISCONNECTING) {
 		ckpt_debug("socket in invalid state: %i",
 			   h->socket.state);
 		return -EINVAL;
Signature · 1 line
1.6.0.4

A message that is not in the archive (sent off-list or not yet received): 1254434651-6540-1-git-send-email-danms-r/[email protected]

#2 lore raw
Quoted 4 lines · Dan Smith

This check is removed because it cannot be true because of the unsigned nature of the value being examined.

Thanks. I actually do keep missing real errors bc of the noise (most of which comes from cred.h :( ), so I appreciate every bit they can be reduced.

Quoted 22 lines
---
 net/checkpoint.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
net/checkpoint.c +1 -2
index a11ec7a..0087a8a 100644
@@ -484,8 +484,7 @@ static int sock_cptrst(struct ckpt_ctx *ctx, struct sock *sk,
 		   (h->sock.state >= TCP_MAX_STATES)) {
 		ckpt_debug("sock in invalid state: %i", h->sock.state);
 		return -EINVAL;
-	} else if ((h->socket.state < SS_FREE) ||
-		   (h->socket.state > SS_DISCONNECTING)) {
+	} else if (h->socket.state > SS_DISCONNECTING) {
 		ckpt_debug("socket in invalid state: %i",
 			   h->socket.state);
 		return -EINVAL;
Signature · 1 line
1.6.0.4
#3 lore raw
In reply to a message not in the archive

To appear in ckpt-v18-dev, thanks.

Quoted 24 lines · Dan Smith

This check is removed because it cannot be true because of the unsigned nature of the value being examined.

---
 net/checkpoint.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
net/checkpoint.c +1 -2
index a11ec7a..0087a8a 100644
@@ -484,8 +484,7 @@ static int sock_cptrst(struct ckpt_ctx *ctx, struct sock *sk,
 		   (h->sock.state >= TCP_MAX_STATES)) {
 		ckpt_debug("sock in invalid state: %i", h->sock.state);
 		return -EINVAL;
-	} else if ((h->socket.state < SS_FREE) ||
-		   (h->socket.state > SS_DISCONNECTING)) {
+	} else if (h->socket.state > SS_DISCONNECTING) {
 		ckpt_debug("socket in invalid state: %i",
 			   h->socket.state);
 		return -EINVAL;