On Mon, May 28, 2018 at 05:10:28PM +0200, Petr Machata wrote:
>       /* Try switchdev op first. In case it is not supported, fallback to
>        * 8021q add.
>        */
> -     err = switchdev_port_obj_add(dev, &v.obj);
> +     int err = br_switchdev_port_vlan_add(dev, vid, flags);
>       if (err == -EOPNOTSUPP)

This will introduce a checkpatch warning if you re-run with the --file
option.  (I haven't tested).  It's sort of ugly to put function logic in
the declaration block.  That's really just for initializing variables
like "int start = 0; struct foo *p = parent_of_bar();"  Do it like this
instead:

        int err;

        err = br_switchdev_port_vlan_add(dev, vid, flags);
        if (err == -EOPNOTSUPP)

regards,
dan carpenter

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to