I faced with some strange (for me) code in Linux kernel sources. There is xt_register_target() function:
int xt_register_target(struct xt_target *target)
{
u_int8_t af = target->family;
mutex_lock(&xt[af].mutex);
list_add(&target->list, &xt[af].target);
mutex_unlock(&xt[af].mutex);
return 0;
}
EXPORT_SYMBOL(xt_register_target);
This is an API function. So it seems that it must have some obvious (for API user) reason for the value it returns. But this function has no variability - it always returns 0. So basically it is void.
What is the reason for such API coding pattern? Is this best practice or a mistake?