tech-net archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: patch make struct protosw pr_input non-variadic
On Fri, May 13, 2016 at 11:14:13PM +0000, Christos Zoulas wrote:
> In article <20160513195611.GA8625@pris>,
> Tyler Retzlaff <rtr%netbsd.org@localhost> wrote:
> >-=-=-=-=-=-
> >
> >
> >This patch:
> >* moves pr_input out of struct protosw and places it into <proto>sw
> > specitic structure.
> >* converts domain::dom_protosw to an array of pointers
>
> Why? What's the point of the extra indirection? You could just stick
> and & in front of the array element assignment.
>
I admit I didn't evaluate why this change was made. It was
part of the original patch I received.
Upon examination it looks as if the rationale is to compensate for the
const of the declaration in domain::dom_protosw.
for protocols that implement <proto>pr_input domain::dom_protosw is
initialized via <proto>_dom_init() by looping through and assigning
the the <proto>sw members (introduced in the patch).
I did discuss the merits of initializing using a loop vs maintaining
separate arrays of structures (one for <proto>pr_protosw and one for
<proto>pr_input) but two arrays seemed less desirable because keeping
the elements in sync would likely be error prone.
I'm open to alternatives you may suggest. One thought might be to just
provide a suitable macro and ditching the loop.
Let me know I'll go re-work it.
Thanks
> christos
>
>
Home |
Main Index |
Thread Index |
Old Index