IB/nes: Remove debug prints after allocation failure
authorLeon Romanovsky <leon@kernel.org>
Thu, 3 Nov 2016 14:44:19 +0000 (16:44 +0200)
committerDoug Ledford <dledford@redhat.com>
Sat, 3 Dec 2016 18:12:52 +0000 (13:12 -0500)
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: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/nes/nes.c
drivers/infiniband/hw/nes/nes_cm.c
drivers/infiniband/hw/nes/nes_hw.c
drivers/infiniband/hw/nes/nes_mgt.c
drivers/infiniband/hw/nes/nes_verbs.c

index 35cbb17bec12d93771917bfd92aa537a031443a7..9badd0224ec58ab000ee053345d4e211b86915ad 100644 (file)
@@ -516,7 +516,6 @@ static int nes_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
        /* Allocate hardware structure */
        nesdev = kzalloc(sizeof(struct nes_device), GFP_KERNEL);
        if (!nesdev) {
-               printk(KERN_ERR PFX "%s: Unable to alloc hardware struct\n", pci_name(pcidev));
                ret = -ENOMEM;
                goto bail2;
        }
index 57db9b332f446f87297d5753fce3769215d03aac..8e703479e7ce65044633953803c8114789ac3bc0 100644 (file)
@@ -2282,10 +2282,8 @@ static struct nes_cm_listener *mini_cm_listen(struct nes_cm_core *cm_core,
        if (!listener) {
                /* create a CM listen node (1/2 node to compare incoming traffic to) */
                listener = kzalloc(sizeof(*listener), GFP_ATOMIC);
-               if (!listener) {
-                       nes_debug(NES_DBG_CM, "Not creating listener memory allocation failed\n");
+               if (!listener)
                        return NULL;
-               }
 
                listener->loc_addr = cm_info->loc_addr;
                listener->loc_port = cm_info->loc_port;
index a1c6481d8038b5611736da10ee8ee0e30e05928f..19acd13c6cb1aed2dfe687f08c8b61ac59a18a1f 100644 (file)
@@ -351,9 +351,8 @@ struct nes_adapter *nes_init_adapter(struct nes_device *nesdev, u8 hw_rev) {
 
        /* allocate a new adapter struct */
        nesadapter = kzalloc(adapter_size, GFP_KERNEL);
-       if (nesadapter == NULL) {
+       if (!nesadapter)
                return NULL;
-       }
 
        nes_debug(NES_DBG_INIT, "Allocating new nesadapter @ %p, size = %u (actual size = %u).\n",
                        nesadapter, (u32)sizeof(struct nes_adapter), adapter_size);
@@ -1007,8 +1006,7 @@ int nes_init_cqp(struct nes_device *nesdev)
        /* Allocate a twice the number of CQP requests as the SQ size */
        nesdev->nes_cqp_requests = kzalloc(sizeof(struct nes_cqp_request) *
                        2 * NES_CQP_SQ_SIZE, GFP_KERNEL);
-       if (nesdev->nes_cqp_requests == NULL) {
-               nes_debug(NES_DBG_INIT, "Unable to allocate memory CQP request entries.\n");
+       if (!nesdev->nes_cqp_requests) {
                pci_free_consistent(nesdev->pcidev, nesdev->cqp_mem_size, nesdev->cqp.sq_vbase,
                                nesdev->cqp.sq_pbase);
                return -ENOMEM;
index 416645259b0f84b6a444596e7c8acc85189d6c84..33624f17c347995616750f3e10c426d4b3e22ccf 100644 (file)
@@ -320,8 +320,7 @@ static int get_fpdu_info(struct nes_device *nesdev, struct nes_qp *nesqp,
 
        /* Found one */
        fpdu_info = kzalloc(sizeof(*fpdu_info), GFP_ATOMIC);
-       if (fpdu_info == NULL) {
-               nes_debug(NES_DBG_PAU, "Failed to alloc a fpdu_info.\n");
+       if (!fpdu_info) {
                rc = -ENOMEM;
                goto out;
        }
@@ -729,8 +728,7 @@ static int nes_change_quad_hash(struct nes_device *nesdev,
        }
 
        qh_chg = kmalloc(sizeof *qh_chg, GFP_ATOMIC);
-       if (qh_chg == NULL) {
-               nes_debug(NES_DBG_PAU, "Failed to get a cqp_request.\n");
+       if (!qh_chg) {
                ret = -ENOMEM;
                goto chg_qh_err;
        }
@@ -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 */
        mgtvnic = kzalloc(NES_MGT_QP_COUNT * sizeof(struct nes_vnic_mgt), GFP_KERNEL);
-       if (mgtvnic == NULL) {
-               nes_debug(NES_DBG_INIT, "Unable to allocate memory for mgt structure\n");
+       if (!mgtvnic)
                return -ENOMEM;
-       }
 
        /* Allocate fragment, RQ, and CQ; Reuse CEQ based on the PCI function */
        /* We are not sending from this NIC so sq is not allocated */
index bd69125731c1816245fc90c2bfe7d4cbffb8c02a..42ab31d06ef9aac2e264c360e47ee86480acb6f9 100644 (file)
@@ -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);
                        if (!mem) {
                                nes_free_resource(nesadapter, nesadapter->allocated_qps, qp_num);
-                               nes_debug(NES_DBG_QP, "Unable to allocate QP\n");
                                return ERR_PTR(-ENOMEM);
                        }
                        u64nesqp = (unsigned long)mem;
@@ -1475,7 +1474,6 @@ static struct ib_cq *nes_create_cq(struct ib_device *ibdev,
        nescq = kzalloc(sizeof(struct nes_cq), GFP_KERNEL);
        if (!nescq) {
                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);
        }
 
@@ -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);
                        if (!nespbl) {
-                               nes_debug(NES_DBG_MR, "Unable to allocate PBL\n");
                                ib_umem_release(region);
                                return ERR_PTR(-ENOMEM);
                        }
@@ -2416,7 +2413,6 @@ static struct ib_mr *nes_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
                        if (!nesmr) {
                                ib_umem_release(region);
                                kfree(nespbl);
-                               nes_debug(NES_DBG_MR, "Unable to allocate nesmr\n");
                                return ERR_PTR(-ENOMEM);
                        }
                        nesmr->region = region;