diff options
author | Joe Perches <joe@perches.com> | 2010-07-10 03:22:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-15 22:05:17 -0400 |
commit | 0a645e809759a4b9c876d3e9ca6c139784a97a38 (patch) | |
tree | d9e2e46a9207020fc840f52a869eed045e03fa97 /drivers/net/mlx4/main.c | |
parent | 54874868585ffa5d73d7ab8a5a32ea7dcdec1441 (diff) |
drivers/net/mlx4: Use %pV, pr_<level>, printk_once
Remove near duplication of format string constants by using the newly
introduced vsprintf extention %pV to reduce text by 20k or so.
$ size drivers/net/mlx4/built-in.o*
text data bss dec hex filename
161367 1866 48784 212017 33c31 drivers/net/mlx4/built-in.o
142621 1866 46248 190735 2e90f drivers/net/mlx4/built-in.o.new
Use printk_once as appropriate.
Convert printks to pr_<level>, some bare printks now use pr_cont.
Remove now unused #define PFX.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/mlx4/main.c')
-rw-r--r-- | drivers/net/mlx4/main.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c index e3e0d54a7c87..5102ab1ac561 100644 --- a/drivers/net/mlx4/main.c +++ b/drivers/net/mlx4/main.c | |||
@@ -1050,8 +1050,7 @@ static int __mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1050 | int err; | 1050 | int err; |
1051 | int port; | 1051 | int port; |
1052 | 1052 | ||
1053 | printk(KERN_INFO PFX "Initializing %s\n", | 1053 | pr_info(DRV_NAME ": Initializing %s\n", pci_name(pdev)); |
1054 | pci_name(pdev)); | ||
1055 | 1054 | ||
1056 | err = pci_enable_device(pdev); | 1055 | err = pci_enable_device(pdev); |
1057 | if (err) { | 1056 | if (err) { |
@@ -1216,12 +1215,7 @@ err_disable_pdev: | |||
1216 | static int __devinit mlx4_init_one(struct pci_dev *pdev, | 1215 | static int __devinit mlx4_init_one(struct pci_dev *pdev, |
1217 | const struct pci_device_id *id) | 1216 | const struct pci_device_id *id) |
1218 | { | 1217 | { |
1219 | static int mlx4_version_printed; | 1218 | printk_once(KERN_INFO "%s", mlx4_version); |
1220 | |||
1221 | if (!mlx4_version_printed) { | ||
1222 | printk(KERN_INFO "%s", mlx4_version); | ||
1223 | ++mlx4_version_printed; | ||
1224 | } | ||
1225 | 1219 | ||
1226 | return __mlx4_init_one(pdev, id); | 1220 | return __mlx4_init_one(pdev, id); |
1227 | } | 1221 | } |
@@ -1301,17 +1295,17 @@ static struct pci_driver mlx4_driver = { | |||
1301 | static int __init mlx4_verify_params(void) | 1295 | static int __init mlx4_verify_params(void) |
1302 | { | 1296 | { |
1303 | if ((log_num_mac < 0) || (log_num_mac > 7)) { | 1297 | if ((log_num_mac < 0) || (log_num_mac > 7)) { |
1304 | printk(KERN_WARNING "mlx4_core: bad num_mac: %d\n", log_num_mac); | 1298 | pr_warning("mlx4_core: bad num_mac: %d\n", log_num_mac); |
1305 | return -1; | 1299 | return -1; |
1306 | } | 1300 | } |
1307 | 1301 | ||
1308 | if ((log_num_vlan < 0) || (log_num_vlan > 7)) { | 1302 | if ((log_num_vlan < 0) || (log_num_vlan > 7)) { |
1309 | printk(KERN_WARNING "mlx4_core: bad num_vlan: %d\n", log_num_vlan); | 1303 | pr_warning("mlx4_core: bad num_vlan: %d\n", log_num_vlan); |
1310 | return -1; | 1304 | return -1; |
1311 | } | 1305 | } |
1312 | 1306 | ||
1313 | if ((log_mtts_per_seg < 1) || (log_mtts_per_seg > 5)) { | 1307 | if ((log_mtts_per_seg < 1) || (log_mtts_per_seg > 5)) { |
1314 | printk(KERN_WARNING "mlx4_core: bad log_mtts_per_seg: %d\n", log_mtts_per_seg); | 1308 | pr_warning("mlx4_core: bad log_mtts_per_seg: %d\n", log_mtts_per_seg); |
1315 | return -1; | 1309 | return -1; |
1316 | } | 1310 | } |
1317 | 1311 | ||