Re: [patch -next] bonding: bond_get_size() returns wrong size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2013-11-01 at 11:41 +0100, Veaceslav Falico wrote:
> On Fri, Nov 01, 2013 at 01:18:44PM +0300, Dan Carpenter wrote:
> >There is an extra semi-colon so bond_get_size() doesn't return the
> >correct value.
> >
> >Fixes: ec76aa49855f ('bonding: add Netlink support active_slave option')
> >Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> 
> Hrm, how does it even build. Good catch, thanks.
> 
> Acked-by: Veaceslav Falico <vfalico@xxxxxxxxxx>

Yep, an alternative is to use following format :

static inline size_t br_port_info_size(void)
{
        return nla_total_size(1)        /* IFLA_BRPORT_STATE  */
                + nla_total_size(2)     /* IFLA_BRPORT_PRIORITY */
                + nla_total_size(4)     /* IFLA_BRPORT_COST */
                + nla_total_size(1)     /* IFLA_BRPORT_MODE */
                + nla_total_size(1)     /* IFLA_BRPORT_GUARD */
                + nla_total_size(1)     /* IFLA_BRPORT_PROTECT */
                + nla_total_size(1)     /* IFLA_BRPORT_FAST_LEAVE */
                + nla_total_size(1)     /* IFLA_BRPORT_LEARNING */
                + nla_total_size(1)     /* IFLA_BRPORT_UNICAST_FLOOD */
                + 0;
}

So that a patch adding a new attribute doesn't have to change the 'last
line'

 

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux