On Wed, Mar 02, 2011 at 07:20:34PM -0800, Jesse Gross wrote:
> Fixes a number of minor elements in the IPv6 extraction and
> parsing code to better conform to kernel style.  Examples include
> using kernel types/functions, adding line breaks, and using
> unlikely() macros.  There is no functional change.
> 
> Signed-off-by: Jesse Gross <[email protected]>

I see some overparenthesization is still here, e.g.
        if (icmp->icmp6_code == 0 &&
            ((icmp->icmp6_type == NDISC_NEIGHBOUR_SOLICITATION) ||
             (icmp->icmp6_type == NDISC_NEIGHBOUR_ADVERTISEMENT))) {
could be reduced to:
        if (icmp->icmp6_code == 0 &&
            (icmp->icmp6_type == NDISC_NEIGHBOUR_SOLICITATION ||
             icmp->icmp6_type == NDISC_NEIGHBOUR_ADVERTISEMENT)) {
I find the latter easier to read but it's a judgment call of course.

As another example:
                        if (unlikely(!opt_len || (opt_len > icmp_len)))
could be:
                        if (unlikely(!opt_len || opt_len > icmp_len))

Here, I think that kernel style calls for && to be at end of line:
> +                                && opt_len == 8) {

Ditto here:
> +                         && swkey->tp_src != 
> htons(NDISC_NEIGHBOUR_ADVERTISEMENT))

Acked-by: Ben Pfaff <[email protected]>

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev_openvswitch.org

Reply via email to