On Mon, 25 Mar 2019 17:03:22 +0000
Viacheslav Ovsiienko <viachesl...@mellanox.com> wrote:

> +     if (switch_id_set) {
> +             if (info.port_name_new) {
> +                     /* New representors naming schema. */
> +                     if (port_name_set) {
> +                             info.master = (info.port_name == -1);
> +                             info.representor = (info.port_name != -1);
> +                     }
> +             } else {
> +                     /* Legacy representors naming schema. */
> +                     info.master = (!port_name_set || num_vf_set);
> +                     info.representor = port_name_set && !num_vf_set;
> +             }
> +     }
> +     assert(!(data.master && data.representor));
>       memcpy(arg, &info, sizeof(info));
>       return 0;

Since assert() is often removed in non-debug envirionments, why
not add a log message and return an error instead?

Reply via email to