提交 2e65835a 编写于 作者: L Leon Romanovsky 提交者: Doug Ledford

IB/nes: Remove debug prints after allocation failure

The prints after [k|v][m|z|c]alloc() functions are not needed,
because in case of failure, allocator will print their internal
error prints anyway.
Signed-off-by: NLeon Romanovsky <leon@kernel.org>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 c40a83b9
...@@ -516,7 +516,6 @@ static int nes_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) ...@@ -516,7 +516,6 @@ static int nes_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
/* Allocate hardware structure */ /* Allocate hardware structure */
nesdev = kzalloc(sizeof(struct nes_device), GFP_KERNEL); nesdev = kzalloc(sizeof(struct nes_device), GFP_KERNEL);
if (!nesdev) { if (!nesdev) {
printk(KERN_ERR PFX "%s: Unable to alloc hardware struct\n", pci_name(pcidev));
ret = -ENOMEM; ret = -ENOMEM;
goto bail2; goto bail2;
} }
......
...@@ -2282,10 +2282,8 @@ static struct nes_cm_listener *mini_cm_listen(struct nes_cm_core *cm_core, ...@@ -2282,10 +2282,8 @@ static struct nes_cm_listener *mini_cm_listen(struct nes_cm_core *cm_core,
if (!listener) { if (!listener) {
/* create a CM listen node (1/2 node to compare incoming traffic to) */ /* create a CM listen node (1/2 node to compare incoming traffic to) */
listener = kzalloc(sizeof(*listener), GFP_ATOMIC); listener = kzalloc(sizeof(*listener), GFP_ATOMIC);
if (!listener) { if (!listener)
nes_debug(NES_DBG_CM, "Not creating listener memory allocation failed\n");
return NULL; return NULL;
}
listener->loc_addr = cm_info->loc_addr; listener->loc_addr = cm_info->loc_addr;
listener->loc_port = cm_info->loc_port; listener->loc_port = cm_info->loc_port;
......
...@@ -351,9 +351,8 @@ struct nes_adapter *nes_init_adapter(struct nes_device *nesdev, u8 hw_rev) { ...@@ -351,9 +351,8 @@ struct nes_adapter *nes_init_adapter(struct nes_device *nesdev, u8 hw_rev) {
/* allocate a new adapter struct */ /* allocate a new adapter struct */
nesadapter = kzalloc(adapter_size, GFP_KERNEL); nesadapter = kzalloc(adapter_size, GFP_KERNEL);
if (nesadapter == NULL) { if (!nesadapter)
return NULL; return NULL;
}
nes_debug(NES_DBG_INIT, "Allocating new nesadapter @ %p, size = %u (actual size = %u).\n", nes_debug(NES_DBG_INIT, "Allocating new nesadapter @ %p, size = %u (actual size = %u).\n",
nesadapter, (u32)sizeof(struct nes_adapter), adapter_size); nesadapter, (u32)sizeof(struct nes_adapter), adapter_size);
...@@ -1007,8 +1006,7 @@ int nes_init_cqp(struct nes_device *nesdev) ...@@ -1007,8 +1006,7 @@ int nes_init_cqp(struct nes_device *nesdev)
/* Allocate a twice the number of CQP requests as the SQ size */ /* Allocate a twice the number of CQP requests as the SQ size */
nesdev->nes_cqp_requests = kzalloc(sizeof(struct nes_cqp_request) * nesdev->nes_cqp_requests = kzalloc(sizeof(struct nes_cqp_request) *
2 * NES_CQP_SQ_SIZE, GFP_KERNEL); 2 * NES_CQP_SQ_SIZE, GFP_KERNEL);
if (nesdev->nes_cqp_requests == NULL) { if (!nesdev->nes_cqp_requests) {
nes_debug(NES_DBG_INIT, "Unable to allocate memory CQP request entries.\n");
pci_free_consistent(nesdev->pcidev, nesdev->cqp_mem_size, nesdev->cqp.sq_vbase, pci_free_consistent(nesdev->pcidev, nesdev->cqp_mem_size, nesdev->cqp.sq_vbase,
nesdev->cqp.sq_pbase); nesdev->cqp.sq_pbase);
return -ENOMEM; return -ENOMEM;
......
...@@ -320,8 +320,7 @@ static int get_fpdu_info(struct nes_device *nesdev, struct nes_qp *nesqp, ...@@ -320,8 +320,7 @@ static int get_fpdu_info(struct nes_device *nesdev, struct nes_qp *nesqp,
/* Found one */ /* Found one */
fpdu_info = kzalloc(sizeof(*fpdu_info), GFP_ATOMIC); fpdu_info = kzalloc(sizeof(*fpdu_info), GFP_ATOMIC);
if (fpdu_info == NULL) { if (!fpdu_info) {
nes_debug(NES_DBG_PAU, "Failed to alloc a fpdu_info.\n");
rc = -ENOMEM; rc = -ENOMEM;
goto out; goto out;
} }
...@@ -729,8 +728,7 @@ static int nes_change_quad_hash(struct nes_device *nesdev, ...@@ -729,8 +728,7 @@ static int nes_change_quad_hash(struct nes_device *nesdev,
} }
qh_chg = kmalloc(sizeof *qh_chg, GFP_ATOMIC); qh_chg = kmalloc(sizeof *qh_chg, GFP_ATOMIC);
if (qh_chg == NULL) { if (!qh_chg) {
nes_debug(NES_DBG_PAU, "Failed to get a cqp_request.\n");
ret = -ENOMEM; ret = -ENOMEM;
goto chg_qh_err; goto chg_qh_err;
} }
...@@ -880,10 +878,8 @@ int nes_init_mgt_qp(struct nes_device *nesdev, struct net_device *netdev, struct ...@@ -880,10 +878,8 @@ int nes_init_mgt_qp(struct nes_device *nesdev, struct net_device *netdev, struct
/* Allocate space the all mgt QPs once */ /* Allocate space the all mgt QPs once */
mgtvnic = kzalloc(NES_MGT_QP_COUNT * sizeof(struct nes_vnic_mgt), GFP_KERNEL); mgtvnic = kzalloc(NES_MGT_QP_COUNT * sizeof(struct nes_vnic_mgt), GFP_KERNEL);
if (mgtvnic == NULL) { if (!mgtvnic)
nes_debug(NES_DBG_INIT, "Unable to allocate memory for mgt structure\n");
return -ENOMEM; return -ENOMEM;
}
/* Allocate fragment, RQ, and CQ; Reuse CEQ based on the PCI function */ /* Allocate fragment, RQ, and CQ; Reuse CEQ based on the PCI function */
/* We are not sending from this NIC so sq is not allocated */ /* We are not sending from this NIC so sq is not allocated */
......
...@@ -1075,7 +1075,6 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd, ...@@ -1075,7 +1075,6 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd,
mem = kzalloc(sizeof(*nesqp)+NES_SW_CONTEXT_ALIGN-1, GFP_KERNEL); mem = kzalloc(sizeof(*nesqp)+NES_SW_CONTEXT_ALIGN-1, GFP_KERNEL);
if (!mem) { if (!mem) {
nes_free_resource(nesadapter, nesadapter->allocated_qps, qp_num); nes_free_resource(nesadapter, nesadapter->allocated_qps, qp_num);
nes_debug(NES_DBG_QP, "Unable to allocate QP\n");
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
} }
u64nesqp = (unsigned long)mem; u64nesqp = (unsigned long)mem;
...@@ -1475,7 +1474,6 @@ static struct ib_cq *nes_create_cq(struct ib_device *ibdev, ...@@ -1475,7 +1474,6 @@ static struct ib_cq *nes_create_cq(struct ib_device *ibdev,
nescq = kzalloc(sizeof(struct nes_cq), GFP_KERNEL); nescq = kzalloc(sizeof(struct nes_cq), GFP_KERNEL);
if (!nescq) { if (!nescq) {
nes_free_resource(nesadapter, nesadapter->allocated_cqs, cq_num); nes_free_resource(nesadapter, nesadapter->allocated_cqs, cq_num);
nes_debug(NES_DBG_CQ, "Unable to allocate nes_cq struct\n");
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
} }
...@@ -2408,7 +2406,6 @@ static struct ib_mr *nes_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, ...@@ -2408,7 +2406,6 @@ static struct ib_mr *nes_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
} }
nespbl = kzalloc(sizeof(*nespbl), GFP_KERNEL); nespbl = kzalloc(sizeof(*nespbl), GFP_KERNEL);
if (!nespbl) { if (!nespbl) {
nes_debug(NES_DBG_MR, "Unable to allocate PBL\n");
ib_umem_release(region); ib_umem_release(region);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
} }
...@@ -2416,7 +2413,6 @@ static struct ib_mr *nes_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, ...@@ -2416,7 +2413,6 @@ static struct ib_mr *nes_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
if (!nesmr) { if (!nesmr) {
ib_umem_release(region); ib_umem_release(region);
kfree(nespbl); kfree(nespbl);
nes_debug(NES_DBG_MR, "Unable to allocate nesmr\n");
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
} }
nesmr->region = region; nesmr->region = region;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册