> > On Thu, Mar 01, 2018 at 08:21:26AM +0200, Leon Romanovsky wrote: > > > static qp_dummpit_func(..) > > { > > check_input(QP, ...) > > fill_entries(QP, ...) > > but that is not how it works, it is isn't fill_entires, it is singular > fill_entry(). > > You'd have to do something crazy like > > static qp_dummpit_func(..) > { > check_input(QP, ...) > for (xx = start_loop(..); !loop_end(xx); next_loop(xx)) > fill_entry_body() > > Which seems much worse than what is already in the patch. The nice > tidy 'fill_entry' function is perfect, all the boiler plate is in the > common code. > > I agree the const struct could have fewer members though.. I've removed res_type. I can remove the other nlattr types and pass them as parameters. Is that better? res_get_common_dumpit(skb, cb, RDMA_RESTRACK_QP, RDMA_NLDEV_CMD_RES_QP_GET, RDMA_NLDEV_ATTR_RES_QP); Or just have helper functions that return the nldev cmd and attr given the res_type. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html