diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2012-01-05 14:05:20 -0500 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2012-01-09 12:08:13 -0500 |
commit | 18e83e4cd144e30fb38bf1f714914182c6c8bced (patch) | |
tree | 3b9d93550cecbd127d2c00e50c9c373df8675aa0 /drivers/net | |
parent | 0beaca2ca0b3c12dabab046f1541b09179ec449c (diff) |
sfc: Const-qualify static data as appropriate, partly prompted by checkpatch
Fix the following warnings:
WARNING: struct dev_pm_ops should normally be const
WARNING: static const char * array should probably be static const char * const
Similarly const-qualify struct i2c_board_info, struct i2c_algo_bit_data,
struct efx_ethtool_stat, struct efx_mtd_ops and struct siena_nvram_type_info.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/sfc/efx.c | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/ethtool.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/falcon.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/falcon_boards.c | 12 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/mcdi.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/mtd.c | 8 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/net_driver.h | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/selftest.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/txc43128_phy.c | 2 |
9 files changed, 22 insertions, 22 deletions
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c index 0539a8d88a23..9ca5dcdf5a86 100644 --- a/drivers/net/ethernet/sfc/efx.c +++ b/drivers/net/ethernet/sfc/efx.c | |||
@@ -38,7 +38,7 @@ | |||
38 | 38 | ||
39 | /* Loopback mode names (see LOOPBACK_MODE()) */ | 39 | /* Loopback mode names (see LOOPBACK_MODE()) */ |
40 | const unsigned int efx_loopback_mode_max = LOOPBACK_MAX; | 40 | const unsigned int efx_loopback_mode_max = LOOPBACK_MAX; |
41 | const char *efx_loopback_mode_names[] = { | 41 | const char *const efx_loopback_mode_names[] = { |
42 | [LOOPBACK_NONE] = "NONE", | 42 | [LOOPBACK_NONE] = "NONE", |
43 | [LOOPBACK_DATA] = "DATAPATH", | 43 | [LOOPBACK_DATA] = "DATAPATH", |
44 | [LOOPBACK_GMAC] = "GMAC", | 44 | [LOOPBACK_GMAC] = "GMAC", |
@@ -69,7 +69,7 @@ const char *efx_loopback_mode_names[] = { | |||
69 | }; | 69 | }; |
70 | 70 | ||
71 | const unsigned int efx_reset_type_max = RESET_TYPE_MAX; | 71 | const unsigned int efx_reset_type_max = RESET_TYPE_MAX; |
72 | const char *efx_reset_type_names[] = { | 72 | const char *const efx_reset_type_names[] = { |
73 | [RESET_TYPE_INVISIBLE] = "INVISIBLE", | 73 | [RESET_TYPE_INVISIBLE] = "INVISIBLE", |
74 | [RESET_TYPE_ALL] = "ALL", | 74 | [RESET_TYPE_ALL] = "ALL", |
75 | [RESET_TYPE_WORLD] = "WORLD", | 75 | [RESET_TYPE_WORLD] = "WORLD", |
@@ -2660,7 +2660,7 @@ static int efx_pm_suspend(struct device *dev) | |||
2660 | return rc; | 2660 | return rc; |
2661 | } | 2661 | } |
2662 | 2662 | ||
2663 | static struct dev_pm_ops efx_pm_ops = { | 2663 | static const struct dev_pm_ops efx_pm_ops = { |
2664 | .suspend = efx_pm_suspend, | 2664 | .suspend = efx_pm_suspend, |
2665 | .resume = efx_pm_resume, | 2665 | .resume = efx_pm_resume, |
2666 | .freeze = efx_pm_freeze, | 2666 | .freeze = efx_pm_freeze, |
diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c index c090de4e66c3..52c9ee4c8aa3 100644 --- a/drivers/net/ethernet/sfc/ethtool.c +++ b/drivers/net/ethernet/sfc/ethtool.c | |||
@@ -91,7 +91,7 @@ static u64 efx_get_atomic_stat(void *field) | |||
91 | EFX_ETHTOOL_STAT(tx_##field, tx_queue, field, \ | 91 | EFX_ETHTOOL_STAT(tx_##field, tx_queue, field, \ |
92 | unsigned int, efx_get_uint_stat) | 92 | unsigned int, efx_get_uint_stat) |
93 | 93 | ||
94 | static struct efx_ethtool_stat efx_ethtool_stats[] = { | 94 | static const struct efx_ethtool_stat efx_ethtool_stats[] = { |
95 | EFX_ETHTOOL_U64_MAC_STAT(tx_bytes), | 95 | EFX_ETHTOOL_U64_MAC_STAT(tx_bytes), |
96 | EFX_ETHTOOL_U64_MAC_STAT(tx_good_bytes), | 96 | EFX_ETHTOOL_U64_MAC_STAT(tx_good_bytes), |
97 | EFX_ETHTOOL_U64_MAC_STAT(tx_bad_bytes), | 97 | EFX_ETHTOOL_U64_MAC_STAT(tx_bad_bytes), |
@@ -486,7 +486,7 @@ static void efx_ethtool_get_stats(struct net_device *net_dev, | |||
486 | { | 486 | { |
487 | struct efx_nic *efx = netdev_priv(net_dev); | 487 | struct efx_nic *efx = netdev_priv(net_dev); |
488 | struct efx_mac_stats *mac_stats = &efx->mac_stats; | 488 | struct efx_mac_stats *mac_stats = &efx->mac_stats; |
489 | struct efx_ethtool_stat *stat; | 489 | const struct efx_ethtool_stat *stat; |
490 | struct efx_channel *channel; | 490 | struct efx_channel *channel; |
491 | struct efx_tx_queue *tx_queue; | 491 | struct efx_tx_queue *tx_queue; |
492 | struct rtnl_link_stats64 temp; | 492 | struct rtnl_link_stats64 temp; |
diff --git a/drivers/net/ethernet/sfc/falcon.c b/drivers/net/ethernet/sfc/falcon.c index 8ae1ebd35397..5c7548959dd7 100644 --- a/drivers/net/ethernet/sfc/falcon.c +++ b/drivers/net/ethernet/sfc/falcon.c | |||
@@ -89,7 +89,7 @@ static int falcon_getscl(void *data) | |||
89 | return EFX_OWORD_FIELD(reg, FRF_AB_GPIO0_IN); | 89 | return EFX_OWORD_FIELD(reg, FRF_AB_GPIO0_IN); |
90 | } | 90 | } |
91 | 91 | ||
92 | static struct i2c_algo_bit_data falcon_i2c_bit_operations = { | 92 | static const struct i2c_algo_bit_data falcon_i2c_bit_operations = { |
93 | .setsda = falcon_setsda, | 93 | .setsda = falcon_setsda, |
94 | .setscl = falcon_setscl, | 94 | .setscl = falcon_setscl, |
95 | .getsda = falcon_getsda, | 95 | .getsda = falcon_getsda, |
diff --git a/drivers/net/ethernet/sfc/falcon_boards.c b/drivers/net/ethernet/sfc/falcon_boards.c index 6cc16b8cc6f4..2084cc6ede52 100644 --- a/drivers/net/ethernet/sfc/falcon_boards.c +++ b/drivers/net/ethernet/sfc/falcon_boards.c | |||
@@ -87,7 +87,7 @@ static const u8 falcon_lm87_common_regs[] = { | |||
87 | 0 | 87 | 0 |
88 | }; | 88 | }; |
89 | 89 | ||
90 | static int efx_init_lm87(struct efx_nic *efx, struct i2c_board_info *info, | 90 | static int efx_init_lm87(struct efx_nic *efx, const struct i2c_board_info *info, |
91 | const u8 *reg_values) | 91 | const u8 *reg_values) |
92 | { | 92 | { |
93 | struct falcon_board *board = falcon_board(efx); | 93 | struct falcon_board *board = falcon_board(efx); |
@@ -179,7 +179,7 @@ static int efx_check_lm87(struct efx_nic *efx, unsigned mask) | |||
179 | #else /* !CONFIG_SENSORS_LM87 */ | 179 | #else /* !CONFIG_SENSORS_LM87 */ |
180 | 180 | ||
181 | static inline int | 181 | static inline int |
182 | efx_init_lm87(struct efx_nic *efx, struct i2c_board_info *info, | 182 | efx_init_lm87(struct efx_nic *efx, const struct i2c_board_info *info, |
183 | const u8 *reg_values) | 183 | const u8 *reg_values) |
184 | { | 184 | { |
185 | return 0; | 185 | return 0; |
@@ -442,7 +442,7 @@ static int sfe4001_check_hw(struct efx_nic *efx) | |||
442 | return (status < 0) ? -EIO : -ERANGE; | 442 | return (status < 0) ? -EIO : -ERANGE; |
443 | } | 443 | } |
444 | 444 | ||
445 | static struct i2c_board_info sfe4001_hwmon_info = { | 445 | static const struct i2c_board_info sfe4001_hwmon_info = { |
446 | I2C_BOARD_INFO("max6647", 0x4e), | 446 | I2C_BOARD_INFO("max6647", 0x4e), |
447 | }; | 447 | }; |
448 | 448 | ||
@@ -522,7 +522,7 @@ static const u8 sfe4002_lm87_regs[] = { | |||
522 | 0 | 522 | 0 |
523 | }; | 523 | }; |
524 | 524 | ||
525 | static struct i2c_board_info sfe4002_hwmon_info = { | 525 | static const struct i2c_board_info sfe4002_hwmon_info = { |
526 | I2C_BOARD_INFO("lm87", 0x2e), | 526 | I2C_BOARD_INFO("lm87", 0x2e), |
527 | .platform_data = &sfe4002_lm87_channel, | 527 | .platform_data = &sfe4002_lm87_channel, |
528 | }; | 528 | }; |
@@ -591,7 +591,7 @@ static const u8 sfn4112f_lm87_regs[] = { | |||
591 | 0 | 591 | 0 |
592 | }; | 592 | }; |
593 | 593 | ||
594 | static struct i2c_board_info sfn4112f_hwmon_info = { | 594 | static const struct i2c_board_info sfn4112f_hwmon_info = { |
595 | I2C_BOARD_INFO("lm87", 0x2e), | 595 | I2C_BOARD_INFO("lm87", 0x2e), |
596 | .platform_data = &sfn4112f_lm87_channel, | 596 | .platform_data = &sfn4112f_lm87_channel, |
597 | }; | 597 | }; |
@@ -653,7 +653,7 @@ static const u8 sfe4003_lm87_regs[] = { | |||
653 | 0 | 653 | 0 |
654 | }; | 654 | }; |
655 | 655 | ||
656 | static struct i2c_board_info sfe4003_hwmon_info = { | 656 | static const struct i2c_board_info sfe4003_hwmon_info = { |
657 | I2C_BOARD_INFO("lm87", 0x2e), | 657 | I2C_BOARD_INFO("lm87", 0x2e), |
658 | .platform_data = &sfe4003_lm87_channel, | 658 | .platform_data = &sfe4003_lm87_channel, |
659 | }; | 659 | }; |
diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c index 81a425397468..b1de400ca24e 100644 --- a/drivers/net/ethernet/sfc/mcdi.c +++ b/drivers/net/ethernet/sfc/mcdi.c | |||
@@ -502,7 +502,7 @@ static void efx_mcdi_process_link_change(struct efx_nic *efx, efx_qword_t *ev) | |||
502 | efx_link_status_changed(efx); | 502 | efx_link_status_changed(efx); |
503 | } | 503 | } |
504 | 504 | ||
505 | static const char *sensor_names[] = { | 505 | static const char *const sensor_names[] = { |
506 | [MC_CMD_SENSOR_CONTROLLER_TEMP] = "Controller temp. sensor", | 506 | [MC_CMD_SENSOR_CONTROLLER_TEMP] = "Controller temp. sensor", |
507 | [MC_CMD_SENSOR_PHY_COMMON_TEMP] = "PHY shared temp. sensor", | 507 | [MC_CMD_SENSOR_PHY_COMMON_TEMP] = "PHY shared temp. sensor", |
508 | [MC_CMD_SENSOR_CONTROLLER_COOLING] = "Controller cooling", | 508 | [MC_CMD_SENSOR_CONTROLLER_COOLING] = "Controller cooling", |
@@ -518,7 +518,7 @@ static const char *sensor_names[] = { | |||
518 | [MC_CMD_SENSOR_IN_12V0] = "12V supply sensor" | 518 | [MC_CMD_SENSOR_IN_12V0] = "12V supply sensor" |
519 | }; | 519 | }; |
520 | 520 | ||
521 | static const char *sensor_status_names[] = { | 521 | static const char *const sensor_status_names[] = { |
522 | [MC_CMD_SENSOR_STATE_OK] = "OK", | 522 | [MC_CMD_SENSOR_STATE_OK] = "OK", |
523 | [MC_CMD_SENSOR_STATE_WARNING] = "Warning", | 523 | [MC_CMD_SENSOR_STATE_WARNING] = "Warning", |
524 | [MC_CMD_SENSOR_STATE_FATAL] = "Fatal", | 524 | [MC_CMD_SENSOR_STATE_FATAL] = "Fatal", |
diff --git a/drivers/net/ethernet/sfc/mtd.c b/drivers/net/ethernet/sfc/mtd.c index bc9dcd6b30d7..13f61fba731f 100644 --- a/drivers/net/ethernet/sfc/mtd.c +++ b/drivers/net/ethernet/sfc/mtd.c | |||
@@ -382,7 +382,7 @@ static int falcon_mtd_sync(struct mtd_info *mtd) | |||
382 | return rc; | 382 | return rc; |
383 | } | 383 | } |
384 | 384 | ||
385 | static struct efx_mtd_ops falcon_mtd_ops = { | 385 | static const struct efx_mtd_ops falcon_mtd_ops = { |
386 | .read = falcon_mtd_read, | 386 | .read = falcon_mtd_read, |
387 | .erase = falcon_mtd_erase, | 387 | .erase = falcon_mtd_erase, |
388 | .write = falcon_mtd_write, | 388 | .write = falcon_mtd_write, |
@@ -560,7 +560,7 @@ static int siena_mtd_sync(struct mtd_info *mtd) | |||
560 | return rc; | 560 | return rc; |
561 | } | 561 | } |
562 | 562 | ||
563 | static struct efx_mtd_ops siena_mtd_ops = { | 563 | static const struct efx_mtd_ops siena_mtd_ops = { |
564 | .read = siena_mtd_read, | 564 | .read = siena_mtd_read, |
565 | .erase = siena_mtd_erase, | 565 | .erase = siena_mtd_erase, |
566 | .write = siena_mtd_write, | 566 | .write = siena_mtd_write, |
@@ -572,7 +572,7 @@ struct siena_nvram_type_info { | |||
572 | const char *name; | 572 | const char *name; |
573 | }; | 573 | }; |
574 | 574 | ||
575 | static struct siena_nvram_type_info siena_nvram_types[] = { | 575 | static const struct siena_nvram_type_info siena_nvram_types[] = { |
576 | [MC_CMD_NVRAM_TYPE_DISABLED_CALLISTO] = { 0, "sfc_dummy_phy" }, | 576 | [MC_CMD_NVRAM_TYPE_DISABLED_CALLISTO] = { 0, "sfc_dummy_phy" }, |
577 | [MC_CMD_NVRAM_TYPE_MC_FW] = { 0, "sfc_mcfw" }, | 577 | [MC_CMD_NVRAM_TYPE_MC_FW] = { 0, "sfc_mcfw" }, |
578 | [MC_CMD_NVRAM_TYPE_MC_FW_BACKUP] = { 0, "sfc_mcfw_backup" }, | 578 | [MC_CMD_NVRAM_TYPE_MC_FW_BACKUP] = { 0, "sfc_mcfw_backup" }, |
@@ -593,7 +593,7 @@ static int siena_mtd_probe_partition(struct efx_nic *efx, | |||
593 | unsigned int type) | 593 | unsigned int type) |
594 | { | 594 | { |
595 | struct efx_mtd_partition *part = &efx_mtd->part[part_id]; | 595 | struct efx_mtd_partition *part = &efx_mtd->part[part_id]; |
596 | struct siena_nvram_type_info *info; | 596 | const struct siena_nvram_type_info *info; |
597 | size_t size, erase_size; | 597 | size_t size, erase_size; |
598 | bool protected; | 598 | bool protected; |
599 | int rc; | 599 | int rc; |
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h index c49502bab6a3..9353ce801752 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h | |||
@@ -395,12 +395,12 @@ enum efx_led_mode { | |||
395 | #define STRING_TABLE_LOOKUP(val, member) \ | 395 | #define STRING_TABLE_LOOKUP(val, member) \ |
396 | ((val) < member ## _max) ? member ## _names[val] : "(invalid)" | 396 | ((val) < member ## _max) ? member ## _names[val] : "(invalid)" |
397 | 397 | ||
398 | extern const char *efx_loopback_mode_names[]; | 398 | extern const char *const efx_loopback_mode_names[]; |
399 | extern const unsigned int efx_loopback_mode_max; | 399 | extern const unsigned int efx_loopback_mode_max; |
400 | #define LOOPBACK_MODE(efx) \ | 400 | #define LOOPBACK_MODE(efx) \ |
401 | STRING_TABLE_LOOKUP((efx)->loopback_mode, efx_loopback_mode) | 401 | STRING_TABLE_LOOKUP((efx)->loopback_mode, efx_loopback_mode) |
402 | 402 | ||
403 | extern const char *efx_reset_type_names[]; | 403 | extern const char *const efx_reset_type_names[]; |
404 | extern const unsigned int efx_reset_type_max; | 404 | extern const unsigned int efx_reset_type_max; |
405 | #define RESET_TYPE(type) \ | 405 | #define RESET_TYPE(type) \ |
406 | STRING_TABLE_LOOKUP(type, efx_reset_type) | 406 | STRING_TABLE_LOOKUP(type, efx_reset_type) |
diff --git a/drivers/net/ethernet/sfc/selftest.c b/drivers/net/ethernet/sfc/selftest.c index fc62fe2f766f..17ff9b399957 100644 --- a/drivers/net/ethernet/sfc/selftest.c +++ b/drivers/net/ethernet/sfc/selftest.c | |||
@@ -50,7 +50,7 @@ static const char payload_msg[] = | |||
50 | 50 | ||
51 | /* Interrupt mode names */ | 51 | /* Interrupt mode names */ |
52 | static const unsigned int efx_interrupt_mode_max = EFX_INT_MODE_MAX; | 52 | static const unsigned int efx_interrupt_mode_max = EFX_INT_MODE_MAX; |
53 | static const char *efx_interrupt_mode_names[] = { | 53 | static const char *const efx_interrupt_mode_names[] = { |
54 | [EFX_INT_MODE_MSIX] = "MSI-X", | 54 | [EFX_INT_MODE_MSIX] = "MSI-X", |
55 | [EFX_INT_MODE_MSI] = "MSI", | 55 | [EFX_INT_MODE_MSI] = "MSI", |
56 | [EFX_INT_MODE_LEGACY] = "legacy", | 56 | [EFX_INT_MODE_LEGACY] = "legacy", |
diff --git a/drivers/net/ethernet/sfc/txc43128_phy.c b/drivers/net/ethernet/sfc/txc43128_phy.c index 7c21b334a75b..29bb3f9941c0 100644 --- a/drivers/net/ethernet/sfc/txc43128_phy.c +++ b/drivers/net/ethernet/sfc/txc43128_phy.c | |||
@@ -512,7 +512,7 @@ static bool txc43128_phy_poll(struct efx_nic *efx) | |||
512 | return efx->link_state.up != was_up; | 512 | return efx->link_state.up != was_up; |
513 | } | 513 | } |
514 | 514 | ||
515 | static const char *txc43128_test_names[] = { | 515 | static const char *const txc43128_test_names[] = { |
516 | "bist" | 516 | "bist" |
517 | }; | 517 | }; |
518 | 518 | ||