From: Andrea Parri <parri.andrea@xxxxxxxxx> Sent: Tuesday, October 15, 2019 4:47 AM > > The technique used to get the next VMBus version seems increasisly > clumsy as the number of VMBus versions increases. Performance is > not a concern since this is only done once during system boot; it's > just that we'll end up with more lines of code than is really needed. > > As an alternative, introduce a table with the version numbers listed > in order (from the most recent to the oldest). vmbus_connect() loops > through the versions listed in the table until it gets an accepted > connection or gets to the end of the table (invalid version). > > Suggested-by: Michael Kelley <mikelley@xxxxxxxxxxxxx> > Signed-off-by: Andrea Parri <parri.andrea@xxxxxxxxx> > --- > drivers/hv/connection.c | 50 +++++++++++++++-------------------------- > drivers/hv/vmbus_drv.c | 3 +-- > include/linux/hyperv.h | 4 ---- > 3 files changed, 19 insertions(+), 38 deletions(-) > Reviewed-by: Michael Kelley <mikelley@xxxxxxxxxxxxx>