net: mctp: remove redundant RTN_UNICAST check
authorLin Ma <linma@zju.edu.cn>
Thu, 15 Jun 2023 15:22:40 +0000 (23:22 +0800)
committerJakub Kicinski <kuba@kernel.org>
Sat, 17 Jun 2023 07:25:24 +0000 (00:25 -0700)
commitf60ce8a48b97eb970bfbec1f26c914b9017c4a46
tree02c1afbe6a61c19896968194c68ee34e4dbefecd
parent6907217a8054b8afc47b3944afc7d77ad5caf824
net: mctp: remove redundant RTN_UNICAST check

Current mctp_newroute() contains two exactly same check against
rtm->rtm_type

static int mctp_newroute(...)
{
...
    if (rtm->rtm_type != RTN_UNICAST) { // (1)
        NL_SET_ERR_MSG(extack, "rtm_type must be RTN_UNICAST");
        return -EINVAL;
    }
...
    if (rtm->rtm_type != RTN_UNICAST) // (2)
        return -EINVAL;
...
}

This commits removes the (2) check as it is redundant.

Signed-off-by: Lin Ma <linma@zju.edu.cn>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Acked-by: Jeremy Kerr <jk@codeconstruct.com.au>
Link: https://lore.kernel.org/r/20230615152240.1749428-1-linma@zju.edu.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mctp/route.c