The offsetof(struct ovs_router_entry, cr) should always be 0, thus the else statement should never be reached.
Signed-off-by: William Tu <[email protected]> --- lib/ovs-router.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/ovs-router.c b/lib/ovs-router.c index cd2ab15fb003..c68bb3bc9500 100644 --- a/lib/ovs-router.c +++ b/lib/ovs-router.c @@ -68,11 +68,7 @@ struct ovs_router_entry { static struct ovs_router_entry * ovs_router_entry_cast(const struct cls_rule *cr) { - if (offsetof(struct ovs_router_entry, cr) == 0) { - return CONTAINER_OF(cr, struct ovs_router_entry, cr); - } else { - return cr ? CONTAINER_OF(cr, struct ovs_router_entry, cr) : NULL; - } + return cr ? CONTAINER_OF(cr, struct ovs_router_entry, cr) : NULL; } static bool -- 2.7.4 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
