[OpenWrt-Devel] [PATCH] generic: several linux-4.0 fixes

Rafał Miłecki zajec5 at gmail.com
Wed Feb 25 05:27:30 EST 2015


On 25 February 2015 at 11:00, Felix Fietkau <nbd at openwrt.org> wrote:
> On 2015-02-25 06:07, Rafał Miłecki wrote:
>> On 24 February 2015 at 16:29, Álvaro Fernández Rojas <noltari at gmail.com> wrote:
>>> --- a/target/linux/generic/files/drivers/net/phy/swconfig.c
>>> +++ b/target/linux/generic/files/drivers/net/phy/swconfig.c
>>> @@ -396,7 +396,12 @@ swconfig_dump_attr(struct swconfig_callback *cb, void *arg)
>>>                         op->description))
>>>                         goto nla_put_failure;
>>>
>>> +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0))
>>>         return genlmsg_end(msg, hdr);
>>> +#else
>>> +       genlmsg_end(msg, hdr);
>>> +       return msg->len;
>>> +#endif
>>>  nla_put_failure:
>>>         genlmsg_cancel(msg, hdr);
>>>         return -EMSGSIZE;
>>
>> I need some help there. Wasn't genlmsg_end always returning 0 value
>> (before 4.0)? If so, should you do "return 0" instead of "return
>> msg->len;"? Don't you just change the returning value on success?
> As far as I can see, it was returning skb->len. Anyways, the #if needs
> to go. It should just use the same code for >= 4.0 and < 4.0
> Also, this patch needs to be split up by functionality. Having
> everything in one big patch is harder to review.

I misread the commit:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=053c095a82cf773075e83d7233b5cc19a1f73ece

You're both right.

-- 
Rafał
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list