Sergiy Kibrik <[email protected]> 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 [email protected] https://lists.openwrt.org/mailman/listinfo/openwrt-devel
