aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorParav Pandit <pandit.parav@gmail.com>2016-03-01 14:20:29 -0500
committerDoug Ledford <dledford@redhat.com>2016-03-03 10:20:25 -0500
commitaba25a3e96563083389fc7b9f7d35be6bdfe6579 (patch)
tree59b2d8faf012abc8a8ee3d7fc31e913a958d9345
parentdb9314cd351ebd734970c7afc2995a743e34aa02 (diff)
IB/core: trivial prink cleanup.
1. Replaced printk with appropriate pr_warn, pr_err, pr_info. 2. Removed unnecessary prints around memory allocation failure which are not required, as reported by the checkpatch script. Signed-off-by: Parav Pandit <pandit.parav@gmail.com> Reviewed-by: Haggai Eran <haggaie@mellanox.com> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/core/cache.c15
-rw-r--r--drivers/infiniband/core/cma.c14
-rw-r--r--drivers/infiniband/core/device.c28
-rw-r--r--drivers/infiniband/core/fmr_pool.c37
-rw-r--r--drivers/infiniband/core/packer.c14
-rw-r--r--drivers/infiniband/core/sa_query.c11
-rw-r--r--drivers/infiniband/core/ucm.c8
-rw-r--r--drivers/infiniband/core/ucma.c6
-rw-r--r--drivers/infiniband/core/ud_header.c23
-rw-r--r--drivers/infiniband/core/uverbs_main.c10
10 files changed, 77 insertions, 89 deletions
diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c
index 53343ffbff7a..cb00d59da456 100644
--- a/drivers/infiniband/core/cache.c
+++ b/drivers/infiniband/core/cache.c
@@ -1043,8 +1043,8 @@ static void ib_cache_update(struct ib_device *device,
1043 1043
1044 ret = ib_query_port(device, port, tprops); 1044 ret = ib_query_port(device, port, tprops);
1045 if (ret) { 1045 if (ret) {
1046 printk(KERN_WARNING "ib_query_port failed (%d) for %s\n", 1046 pr_warn("ib_query_port failed (%d) for %s\n",
1047 ret, device->name); 1047 ret, device->name);
1048 goto err; 1048 goto err;
1049 } 1049 }
1050 1050
@@ -1067,8 +1067,8 @@ static void ib_cache_update(struct ib_device *device,
1067 for (i = 0; i < pkey_cache->table_len; ++i) { 1067 for (i = 0; i < pkey_cache->table_len; ++i) {
1068 ret = ib_query_pkey(device, port, i, pkey_cache->table + i); 1068 ret = ib_query_pkey(device, port, i, pkey_cache->table + i);
1069 if (ret) { 1069 if (ret) {
1070 printk(KERN_WARNING "ib_query_pkey failed (%d) for %s (index %d)\n", 1070 pr_warn("ib_query_pkey failed (%d) for %s (index %d)\n",
1071 ret, device->name, i); 1071 ret, device->name, i);
1072 goto err; 1072 goto err;
1073 } 1073 }
1074 } 1074 }
@@ -1078,8 +1078,8 @@ static void ib_cache_update(struct ib_device *device,
1078 ret = ib_query_gid(device, port, i, 1078 ret = ib_query_gid(device, port, i,
1079 gid_cache->table + i, NULL); 1079 gid_cache->table + i, NULL);
1080 if (ret) { 1080 if (ret) {
1081 printk(KERN_WARNING "ib_query_gid failed (%d) for %s (index %d)\n", 1081 pr_warn("ib_query_gid failed (%d) for %s (index %d)\n",
1082 ret, device->name, i); 1082 ret, device->name, i);
1083 goto err; 1083 goto err;
1084 } 1084 }
1085 } 1085 }
@@ -1161,8 +1161,7 @@ int ib_cache_setup_one(struct ib_device *device)
1161 GFP_KERNEL); 1161 GFP_KERNEL);
1162 if (!device->cache.pkey_cache || 1162 if (!device->cache.pkey_cache ||
1163 !device->cache.lmc_cache) { 1163 !device->cache.lmc_cache) {
1164 printk(KERN_WARNING "Couldn't allocate cache " 1164 pr_warn("Couldn't allocate cache for %s\n", device->name);
1165 "for %s\n", device->name);
1166 return -ENOMEM; 1165 return -ENOMEM;
1167 } 1166 }
1168 1167
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 9729639df407..e13121f41949 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -1713,7 +1713,7 @@ static int cma_ib_handler(struct ib_cm_id *cm_id, struct ib_cm_event *ib_event)
1713 event.param.conn.private_data_len = IB_CM_REJ_PRIVATE_DATA_SIZE; 1713 event.param.conn.private_data_len = IB_CM_REJ_PRIVATE_DATA_SIZE;
1714 break; 1714 break;
1715 default: 1715 default:
1716 printk(KERN_ERR "RDMA CMA: unexpected IB CM event: %d\n", 1716 pr_err("RDMA CMA: unexpected IB CM event: %d\n",
1717 ib_event->event); 1717 ib_event->event);
1718 goto out; 1718 goto out;
1719 } 1719 }
@@ -2186,8 +2186,8 @@ static void cma_listen_on_dev(struct rdma_id_private *id_priv,
2186 2186
2187 ret = rdma_listen(id, id_priv->backlog); 2187 ret = rdma_listen(id, id_priv->backlog);
2188 if (ret) 2188 if (ret)
2189 printk(KERN_WARNING "RDMA CMA: cma_listen_on_dev, error %d, " 2189 pr_warn("RDMA CMA: cma_listen_on_dev, error %d, listening on device %s\n",
2190 "listening on device %s\n", ret, cma_dev->device->name); 2190 ret, cma_dev->device->name);
2191} 2191}
2192 2192
2193static void cma_listen_on_all(struct rdma_id_private *id_priv) 2193static void cma_listen_on_all(struct rdma_id_private *id_priv)
@@ -3239,7 +3239,7 @@ static int cma_sidr_rep_handler(struct ib_cm_id *cm_id,
3239 event.status = 0; 3239 event.status = 0;
3240 break; 3240 break;
3241 default: 3241 default:
3242 printk(KERN_ERR "RDMA CMA: unexpected IB CM event: %d\n", 3242 pr_err("RDMA CMA: unexpected IB CM event: %d\n",
3243 ib_event->event); 3243 ib_event->event);
3244 goto out; 3244 goto out;
3245 } 3245 }
@@ -4003,8 +4003,8 @@ static int cma_netdev_change(struct net_device *ndev, struct rdma_id_private *id
4003 if ((dev_addr->bound_dev_if == ndev->ifindex) && 4003 if ((dev_addr->bound_dev_if == ndev->ifindex) &&
4004 (net_eq(dev_net(ndev), dev_addr->net)) && 4004 (net_eq(dev_net(ndev), dev_addr->net)) &&
4005 memcmp(dev_addr->src_dev_addr, ndev->dev_addr, ndev->addr_len)) { 4005 memcmp(dev_addr->src_dev_addr, ndev->dev_addr, ndev->addr_len)) {
4006 printk(KERN_INFO "RDMA CM addr change for ndev %s used by id %p\n", 4006 pr_info("RDMA CM addr change for ndev %s used by id %p\n",
4007 ndev->name, &id_priv->id); 4007 ndev->name, &id_priv->id);
4008 work = kzalloc(sizeof *work, GFP_KERNEL); 4008 work = kzalloc(sizeof *work, GFP_KERNEL);
4009 if (!work) 4009 if (!work)
4010 return -ENOMEM; 4010 return -ENOMEM;
@@ -4287,7 +4287,7 @@ static int __init cma_init(void)
4287 goto err; 4287 goto err;
4288 4288
4289 if (ibnl_add_client(RDMA_NL_RDMA_CM, RDMA_NL_RDMA_CM_NUM_OPS, cma_cb_table)) 4289 if (ibnl_add_client(RDMA_NL_RDMA_CM, RDMA_NL_RDMA_CM_NUM_OPS, cma_cb_table))
4290 printk(KERN_WARNING "RDMA CMA: failed to add netlink callback\n"); 4290 pr_warn("RDMA CMA: failed to add netlink callback\n");
4291 cma_configfs_init(); 4291 cma_configfs_init();
4292 4292
4293 return 0; 4293 return 0;
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index 94b80a51ab68..270c7ff6cba7 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -115,8 +115,8 @@ static int ib_device_check_mandatory(struct ib_device *device)
115 115
116 for (i = 0; i < ARRAY_SIZE(mandatory_table); ++i) { 116 for (i = 0; i < ARRAY_SIZE(mandatory_table); ++i) {
117 if (!*(void **) ((void *) device + mandatory_table[i].offset)) { 117 if (!*(void **) ((void *) device + mandatory_table[i].offset)) {
118 printk(KERN_WARNING "Device %s is missing mandatory function %s\n", 118 pr_warn("Device %s is missing mandatory function %s\n",
119 device->name, mandatory_table[i].name); 119 device->name, mandatory_table[i].name);
120 return -EINVAL; 120 return -EINVAL;
121 } 121 }
122 } 122 }
@@ -255,8 +255,8 @@ static int add_client_context(struct ib_device *device, struct ib_client *client
255 255
256 context = kmalloc(sizeof *context, GFP_KERNEL); 256 context = kmalloc(sizeof *context, GFP_KERNEL);
257 if (!context) { 257 if (!context) {
258 printk(KERN_WARNING "Couldn't allocate client context for %s/%s\n", 258 pr_warn("Couldn't allocate client context for %s/%s\n",
259 device->name, client->name); 259 device->name, client->name);
260 return -ENOMEM; 260 return -ENOMEM;
261 } 261 }
262 262
@@ -343,29 +343,29 @@ int ib_register_device(struct ib_device *device,
343 343
344 ret = read_port_immutable(device); 344 ret = read_port_immutable(device);
345 if (ret) { 345 if (ret) {
346 printk(KERN_WARNING "Couldn't create per port immutable data %s\n", 346 pr_warn("Couldn't create per port immutable data %s\n",
347 device->name); 347 device->name);
348 goto out; 348 goto out;
349 } 349 }
350 350
351 ret = ib_cache_setup_one(device); 351 ret = ib_cache_setup_one(device);
352 if (ret) { 352 if (ret) {
353 printk(KERN_WARNING "Couldn't set up InfiniBand P_Key/GID cache\n"); 353 pr_warn("Couldn't set up InfiniBand P_Key/GID cache\n");
354 goto out; 354 goto out;
355 } 355 }
356 356
357 memset(&device->attrs, 0, sizeof(device->attrs)); 357 memset(&device->attrs, 0, sizeof(device->attrs));
358 ret = device->query_device(device, &device->attrs, &uhw); 358 ret = device->query_device(device, &device->attrs, &uhw);
359 if (ret) { 359 if (ret) {
360 printk(KERN_WARNING "Couldn't query the device attributes\n"); 360 pr_warn("Couldn't query the device attributes\n");
361 ib_cache_cleanup_one(device); 361 ib_cache_cleanup_one(device);
362 goto out; 362 goto out;
363 } 363 }
364 364
365 ret = ib_device_register_sysfs(device, port_callback); 365 ret = ib_device_register_sysfs(device, port_callback);
366 if (ret) { 366 if (ret) {
367 printk(KERN_WARNING "Couldn't register device %s with driver model\n", 367 pr_warn("Couldn't register device %s with driver model\n",
368 device->name); 368 device->name);
369 ib_cache_cleanup_one(device); 369 ib_cache_cleanup_one(device);
370 goto out; 370 goto out;
371 } 371 }
@@ -566,8 +566,8 @@ void ib_set_client_data(struct ib_device *device, struct ib_client *client,
566 goto out; 566 goto out;
567 } 567 }
568 568
569 printk(KERN_WARNING "No client context found for %s/%s\n", 569 pr_warn("No client context found for %s/%s\n",
570 device->name, client->name); 570 device->name, client->name);
571 571
572out: 572out:
573 spin_unlock_irqrestore(&device->client_data_lock, flags); 573 spin_unlock_irqrestore(&device->client_data_lock, flags);
@@ -960,13 +960,13 @@ static int __init ib_core_init(void)
960 960
961 ret = class_register(&ib_class); 961 ret = class_register(&ib_class);
962 if (ret) { 962 if (ret) {
963 printk(KERN_WARNING "Couldn't create InfiniBand device class\n"); 963 pr_warn("Couldn't create InfiniBand device class\n");
964 goto err_comp; 964 goto err_comp;
965 } 965 }
966 966
967 ret = ibnl_init(); 967 ret = ibnl_init();
968 if (ret) { 968 if (ret) {
969 printk(KERN_WARNING "Couldn't init IB netlink interface\n"); 969 pr_warn("Couldn't init IB netlink interface\n");
970 goto err_sysfs; 970 goto err_sysfs;
971 } 971 }
972 972
diff --git a/drivers/infiniband/core/fmr_pool.c b/drivers/infiniband/core/fmr_pool.c
index 6ac3683c144b..cdbb1f1a6d97 100644
--- a/drivers/infiniband/core/fmr_pool.c
+++ b/drivers/infiniband/core/fmr_pool.c
@@ -150,8 +150,8 @@ static void ib_fmr_batch_release(struct ib_fmr_pool *pool)
150 150
151#ifdef DEBUG 151#ifdef DEBUG
152 if (fmr->ref_count !=0) { 152 if (fmr->ref_count !=0) {
153 printk(KERN_WARNING PFX "Unmapping FMR 0x%08x with ref count %d\n", 153 pr_warn(PFX "Unmapping FMR 0x%08x with ref count %d\n",
154 fmr, fmr->ref_count); 154 fmr, fmr->ref_count);
155 } 155 }
156#endif 156#endif
157 } 157 }
@@ -167,7 +167,7 @@ static void ib_fmr_batch_release(struct ib_fmr_pool *pool)
167 167
168 ret = ib_unmap_fmr(&fmr_list); 168 ret = ib_unmap_fmr(&fmr_list);
169 if (ret) 169 if (ret)
170 printk(KERN_WARNING PFX "ib_unmap_fmr returned %d\n", ret); 170 pr_warn(PFX "ib_unmap_fmr returned %d\n", ret);
171 171
172 spin_lock_irq(&pool->pool_lock); 172 spin_lock_irq(&pool->pool_lock);
173 list_splice(&unmap_list, &pool->free_list); 173 list_splice(&unmap_list, &pool->free_list);
@@ -222,8 +222,7 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
222 device = pd->device; 222 device = pd->device;
223 if (!device->alloc_fmr || !device->dealloc_fmr || 223 if (!device->alloc_fmr || !device->dealloc_fmr ||
224 !device->map_phys_fmr || !device->unmap_fmr) { 224 !device->map_phys_fmr || !device->unmap_fmr) {
225 printk(KERN_INFO PFX "Device %s does not support FMRs\n", 225 pr_info(PFX "Device %s does not support FMRs\n", device->name);
226 device->name);
227 return ERR_PTR(-ENOSYS); 226 return ERR_PTR(-ENOSYS);
228 } 227 }
229 228
@@ -233,13 +232,10 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
233 max_remaps = device->attrs.max_map_per_fmr; 232 max_remaps = device->attrs.max_map_per_fmr;
234 233
235 pool = kmalloc(sizeof *pool, GFP_KERNEL); 234 pool = kmalloc(sizeof *pool, GFP_KERNEL);
236 if (!pool) { 235 if (!pool)
237 printk(KERN_WARNING PFX "couldn't allocate pool struct\n");
238 return ERR_PTR(-ENOMEM); 236 return ERR_PTR(-ENOMEM);
239 }
240 237
241 pool->cache_bucket = NULL; 238 pool->cache_bucket = NULL;
242
243 pool->flush_function = params->flush_function; 239 pool->flush_function = params->flush_function;
244 pool->flush_arg = params->flush_arg; 240 pool->flush_arg = params->flush_arg;
245 241
@@ -251,7 +247,7 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
251 kmalloc(IB_FMR_HASH_SIZE * sizeof *pool->cache_bucket, 247 kmalloc(IB_FMR_HASH_SIZE * sizeof *pool->cache_bucket,
252 GFP_KERNEL); 248 GFP_KERNEL);
253 if (!pool->cache_bucket) { 249 if (!pool->cache_bucket) {
254 printk(KERN_WARNING PFX "Failed to allocate cache in pool\n"); 250 pr_warn(PFX "Failed to allocate cache in pool\n");
255 ret = -ENOMEM; 251 ret = -ENOMEM;
256 goto out_free_pool; 252 goto out_free_pool;
257 } 253 }
@@ -275,7 +271,7 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
275 "ib_fmr(%s)", 271 "ib_fmr(%s)",
276 device->name); 272 device->name);
277 if (IS_ERR(pool->thread)) { 273 if (IS_ERR(pool->thread)) {
278 printk(KERN_WARNING PFX "couldn't start cleanup thread\n"); 274 pr_warn(PFX "couldn't start cleanup thread\n");
279 ret = PTR_ERR(pool->thread); 275 ret = PTR_ERR(pool->thread);
280 goto out_free_pool; 276 goto out_free_pool;
281 } 277 }
@@ -294,11 +290,8 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
294 290
295 for (i = 0; i < params->pool_size; ++i) { 291 for (i = 0; i < params->pool_size; ++i) {
296 fmr = kmalloc(bytes_per_fmr, GFP_KERNEL); 292 fmr = kmalloc(bytes_per_fmr, GFP_KERNEL);
297 if (!fmr) { 293 if (!fmr)
298 printk(KERN_WARNING PFX "failed to allocate fmr "
299 "struct for FMR %d\n", i);
300 goto out_fail; 294 goto out_fail;
301 }
302 295
303 fmr->pool = pool; 296 fmr->pool = pool;
304 fmr->remap_count = 0; 297 fmr->remap_count = 0;
@@ -307,8 +300,8 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
307 300
308 fmr->fmr = ib_alloc_fmr(pd, params->access, &fmr_attr); 301 fmr->fmr = ib_alloc_fmr(pd, params->access, &fmr_attr);
309 if (IS_ERR(fmr->fmr)) { 302 if (IS_ERR(fmr->fmr)) {
310 printk(KERN_WARNING PFX "fmr_create failed " 303 pr_warn(PFX "fmr_create failed for FMR %d\n",
311 "for FMR %d\n", i); 304 i);
312 kfree(fmr); 305 kfree(fmr);
313 goto out_fail; 306 goto out_fail;
314 } 307 }
@@ -363,8 +356,8 @@ void ib_destroy_fmr_pool(struct ib_fmr_pool *pool)
363 } 356 }
364 357
365 if (i < pool->pool_size) 358 if (i < pool->pool_size)
366 printk(KERN_WARNING PFX "pool still has %d regions registered\n", 359 pr_warn(PFX "pool still has %d regions registered\n",
367 pool->pool_size - i); 360 pool->pool_size - i);
368 361
369 kfree(pool->cache_bucket); 362 kfree(pool->cache_bucket);
370 kfree(pool); 363 kfree(pool);
@@ -463,7 +456,7 @@ struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle,
463 list_add(&fmr->list, &pool->free_list); 456 list_add(&fmr->list, &pool->free_list);
464 spin_unlock_irqrestore(&pool->pool_lock, flags); 457 spin_unlock_irqrestore(&pool->pool_lock, flags);
465 458
466 printk(KERN_WARNING PFX "fmr_map returns %d\n", result); 459 pr_warn(PFX "fmr_map returns %d\n", result);
467 460
468 return ERR_PTR(result); 461 return ERR_PTR(result);
469 } 462 }
@@ -517,8 +510,8 @@ int ib_fmr_pool_unmap(struct ib_pool_fmr *fmr)
517 510
518#ifdef DEBUG 511#ifdef DEBUG
519 if (fmr->ref_count < 0) 512 if (fmr->ref_count < 0)
520 printk(KERN_WARNING PFX "FMR %p has ref count %d < 0\n", 513 pr_warn(PFX "FMR %p has ref count %d < 0\n",
521 fmr, fmr->ref_count); 514 fmr, fmr->ref_count);
522#endif 515#endif
523 516
524 spin_unlock_irqrestore(&pool->pool_lock, flags); 517 spin_unlock_irqrestore(&pool->pool_lock, flags);
diff --git a/drivers/infiniband/core/packer.c b/drivers/infiniband/core/packer.c
index 1b65986c0be3..19b1ee3279b4 100644
--- a/drivers/infiniband/core/packer.c
+++ b/drivers/infiniband/core/packer.c
@@ -44,7 +44,7 @@ static u64 value_read(int offset, int size, void *structure)
44 case 4: return be32_to_cpup((__be32 *) (structure + offset)); 44 case 4: return be32_to_cpup((__be32 *) (structure + offset));
45 case 8: return be64_to_cpup((__be64 *) (structure + offset)); 45 case 8: return be64_to_cpup((__be64 *) (structure + offset));
46 default: 46 default:
47 printk(KERN_WARNING "Field size %d bits not handled\n", size * 8); 47 pr_warn("Field size %d bits not handled\n", size * 8);
48 return 0; 48 return 0;
49 } 49 }
50} 50}
@@ -104,9 +104,8 @@ void ib_pack(const struct ib_field *desc,
104 } else { 104 } else {
105 if (desc[i].offset_bits % 8 || 105 if (desc[i].offset_bits % 8 ||
106 desc[i].size_bits % 8) { 106 desc[i].size_bits % 8) {
107 printk(KERN_WARNING "Structure field %s of size %d " 107 pr_warn("Structure field %s of size %d bits is not byte-aligned\n",
108 "bits is not byte-aligned\n", 108 desc[i].field_name, desc[i].size_bits);
109 desc[i].field_name, desc[i].size_bits);
110 } 109 }
111 110
112 if (desc[i].struct_size_bytes) 111 if (desc[i].struct_size_bytes)
@@ -132,7 +131,7 @@ static void value_write(int offset, int size, u64 val, void *structure)
132 case 32: *(__be32 *) (structure + offset) = cpu_to_be32(val); break; 131 case 32: *(__be32 *) (structure + offset) = cpu_to_be32(val); break;
133 case 64: *(__be64 *) (structure + offset) = cpu_to_be64(val); break; 132 case 64: *(__be64 *) (structure + offset) = cpu_to_be64(val); break;
134 default: 133 default:
135 printk(KERN_WARNING "Field size %d bits not handled\n", size * 8); 134 pr_warn("Field size %d bits not handled\n", size * 8);
136 } 135 }
137} 136}
138 137
@@ -188,9 +187,8 @@ void ib_unpack(const struct ib_field *desc,
188 } else { 187 } else {
189 if (desc[i].offset_bits % 8 || 188 if (desc[i].offset_bits % 8 ||
190 desc[i].size_bits % 8) { 189 desc[i].size_bits % 8) {
191 printk(KERN_WARNING "Structure field %s of size %d " 190 pr_warn("Structure field %s of size %d bits is not byte-aligned\n",
192 "bits is not byte-aligned\n", 191 desc[i].field_name, desc[i].size_bits);
193 desc[i].field_name, desc[i].size_bits);
194 } 192 }
195 193
196 memcpy(structure + desc[i].struct_offset_bytes, 194 memcpy(structure + desc[i].struct_offset_bytes,
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c
index 4b3ac765d08d..8e3bf6c8d3c3 100644
--- a/drivers/infiniband/core/sa_query.c
+++ b/drivers/infiniband/core/sa_query.c
@@ -864,13 +864,12 @@ static void update_sm_ah(struct work_struct *work)
864 struct ib_ah_attr ah_attr; 864 struct ib_ah_attr ah_attr;
865 865
866 if (ib_query_port(port->agent->device, port->port_num, &port_attr)) { 866 if (ib_query_port(port->agent->device, port->port_num, &port_attr)) {
867 printk(KERN_WARNING "Couldn't query port\n"); 867 pr_warn("Couldn't query port\n");
868 return; 868 return;
869 } 869 }
870 870
871 new_ah = kmalloc(sizeof *new_ah, GFP_KERNEL); 871 new_ah = kmalloc(sizeof *new_ah, GFP_KERNEL);
872 if (!new_ah) { 872 if (!new_ah) {
873 printk(KERN_WARNING "Couldn't allocate new SM AH\n");
874 return; 873 return;
875 } 874 }
876 875
@@ -880,7 +879,7 @@ static void update_sm_ah(struct work_struct *work)
880 new_ah->pkey_index = 0; 879 new_ah->pkey_index = 0;
881 if (ib_find_pkey(port->agent->device, port->port_num, 880 if (ib_find_pkey(port->agent->device, port->port_num,
882 IB_DEFAULT_PKEY_FULL, &new_ah->pkey_index)) 881 IB_DEFAULT_PKEY_FULL, &new_ah->pkey_index))
883 printk(KERN_ERR "Couldn't find index for default PKey\n"); 882 pr_err("Couldn't find index for default PKey\n");
884 883
885 memset(&ah_attr, 0, sizeof ah_attr); 884 memset(&ah_attr, 0, sizeof ah_attr);
886 ah_attr.dlid = port_attr.sm_lid; 885 ah_attr.dlid = port_attr.sm_lid;
@@ -889,7 +888,7 @@ static void update_sm_ah(struct work_struct *work)
889 888
890 new_ah->ah = ib_create_ah(port->agent->qp->pd, &ah_attr); 889 new_ah->ah = ib_create_ah(port->agent->qp->pd, &ah_attr);
891 if (IS_ERR(new_ah->ah)) { 890 if (IS_ERR(new_ah->ah)) {
892 printk(KERN_WARNING "Couldn't create new SM AH\n"); 891 pr_warn("Couldn't create new SM AH\n");
893 kfree(new_ah); 892 kfree(new_ah);
894 return; 893 return;
895 } 894 }
@@ -1800,13 +1799,13 @@ static int __init ib_sa_init(void)
1800 1799
1801 ret = ib_register_client(&sa_client); 1800 ret = ib_register_client(&sa_client);
1802 if (ret) { 1801 if (ret) {
1803 printk(KERN_ERR "Couldn't register ib_sa client\n"); 1802 pr_err("Couldn't register ib_sa client\n");
1804 goto err1; 1803 goto err1;
1805 } 1804 }
1806 1805
1807 ret = mcast_init(); 1806 ret = mcast_init();
1808 if (ret) { 1807 if (ret) {
1809 printk(KERN_ERR "Couldn't initialize multicast handling\n"); 1808 pr_err("Couldn't initialize multicast handling\n");
1810 goto err2; 1809 goto err2;
1811 } 1810 }
1812 1811
diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c
index 6b4e8a008bc0..4a9aa0433b07 100644
--- a/drivers/infiniband/core/ucm.c
+++ b/drivers/infiniband/core/ucm.c
@@ -1234,7 +1234,7 @@ static int find_overflow_devnum(void)
1234 ret = alloc_chrdev_region(&overflow_maj, 0, IB_UCM_MAX_DEVICES, 1234 ret = alloc_chrdev_region(&overflow_maj, 0, IB_UCM_MAX_DEVICES,
1235 "infiniband_cm"); 1235 "infiniband_cm");
1236 if (ret) { 1236 if (ret) {
1237 printk(KERN_ERR "ucm: couldn't register dynamic device number\n"); 1237 pr_err("ucm: couldn't register dynamic device number\n");
1238 return ret; 1238 return ret;
1239 } 1239 }
1240 } 1240 }
@@ -1329,19 +1329,19 @@ static int __init ib_ucm_init(void)
1329 ret = register_chrdev_region(IB_UCM_BASE_DEV, IB_UCM_MAX_DEVICES, 1329 ret = register_chrdev_region(IB_UCM_BASE_DEV, IB_UCM_MAX_DEVICES,
1330 "infiniband_cm"); 1330 "infiniband_cm");
1331 if (ret) { 1331 if (ret) {
1332 printk(KERN_ERR "ucm: couldn't register device number\n"); 1332 pr_err("ucm: couldn't register device number\n");
1333 goto error1; 1333 goto error1;
1334 } 1334 }
1335 1335
1336 ret = class_create_file(&cm_class, &class_attr_abi_version.attr); 1336 ret = class_create_file(&cm_class, &class_attr_abi_version.attr);
1337 if (ret) { 1337 if (ret) {
1338 printk(KERN_ERR "ucm: couldn't create abi_version attribute\n"); 1338 pr_err("ucm: couldn't create abi_version attribute\n");
1339 goto error2; 1339 goto error2;
1340 } 1340 }
1341 1341
1342 ret = ib_register_client(&ucm_client); 1342 ret = ib_register_client(&ucm_client);
1343 if (ret) { 1343 if (ret) {
1344 printk(KERN_ERR "ucm: couldn't register client\n"); 1344 pr_err("ucm: couldn't register client\n");
1345 goto error3; 1345 goto error3;
1346 } 1346 }
1347 return 0; 1347 return 0;
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
index 8b5a934e1133..dd3bcceadfde 100644
--- a/drivers/infiniband/core/ucma.c
+++ b/drivers/infiniband/core/ucma.c
@@ -314,7 +314,7 @@ static void ucma_removal_event_handler(struct rdma_cm_id *cm_id)
314 } 314 }
315 } 315 }
316 if (!event_found) 316 if (!event_found)
317 printk(KERN_ERR "ucma_removal_event_handler: warning: connect request event wasn't found\n"); 317 pr_err("ucma_removal_event_handler: warning: connect request event wasn't found\n");
318} 318}
319 319
320static int ucma_event_handler(struct rdma_cm_id *cm_id, 320static int ucma_event_handler(struct rdma_cm_id *cm_id,
@@ -1716,13 +1716,13 @@ static int __init ucma_init(void)
1716 1716
1717 ret = device_create_file(ucma_misc.this_device, &dev_attr_abi_version); 1717 ret = device_create_file(ucma_misc.this_device, &dev_attr_abi_version);
1718 if (ret) { 1718 if (ret) {
1719 printk(KERN_ERR "rdma_ucm: couldn't create abi_version attr\n"); 1719 pr_err("rdma_ucm: couldn't create abi_version attr\n");
1720 goto err1; 1720 goto err1;
1721 } 1721 }
1722 1722
1723 ucma_ctl_table_hdr = register_net_sysctl(&init_net, "net/rdma_ucm", ucma_ctl_table); 1723 ucma_ctl_table_hdr = register_net_sysctl(&init_net, "net/rdma_ucm", ucma_ctl_table);
1724 if (!ucma_ctl_table_hdr) { 1724 if (!ucma_ctl_table_hdr) {
1725 printk(KERN_ERR "rdma_ucm: couldn't register sysctl paths\n"); 1725 pr_err("rdma_ucm: couldn't register sysctl paths\n");
1726 ret = -ENOMEM; 1726 ret = -ENOMEM;
1727 goto err2; 1727 goto err2;
1728 } 1728 }
diff --git a/drivers/infiniband/core/ud_header.c b/drivers/infiniband/core/ud_header.c
index 2116132568e7..29a45d2f8898 100644
--- a/drivers/infiniband/core/ud_header.c
+++ b/drivers/infiniband/core/ud_header.c
@@ -479,8 +479,8 @@ int ib_ud_header_unpack(void *buf,
479 buf += IB_LRH_BYTES; 479 buf += IB_LRH_BYTES;
480 480
481 if (header->lrh.link_version != 0) { 481 if (header->lrh.link_version != 0) {
482 printk(KERN_WARNING "Invalid LRH.link_version %d\n", 482 pr_warn("Invalid LRH.link_version %d\n",
483 header->lrh.link_version); 483 header->lrh.link_version);
484 return -EINVAL; 484 return -EINVAL;
485 } 485 }
486 486
@@ -496,20 +496,20 @@ int ib_ud_header_unpack(void *buf,
496 buf += IB_GRH_BYTES; 496 buf += IB_GRH_BYTES;
497 497
498 if (header->grh.ip_version != 6) { 498 if (header->grh.ip_version != 6) {
499 printk(KERN_WARNING "Invalid GRH.ip_version %d\n", 499 pr_warn("Invalid GRH.ip_version %d\n",
500 header->grh.ip_version); 500 header->grh.ip_version);
501 return -EINVAL; 501 return -EINVAL;
502 } 502 }
503 if (header->grh.next_header != 0x1b) { 503 if (header->grh.next_header != 0x1b) {
504 printk(KERN_WARNING "Invalid GRH.next_header 0x%02x\n", 504 pr_warn("Invalid GRH.next_header 0x%02x\n",
505 header->grh.next_header); 505 header->grh.next_header);
506 return -EINVAL; 506 return -EINVAL;
507 } 507 }
508 break; 508 break;
509 509
510 default: 510 default:
511 printk(KERN_WARNING "Invalid LRH.link_next_header %d\n", 511 pr_warn("Invalid LRH.link_next_header %d\n",
512 header->lrh.link_next_header); 512 header->lrh.link_next_header);
513 return -EINVAL; 513 return -EINVAL;
514 } 514 }
515 515
@@ -525,14 +525,13 @@ int ib_ud_header_unpack(void *buf,
525 header->immediate_present = 1; 525 header->immediate_present = 1;
526 break; 526 break;
527 default: 527 default:
528 printk(KERN_WARNING "Invalid BTH.opcode 0x%02x\n", 528 pr_warn("Invalid BTH.opcode 0x%02x\n", header->bth.opcode);
529 header->bth.opcode);
530 return -EINVAL; 529 return -EINVAL;
531 } 530 }
532 531
533 if (header->bth.transport_header_version != 0) { 532 if (header->bth.transport_header_version != 0) {
534 printk(KERN_WARNING "Invalid BTH.transport_header_version %d\n", 533 pr_warn("Invalid BTH.transport_header_version %d\n",
535 header->bth.transport_header_version); 534 header->bth.transport_header_version);
536 return -EINVAL; 535 return -EINVAL;
537 } 536 }
538 537
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index 8b299df0ee7b..28ba2cc81535 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -1056,7 +1056,7 @@ static int find_overflow_devnum(void)
1056 ret = alloc_chrdev_region(&overflow_maj, 0, IB_UVERBS_MAX_DEVICES, 1056 ret = alloc_chrdev_region(&overflow_maj, 0, IB_UVERBS_MAX_DEVICES,
1057 "infiniband_verbs"); 1057 "infiniband_verbs");
1058 if (ret) { 1058 if (ret) {
1059 printk(KERN_ERR "user_verbs: couldn't register dynamic device number\n"); 1059 pr_err("user_verbs: couldn't register dynamic device number\n");
1060 return ret; 1060 return ret;
1061 } 1061 }
1062 } 1062 }
@@ -1277,14 +1277,14 @@ static int __init ib_uverbs_init(void)
1277 ret = register_chrdev_region(IB_UVERBS_BASE_DEV, IB_UVERBS_MAX_DEVICES, 1277 ret = register_chrdev_region(IB_UVERBS_BASE_DEV, IB_UVERBS_MAX_DEVICES,
1278 "infiniband_verbs"); 1278 "infiniband_verbs");
1279 if (ret) { 1279 if (ret) {
1280 printk(KERN_ERR "user_verbs: couldn't register device number\n"); 1280 pr_err("user_verbs: couldn't register device number\n");
1281 goto out; 1281 goto out;
1282 } 1282 }
1283 1283
1284 uverbs_class = class_create(THIS_MODULE, "infiniband_verbs"); 1284 uverbs_class = class_create(THIS_MODULE, "infiniband_verbs");
1285 if (IS_ERR(uverbs_class)) { 1285 if (IS_ERR(uverbs_class)) {
1286 ret = PTR_ERR(uverbs_class); 1286 ret = PTR_ERR(uverbs_class);
1287 printk(KERN_ERR "user_verbs: couldn't create class infiniband_verbs\n"); 1287 pr_err("user_verbs: couldn't create class infiniband_verbs\n");
1288 goto out_chrdev; 1288 goto out_chrdev;
1289 } 1289 }
1290 1290
@@ -1292,13 +1292,13 @@ static int __init ib_uverbs_init(void)
1292 1292
1293 ret = class_create_file(uverbs_class, &class_attr_abi_version.attr); 1293 ret = class_create_file(uverbs_class, &class_attr_abi_version.attr);
1294 if (ret) { 1294 if (ret) {
1295 printk(KERN_ERR "user_verbs: couldn't create abi_version attribute\n"); 1295 pr_err("user_verbs: couldn't create abi_version attribute\n");
1296 goto out_class; 1296 goto out_class;
1297 } 1297 }
1298 1298
1299 ret = ib_register_client(&uverbs_client); 1299 ret = ib_register_client(&uverbs_client);
1300 if (ret) { 1300 if (ret) {
1301 printk(KERN_ERR "user_verbs: couldn't register client\n"); 1301 pr_err("user_verbs: couldn't register client\n");
1302 goto out_class; 1302 goto out_class;
1303 } 1303 }
1304 1304