diff options
author | Bart Van Assche <bvanassche@acm.org> | 2012-01-14 07:39:44 -0500 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2012-02-27 12:26:30 -0500 |
commit | e0bda7d8c33e60fb08cc0b5522cd86346313722c (patch) | |
tree | cd5f1501be4ffddb4819059893d12e094fea9c9c /drivers/infiniband | |
parent | 6b21d18ed50c7d145220b0724ea7f2613abf0f95 (diff) |
IB/srp: Use pr_fmt() and pr_err()/pr_warn()
Use pr_fmt() and pr_xxx() instead of more verbose printk() equivalents.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: David Dillow <dillowda@ornl.gov>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/ulp/srp/ib_srp.c | 54 |
1 files changed, 29 insertions, 25 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 0bfa545675b8..895a9ff17379 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c | |||
@@ -30,6 +30,8 @@ | |||
30 | * SOFTWARE. | 30 | * SOFTWARE. |
31 | */ | 31 | */ |
32 | 32 | ||
33 | #define pr_fmt(fmt) PFX fmt | ||
34 | |||
33 | #include <linux/module.h> | 35 | #include <linux/module.h> |
34 | #include <linux/init.h> | 36 | #include <linux/init.h> |
35 | #include <linux/slab.h> | 37 | #include <linux/slab.h> |
@@ -165,7 +167,7 @@ static void srp_free_iu(struct srp_host *host, struct srp_iu *iu) | |||
165 | 167 | ||
166 | static void srp_qp_event(struct ib_event *event, void *context) | 168 | static void srp_qp_event(struct ib_event *event, void *context) |
167 | { | 169 | { |
168 | printk(KERN_ERR PFX "QP event %d\n", event->event); | 170 | pr_debug("QP event %d\n", event->event); |
169 | } | 171 | } |
170 | 172 | ||
171 | static int srp_init_qp(struct srp_target_port *target, | 173 | static int srp_init_qp(struct srp_target_port *target, |
@@ -1989,7 +1991,7 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
1989 | goto out; | 1991 | goto out; |
1990 | } | 1992 | } |
1991 | if (strlen(p) != 32) { | 1993 | if (strlen(p) != 32) { |
1992 | printk(KERN_WARNING PFX "bad dest GID parameter '%s'\n", p); | 1994 | pr_warn("bad dest GID parameter '%s'\n", p); |
1993 | kfree(p); | 1995 | kfree(p); |
1994 | goto out; | 1996 | goto out; |
1995 | } | 1997 | } |
@@ -2004,7 +2006,7 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
2004 | 2006 | ||
2005 | case SRP_OPT_PKEY: | 2007 | case SRP_OPT_PKEY: |
2006 | if (match_hex(args, &token)) { | 2008 | if (match_hex(args, &token)) { |
2007 | printk(KERN_WARNING PFX "bad P_Key parameter '%s'\n", p); | 2009 | pr_warn("bad P_Key parameter '%s'\n", p); |
2008 | goto out; | 2010 | goto out; |
2009 | } | 2011 | } |
2010 | target->path.pkey = cpu_to_be16(token); | 2012 | target->path.pkey = cpu_to_be16(token); |
@@ -2023,7 +2025,7 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
2023 | 2025 | ||
2024 | case SRP_OPT_MAX_SECT: | 2026 | case SRP_OPT_MAX_SECT: |
2025 | if (match_int(args, &token)) { | 2027 | if (match_int(args, &token)) { |
2026 | printk(KERN_WARNING PFX "bad max sect parameter '%s'\n", p); | 2028 | pr_warn("bad max sect parameter '%s'\n", p); |
2027 | goto out; | 2029 | goto out; |
2028 | } | 2030 | } |
2029 | target->scsi_host->max_sectors = token; | 2031 | target->scsi_host->max_sectors = token; |
@@ -2031,7 +2033,8 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
2031 | 2033 | ||
2032 | case SRP_OPT_MAX_CMD_PER_LUN: | 2034 | case SRP_OPT_MAX_CMD_PER_LUN: |
2033 | if (match_int(args, &token)) { | 2035 | if (match_int(args, &token)) { |
2034 | printk(KERN_WARNING PFX "bad max cmd_per_lun parameter '%s'\n", p); | 2036 | pr_warn("bad max cmd_per_lun parameter '%s'\n", |
2037 | p); | ||
2035 | goto out; | 2038 | goto out; |
2036 | } | 2039 | } |
2037 | target->scsi_host->cmd_per_lun = min(token, SRP_CMD_SQ_SIZE); | 2040 | target->scsi_host->cmd_per_lun = min(token, SRP_CMD_SQ_SIZE); |
@@ -2039,14 +2042,14 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
2039 | 2042 | ||
2040 | case SRP_OPT_IO_CLASS: | 2043 | case SRP_OPT_IO_CLASS: |
2041 | if (match_hex(args, &token)) { | 2044 | if (match_hex(args, &token)) { |
2042 | printk(KERN_WARNING PFX "bad IO class parameter '%s' \n", p); | 2045 | pr_warn("bad IO class parameter '%s'\n", p); |
2043 | goto out; | 2046 | goto out; |
2044 | } | 2047 | } |
2045 | if (token != SRP_REV10_IB_IO_CLASS && | 2048 | if (token != SRP_REV10_IB_IO_CLASS && |
2046 | token != SRP_REV16A_IB_IO_CLASS) { | 2049 | token != SRP_REV16A_IB_IO_CLASS) { |
2047 | printk(KERN_WARNING PFX "unknown IO class parameter value" | 2050 | pr_warn("unknown IO class parameter value %x specified (use %x or %x).\n", |
2048 | " %x specified (use %x or %x).\n", | 2051 | token, SRP_REV10_IB_IO_CLASS, |
2049 | token, SRP_REV10_IB_IO_CLASS, SRP_REV16A_IB_IO_CLASS); | 2052 | SRP_REV16A_IB_IO_CLASS); |
2050 | goto out; | 2053 | goto out; |
2051 | } | 2054 | } |
2052 | target->io_class = token; | 2055 | target->io_class = token; |
@@ -2064,7 +2067,8 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
2064 | 2067 | ||
2065 | case SRP_OPT_CMD_SG_ENTRIES: | 2068 | case SRP_OPT_CMD_SG_ENTRIES: |
2066 | if (match_int(args, &token) || token < 1 || token > 255) { | 2069 | if (match_int(args, &token) || token < 1 || token > 255) { |
2067 | printk(KERN_WARNING PFX "bad max cmd_sg_entries parameter '%s'\n", p); | 2070 | pr_warn("bad max cmd_sg_entries parameter '%s'\n", |
2071 | p); | ||
2068 | goto out; | 2072 | goto out; |
2069 | } | 2073 | } |
2070 | target->cmd_sg_cnt = token; | 2074 | target->cmd_sg_cnt = token; |
@@ -2072,7 +2076,7 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
2072 | 2076 | ||
2073 | case SRP_OPT_ALLOW_EXT_SG: | 2077 | case SRP_OPT_ALLOW_EXT_SG: |
2074 | if (match_int(args, &token)) { | 2078 | if (match_int(args, &token)) { |
2075 | printk(KERN_WARNING PFX "bad allow_ext_sg parameter '%s'\n", p); | 2079 | pr_warn("bad allow_ext_sg parameter '%s'\n", p); |
2076 | goto out; | 2080 | goto out; |
2077 | } | 2081 | } |
2078 | target->allow_ext_sg = !!token; | 2082 | target->allow_ext_sg = !!token; |
@@ -2081,15 +2085,16 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
2081 | case SRP_OPT_SG_TABLESIZE: | 2085 | case SRP_OPT_SG_TABLESIZE: |
2082 | if (match_int(args, &token) || token < 1 || | 2086 | if (match_int(args, &token) || token < 1 || |
2083 | token > SCSI_MAX_SG_CHAIN_SEGMENTS) { | 2087 | token > SCSI_MAX_SG_CHAIN_SEGMENTS) { |
2084 | printk(KERN_WARNING PFX "bad max sg_tablesize parameter '%s'\n", p); | 2088 | pr_warn("bad max sg_tablesize parameter '%s'\n", |
2089 | p); | ||
2085 | goto out; | 2090 | goto out; |
2086 | } | 2091 | } |
2087 | target->sg_tablesize = token; | 2092 | target->sg_tablesize = token; |
2088 | break; | 2093 | break; |
2089 | 2094 | ||
2090 | default: | 2095 | default: |
2091 | printk(KERN_WARNING PFX "unknown parameter or missing value " | 2096 | pr_warn("unknown parameter or missing value '%s' in target creation request\n", |
2092 | "'%s' in target creation request\n", p); | 2097 | p); |
2093 | goto out; | 2098 | goto out; |
2094 | } | 2099 | } |
2095 | } | 2100 | } |
@@ -2100,9 +2105,8 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
2100 | for (i = 0; i < ARRAY_SIZE(srp_opt_tokens); ++i) | 2105 | for (i = 0; i < ARRAY_SIZE(srp_opt_tokens); ++i) |
2101 | if ((srp_opt_tokens[i].token & SRP_OPT_ALL) && | 2106 | if ((srp_opt_tokens[i].token & SRP_OPT_ALL) && |
2102 | !(srp_opt_tokens[i].token & opt_mask)) | 2107 | !(srp_opt_tokens[i].token & opt_mask)) |
2103 | printk(KERN_WARNING PFX "target creation request is " | 2108 | pr_warn("target creation request is missing parameter '%s'\n", |
2104 | "missing parameter '%s'\n", | 2109 | srp_opt_tokens[i].pattern); |
2105 | srp_opt_tokens[i].pattern); | ||
2106 | 2110 | ||
2107 | out: | 2111 | out: |
2108 | kfree(options); | 2112 | kfree(options); |
@@ -2149,7 +2153,7 @@ static ssize_t srp_create_target(struct device *dev, | |||
2149 | 2153 | ||
2150 | if (!host->srp_dev->fmr_pool && !target->allow_ext_sg && | 2154 | if (!host->srp_dev->fmr_pool && !target->allow_ext_sg && |
2151 | target->cmd_sg_cnt < target->sg_tablesize) { | 2155 | target->cmd_sg_cnt < target->sg_tablesize) { |
2152 | printk(KERN_WARNING PFX "No FMR pool and no external indirect descriptors, limiting sg_tablesize to cmd_sg_cnt\n"); | 2156 | pr_warn("No FMR pool and no external indirect descriptors, limiting sg_tablesize to cmd_sg_cnt\n"); |
2153 | target->sg_tablesize = target->cmd_sg_cnt; | 2157 | target->sg_tablesize = target->cmd_sg_cnt; |
2154 | } | 2158 | } |
2155 | 2159 | ||
@@ -2309,8 +2313,7 @@ static void srp_add_one(struct ib_device *device) | |||
2309 | return; | 2313 | return; |
2310 | 2314 | ||
2311 | if (ib_query_device(device, dev_attr)) { | 2315 | if (ib_query_device(device, dev_attr)) { |
2312 | printk(KERN_WARNING PFX "Query device failed for %s\n", | 2316 | pr_warn("Query device failed for %s\n", device->name); |
2313 | device->name); | ||
2314 | goto free_attr; | 2317 | goto free_attr; |
2315 | } | 2318 | } |
2316 | 2319 | ||
@@ -2459,7 +2462,7 @@ static int __init srp_init_module(void) | |||
2459 | BUILD_BUG_ON(FIELD_SIZEOF(struct ib_wc, wr_id) < sizeof(void *)); | 2462 | BUILD_BUG_ON(FIELD_SIZEOF(struct ib_wc, wr_id) < sizeof(void *)); |
2460 | 2463 | ||
2461 | if (srp_sg_tablesize) { | 2464 | if (srp_sg_tablesize) { |
2462 | printk(KERN_WARNING PFX "srp_sg_tablesize is deprecated, please use cmd_sg_entries\n"); | 2465 | pr_warn("srp_sg_tablesize is deprecated, please use cmd_sg_entries\n"); |
2463 | if (!cmd_sg_entries) | 2466 | if (!cmd_sg_entries) |
2464 | cmd_sg_entries = srp_sg_tablesize; | 2467 | cmd_sg_entries = srp_sg_tablesize; |
2465 | } | 2468 | } |
@@ -2468,14 +2471,15 @@ static int __init srp_init_module(void) | |||
2468 | cmd_sg_entries = SRP_DEF_SG_TABLESIZE; | 2471 | cmd_sg_entries = SRP_DEF_SG_TABLESIZE; |
2469 | 2472 | ||
2470 | if (cmd_sg_entries > 255) { | 2473 | if (cmd_sg_entries > 255) { |
2471 | printk(KERN_WARNING PFX "Clamping cmd_sg_entries to 255\n"); | 2474 | pr_warn("Clamping cmd_sg_entries to 255\n"); |
2472 | cmd_sg_entries = 255; | 2475 | cmd_sg_entries = 255; |
2473 | } | 2476 | } |
2474 | 2477 | ||
2475 | if (!indirect_sg_entries) | 2478 | if (!indirect_sg_entries) |
2476 | indirect_sg_entries = cmd_sg_entries; | 2479 | indirect_sg_entries = cmd_sg_entries; |
2477 | else if (indirect_sg_entries < cmd_sg_entries) { | 2480 | else if (indirect_sg_entries < cmd_sg_entries) { |
2478 | printk(KERN_WARNING PFX "Bumping up indirect_sg_entries to match cmd_sg_entries (%u)\n", cmd_sg_entries); | 2481 | pr_warn("Bumping up indirect_sg_entries to match cmd_sg_entries (%u)\n", |
2482 | cmd_sg_entries); | ||
2479 | indirect_sg_entries = cmd_sg_entries; | 2483 | indirect_sg_entries = cmd_sg_entries; |
2480 | } | 2484 | } |
2481 | 2485 | ||
@@ -2486,7 +2490,7 @@ static int __init srp_init_module(void) | |||
2486 | 2490 | ||
2487 | ret = class_register(&srp_class); | 2491 | ret = class_register(&srp_class); |
2488 | if (ret) { | 2492 | if (ret) { |
2489 | printk(KERN_ERR PFX "couldn't register class infiniband_srp\n"); | 2493 | pr_err("couldn't register class infiniband_srp\n"); |
2490 | srp_release_transport(ib_srp_transport_template); | 2494 | srp_release_transport(ib_srp_transport_template); |
2491 | return ret; | 2495 | return ret; |
2492 | } | 2496 | } |
@@ -2495,7 +2499,7 @@ static int __init srp_init_module(void) | |||
2495 | 2499 | ||
2496 | ret = ib_register_client(&srp_client); | 2500 | ret = ib_register_client(&srp_client); |
2497 | if (ret) { | 2501 | if (ret) { |
2498 | printk(KERN_ERR PFX "couldn't register IB client\n"); | 2502 | pr_err("couldn't register IB client\n"); |
2499 | srp_release_transport(ib_srp_transport_template); | 2503 | srp_release_transport(ib_srp_transport_template); |
2500 | ib_sa_unregister_client(&srp_sa_client); | 2504 | ib_sa_unregister_client(&srp_sa_client); |
2501 | class_unregister(&srp_class); | 2505 | class_unregister(&srp_class); |