RE: [PATCH net-next v6 2/2] bonding: Simplify the xmit function for modes that use xmit_hash
From: David Laight <hidden>
Date: 2014-10-02 09:14:10
From: Mahesh Bandewar
On Wed, Oct 1, 2014 at 9:49 PM, Jay Vosburgh [off-list ref] wrote:quoted
Mahesh Bandewar [off-list ref] wrote:
...
quoted
quoted
* Select aggregation groups, and assign each port for it's aggregetor. The * selection logic is called in the inititalization (after all the handshkes), * and after every lacpdu receive (if selected is off). */ -static void ad_port_selection_logic(struct port *port) +static void ad_port_selection_logic(struct port *port, bool *update_slave_arr)Since this function is void, why not have it return a value instead of the bool *update_slave_arr? That would eliminate the need for some call sites to pass a "dummy" to the function. This comment applies to ad_agg_selection_logic and ad_enable_collecting_distributing as well.Yes, I had similar discussion with Nik earlier and overloading the return value did not feel clean and future-proof and hence decided to take this approach.
What overload? Returning values by reference parameters isn't really a good idea. It kills performance and optimisations. If you ever need a second return value then solve the problem then. David