[OpenWrt-Devel] [PATCH] [ubox] kmodloader: increase module name length
Bjørn Mork
bjorn at mork.no
Mon Feb 18 13:46:08 EST 2019
Sergiy Kibrik <sakib at darkstar.site> writes:
> On 2/18/19 4:24 PM, Bjørn Mork wrote:
>> Agreed that 33 is not enough, but NAME_MAX is way overkill again. Why
>> not use the actual max length from the kernel?:
>>
>> include/linux/module.h:#define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN
>> include/linux/moduleparam.h:#define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long))
>
> but those aren't exposed to user space.
> Or do you suggest to duplicate that (64 - sizeof(unsigned long)) definition?
This is my personal taste only, but yes, I prefer duplicating
definitions to document such relationships. Or at least having a comment
documenting it if some other value is used. Which would have
immediately exposed the original bug.
Bjørn
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list