Assign max count to a variable.

eligible_masters was being used directly to access max count value. For
easier usage and code readability, assigned the required value to a
variable and use it everywhere.

Signed-off-by: Srijan Mishra <srijan23mishra@gmail.com>
Acked-by: Joe Stringer joestringernz@gmail.com