[ovs-dev] [PATCH] Remove unnecessary memset().
Jarno Rajahalme
jrajahalme at nicira.com
Tue Dec 17 18:43:11 UTC 2013
We already set all the fields of the upcall, so memsetting right before
is unnecessary.
Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
---
lib/dpif-linux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c
index 8fa42a9..9e901be 100644
--- a/lib/dpif-linux.c
+++ b/lib/dpif-linux.c
@@ -1459,7 +1459,7 @@ parse_odp_packet(struct ofpbuf *buf, struct dpif_upcall *upcall,
return EINVAL;
}
- memset(upcall, 0, sizeof *upcall);
+ /* (Re)set ALL fields of '*upcall' on successful return. */
upcall->type = type;
upcall->key = CONST_CAST(struct nlattr *,
nl_attr_get(a[OVS_PACKET_ATTR_KEY]));
--
1.7.10.4
More information about the dev
mailing list