On Fri, Feb 19, 2016 at 01:48:06PM -0800, Jarno Rajahalme wrote: > With a note and a question below: > > Acked-by: Jarno Rajahalme <ja...@ovn.org>
Thanks for the review. > I’m curious if there is a specific reason to define > ofpbuf_const_initializer() as an inline function, and keep the > OFPBUF_STUB_INITIALIZER() as a macro? Yes. OFPBUF_STUB_INITIALIZER has to be a macro so that it can usefully use sizeof on its argument. (It could require the size to be provided, but then it would be more of a hassle to use.) ofpbuf_const_initializer() should be a function to avoid expanding its 'data' argument twice. Unlike OFPBUF_STUB_INITIALIZER, some of its callers actually do call it with arguments that have side effects. > > +unsigned int init_ofpbuf(const void *p, size_t size); > > +unsigned int > > +init_ofpbuf(const void *p, size_t size) > > +{ > > + struct ofpbuf b = ofpbuf_const_initializer(p, size); > > + ofpbuf_pull(&b, 8); > > + return b.size; > > +} > > + > > This seems unused. Oops. That was an experiment that I thought I deleted. I deleted it now. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev