diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index e3e26d358c7f..563b00481866 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -3330,7 +3330,7 @@ int tc_setup_cb_add(struct tcf_block *block, struct tcf_proto *tp, up_read(&block->cb_lock); if (take_rtnl) rtnl_unlock(); - return ok_count < 0 ? ok_count : 0; + return min(ok_count, 0); } EXPORT_SYMBOL(tc_setup_cb_add); @@ -3386,7 +3386,7 @@ int tc_setup_cb_replace(struct tcf_block *block, struct tcf_proto *tp, up_read(&block->cb_lock); if (take_rtnl) rtnl_unlock(); - return ok_count < 0 ? ok_count : 0; + return min(ok_count, 0); } EXPORT_SYMBOL(tc_setup_cb_replace); @@ -3424,7 +3424,7 @@ int tc_setup_cb_destroy(struct tcf_block *block, struct tcf_proto *tp, up_read(&block->cb_lock); if (take_rtnl) rtnl_unlock(); - return ok_count < 0 ? ok_count : 0; + return min(ok_count, 0); } EXPORT_SYMBOL(tc_setup_cb_destroy);