diff options
author | Stephen Hemminger <shemminger@linux-foundation.org> | 2007-10-29 13:46:19 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-10-30 14:32:17 -0400 |
commit | abec42a4f87795766f77e4595b7e540b5fc60e3f (patch) | |
tree | accf9def87efcf8b04728aaea44fdecdea0c559e /drivers/net/e1000/e1000_param.c | |
parent | 273dc74e1c7d9aa2eab2036153c8fe65593fb85e (diff) |
e1000: sparse warnings fixes
Fix sparse warnings and problems from e1000 driver.
Added a sparse fix for the module param array index
-- Auke
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/e1000/e1000_param.c')
-rw-r--r-- | drivers/net/e1000/e1000_param.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/net/e1000/e1000_param.c b/drivers/net/e1000/e1000_param.c index f485874a63f5..e6565ce686bc 100644 --- a/drivers/net/e1000/e1000_param.c +++ b/drivers/net/e1000/e1000_param.c | |||
@@ -46,7 +46,7 @@ | |||
46 | #define E1000_PARAM_INIT { [0 ... E1000_MAX_NIC] = OPTION_UNSET } | 46 | #define E1000_PARAM_INIT { [0 ... E1000_MAX_NIC] = OPTION_UNSET } |
47 | #define E1000_PARAM(X, desc) \ | 47 | #define E1000_PARAM(X, desc) \ |
48 | static int __devinitdata X[E1000_MAX_NIC+1] = E1000_PARAM_INIT; \ | 48 | static int __devinitdata X[E1000_MAX_NIC+1] = E1000_PARAM_INIT; \ |
49 | static int num_##X = 0; \ | 49 | static unsigned int num_##X; \ |
50 | module_param_array_named(X, X, int, &num_##X, 0); \ | 50 | module_param_array_named(X, X, int, &num_##X, 0); \ |
51 | MODULE_PARM_DESC(X, desc); | 51 | MODULE_PARM_DESC(X, desc); |
52 | 52 | ||
@@ -198,9 +198,9 @@ E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss workaround"); | |||
198 | 198 | ||
199 | struct e1000_option { | 199 | struct e1000_option { |
200 | enum { enable_option, range_option, list_option } type; | 200 | enum { enable_option, range_option, list_option } type; |
201 | char *name; | 201 | const char *name; |
202 | char *err; | 202 | const char *err; |
203 | int def; | 203 | int def; |
204 | union { | 204 | union { |
205 | struct { /* range_option info */ | 205 | struct { /* range_option info */ |
206 | int min; | 206 | int min; |
@@ -214,8 +214,9 @@ struct e1000_option { | |||
214 | }; | 214 | }; |
215 | 215 | ||
216 | static int __devinit | 216 | static int __devinit |
217 | e1000_validate_option(int *value, struct e1000_option *opt, | 217 | e1000_validate_option(unsigned int *value, |
218 | struct e1000_adapter *adapter) | 218 | const struct e1000_option *opt, |
219 | struct e1000_adapter *adapter) | ||
219 | { | 220 | { |
220 | if (*value == OPTION_UNSET) { | 221 | if (*value == OPTION_UNSET) { |
221 | *value = opt->def; | 222 | *value = opt->def; |
@@ -348,7 +349,7 @@ e1000_check_options(struct e1000_adapter *adapter) | |||
348 | }; | 349 | }; |
349 | 350 | ||
350 | if (num_XsumRX > bd) { | 351 | if (num_XsumRX > bd) { |
351 | int rx_csum = XsumRX[bd]; | 352 | unsigned int rx_csum = XsumRX[bd]; |
352 | e1000_validate_option(&rx_csum, &opt, adapter); | 353 | e1000_validate_option(&rx_csum, &opt, adapter); |
353 | adapter->rx_csum = rx_csum; | 354 | adapter->rx_csum = rx_csum; |
354 | } else { | 355 | } else { |
@@ -374,7 +375,7 @@ e1000_check_options(struct e1000_adapter *adapter) | |||
374 | }; | 375 | }; |
375 | 376 | ||
376 | if (num_FlowControl > bd) { | 377 | if (num_FlowControl > bd) { |
377 | int fc = FlowControl[bd]; | 378 | unsigned int fc = FlowControl[bd]; |
378 | e1000_validate_option(&fc, &opt, adapter); | 379 | e1000_validate_option(&fc, &opt, adapter); |
379 | adapter->hw.fc = adapter->hw.original_fc = fc; | 380 | adapter->hw.fc = adapter->hw.original_fc = fc; |
380 | } else { | 381 | } else { |
@@ -506,7 +507,7 @@ e1000_check_options(struct e1000_adapter *adapter) | |||
506 | }; | 507 | }; |
507 | 508 | ||
508 | if (num_SmartPowerDownEnable > bd) { | 509 | if (num_SmartPowerDownEnable > bd) { |
509 | int spd = SmartPowerDownEnable[bd]; | 510 | unsigned int spd = SmartPowerDownEnable[bd]; |
510 | e1000_validate_option(&spd, &opt, adapter); | 511 | e1000_validate_option(&spd, &opt, adapter); |
511 | adapter->smart_power_down = spd; | 512 | adapter->smart_power_down = spd; |
512 | } else { | 513 | } else { |
@@ -522,7 +523,7 @@ e1000_check_options(struct e1000_adapter *adapter) | |||
522 | }; | 523 | }; |
523 | 524 | ||
524 | if (num_KumeranLockLoss > bd) { | 525 | if (num_KumeranLockLoss > bd) { |
525 | int kmrn_lock_loss = KumeranLockLoss[bd]; | 526 | unsigned int kmrn_lock_loss = KumeranLockLoss[bd]; |
526 | e1000_validate_option(&kmrn_lock_loss, &opt, adapter); | 527 | e1000_validate_option(&kmrn_lock_loss, &opt, adapter); |
527 | adapter->hw.kmrn_lock_loss_workaround_disabled = !kmrn_lock_loss; | 528 | adapter->hw.kmrn_lock_loss_workaround_disabled = !kmrn_lock_loss; |
528 | } else { | 529 | } else { |
@@ -581,7 +582,7 @@ e1000_check_fiber_options(struct e1000_adapter *adapter) | |||
581 | static void __devinit | 582 | static void __devinit |
582 | e1000_check_copper_options(struct e1000_adapter *adapter) | 583 | e1000_check_copper_options(struct e1000_adapter *adapter) |
583 | { | 584 | { |
584 | int speed, dplx, an; | 585 | unsigned int speed, dplx, an; |
585 | int bd = adapter->bd_number; | 586 | int bd = adapter->bd_number; |
586 | 587 | ||
587 | { /* Speed */ | 588 | { /* Speed */ |