diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2012-01-03 07:05:27 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-01-04 14:09:11 -0500 |
commit | 3532650f7c53e16c2c177521212b7d54e185a2bd (patch) | |
tree | 470ef7fa2bf0b47339f0d935c160608a9fbb3267 /drivers/net | |
parent | b1f9284b4e6e5f7a44d6af3e111b33e61b261f26 (diff) |
sfc: Use consistent types for filter IDs, indices and search depths
Filter IDs are u32 (but never very large) so an ID/error return
value should have type s32.
Filter indices and search depths are never negative, so should
have type unsigned int.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/sfc/efx.h | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/filter.c | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/ethernet/sfc/efx.h b/drivers/net/ethernet/sfc/efx.h index 8a5336d86a12..27f0b014b14b 100644 --- a/drivers/net/ethernet/sfc/efx.h +++ b/drivers/net/ethernet/sfc/efx.h | |||
@@ -61,7 +61,7 @@ extern void efx_schedule_slow_fill(struct efx_rx_queue *rx_queue); | |||
61 | extern int efx_probe_filters(struct efx_nic *efx); | 61 | extern int efx_probe_filters(struct efx_nic *efx); |
62 | extern void efx_restore_filters(struct efx_nic *efx); | 62 | extern void efx_restore_filters(struct efx_nic *efx); |
63 | extern void efx_remove_filters(struct efx_nic *efx); | 63 | extern void efx_remove_filters(struct efx_nic *efx); |
64 | extern int efx_filter_insert_filter(struct efx_nic *efx, | 64 | extern s32 efx_filter_insert_filter(struct efx_nic *efx, |
65 | struct efx_filter_spec *spec, | 65 | struct efx_filter_spec *spec, |
66 | bool replace); | 66 | bool replace); |
67 | extern int efx_filter_remove_filter(struct efx_nic *efx, | 67 | extern int efx_filter_remove_filter(struct efx_nic *efx, |
diff --git a/drivers/net/ethernet/sfc/filter.c b/drivers/net/ethernet/sfc/filter.c index 1e079bd31bb9..f41ed5bcdffb 100644 --- a/drivers/net/ethernet/sfc/filter.c +++ b/drivers/net/ethernet/sfc/filter.c | |||
@@ -332,7 +332,7 @@ static bool efx_filter_equal(const struct efx_filter_spec *left, | |||
332 | 332 | ||
333 | static int efx_filter_search(struct efx_filter_table *table, | 333 | static int efx_filter_search(struct efx_filter_table *table, |
334 | struct efx_filter_spec *spec, u32 key, | 334 | struct efx_filter_spec *spec, u32 key, |
335 | bool for_insert, int *depth_required) | 335 | bool for_insert, unsigned int *depth_required) |
336 | { | 336 | { |
337 | unsigned hash, incr, filter_idx, depth, depth_max; | 337 | unsigned hash, incr, filter_idx, depth, depth_max; |
338 | 338 | ||
@@ -417,14 +417,14 @@ static inline u8 efx_filter_id_flags(u32 id) | |||
417 | * On success, return the filter ID. | 417 | * On success, return the filter ID. |
418 | * On failure, return a negative error code. | 418 | * On failure, return a negative error code. |
419 | */ | 419 | */ |
420 | int efx_filter_insert_filter(struct efx_nic *efx, struct efx_filter_spec *spec, | 420 | s32 efx_filter_insert_filter(struct efx_nic *efx, struct efx_filter_spec *spec, |
421 | bool replace) | 421 | bool replace) |
422 | { | 422 | { |
423 | struct efx_filter_state *state = efx->filter_state; | 423 | struct efx_filter_state *state = efx->filter_state; |
424 | struct efx_filter_table *table = efx_filter_spec_table(state, spec); | 424 | struct efx_filter_table *table = efx_filter_spec_table(state, spec); |
425 | struct efx_filter_spec *saved_spec; | 425 | struct efx_filter_spec *saved_spec; |
426 | efx_oword_t filter; | 426 | efx_oword_t filter; |
427 | int filter_idx, depth; | 427 | unsigned int filter_idx, depth; |
428 | u32 key; | 428 | u32 key; |
429 | int rc; | 429 | int rc; |
430 | 430 | ||
@@ -481,7 +481,7 @@ out: | |||
481 | 481 | ||
482 | static void efx_filter_table_clear_entry(struct efx_nic *efx, | 482 | static void efx_filter_table_clear_entry(struct efx_nic *efx, |
483 | struct efx_filter_table *table, | 483 | struct efx_filter_table *table, |
484 | int filter_idx) | 484 | unsigned int filter_idx) |
485 | { | 485 | { |
486 | static efx_oword_t filter; | 486 | static efx_oword_t filter; |
487 | 487 | ||
@@ -509,7 +509,7 @@ int efx_filter_remove_filter(struct efx_nic *efx, struct efx_filter_spec *spec) | |||
509 | struct efx_filter_table *table = efx_filter_spec_table(state, spec); | 509 | struct efx_filter_table *table = efx_filter_spec_table(state, spec); |
510 | struct efx_filter_spec *saved_spec; | 510 | struct efx_filter_spec *saved_spec; |
511 | efx_oword_t filter; | 511 | efx_oword_t filter; |
512 | int filter_idx, depth; | 512 | unsigned int filter_idx, depth; |
513 | u32 key; | 513 | u32 key; |
514 | int rc; | 514 | int rc; |
515 | 515 | ||
@@ -547,7 +547,7 @@ static void efx_filter_table_clear(struct efx_nic *efx, | |||
547 | { | 547 | { |
548 | struct efx_filter_state *state = efx->filter_state; | 548 | struct efx_filter_state *state = efx->filter_state; |
549 | struct efx_filter_table *table = &state->table[table_id]; | 549 | struct efx_filter_table *table = &state->table[table_id]; |
550 | int filter_idx; | 550 | unsigned int filter_idx; |
551 | 551 | ||
552 | spin_lock_bh(&state->lock); | 552 | spin_lock_bh(&state->lock); |
553 | 553 | ||
@@ -578,7 +578,7 @@ void efx_restore_filters(struct efx_nic *efx) | |||
578 | enum efx_filter_table_id table_id; | 578 | enum efx_filter_table_id table_id; |
579 | struct efx_filter_table *table; | 579 | struct efx_filter_table *table; |
580 | efx_oword_t filter; | 580 | efx_oword_t filter; |
581 | int filter_idx; | 581 | unsigned int filter_idx; |
582 | 582 | ||
583 | spin_lock_bh(&state->lock); | 583 | spin_lock_bh(&state->lock); |
584 | 584 | ||