Skip to content

Commit

Permalink
igb: fix anoying type mismatch warning on rx/tx queue sizing
Browse files Browse the repository at this point in the history
When using "min()", the types of both sides should match.  With the cpu
mask changes, the type of num_online_cpus() will now depend on config
options. Use "min_t()" with an explicit type instead.

And make the rx/tx case look the same too, just for sanity.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Linus Torvalds committed Jan 6, 2009
1 parent 7a1fcd5 commit e42e4ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/igb/igb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1457,8 +1457,8 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter)

/* Number of supported queues. */
/* Having more queues than CPUs doesn't make sense. */
adapter->num_rx_queues = min((u32)IGB_MAX_RX_QUEUES, (u32)num_online_cpus());
adapter->num_tx_queues = min(IGB_MAX_TX_QUEUES, num_online_cpus());
adapter->num_rx_queues = min_t(u32, IGB_MAX_RX_QUEUES, num_online_cpus());
adapter->num_tx_queues = min_t(u32, IGB_MAX_TX_QUEUES, num_online_cpus());

/* This call may decrease the number of queues depending on
* interrupt mode. */
Expand Down

0 comments on commit e42e4ba

Please sign in to comment.