Hi Cristian,
> > Using a switch statement for a binary condition instead of if-else does not > make sense to me. I know you mention you saw better performance with the > switch, but I am pretty sure it is not the switch providing the performance > increase. You are using if-else for testing the new subport->tc_ov_enabled > throughout the code (an example is just below in your patch), so I suggest > you do the same here: > > if (subport->tc_ov_enabled) { > if (!grinder_credits_check_with_tc_ov(port, subport, pos)) > return 0; > } else { > if (!grinder_credits_check(port, subport, pos)) > return 0; > I've changed this snip to what you requested, but I've spent some time on this comparing, if, unlike, switch and switch-case was the fastest. We can focus on that later on.. because there is clear difference. Regards, /Marcin -------------------------------------------------------------- Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.