diff mbox

[15/26] IB/ocrdma: Delete an error message for a failed memory allocation in ocrdma_add()

Message ID 20d97719-3d3a-62f6-a249-f39cf528c5e9@users.sourceforge.net (mailing list archive)
State Changes Requested
Headers show

Commit Message

SF Markus Elfring March 8, 2017, 1:13 p.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 7 Mar 2017 22:23:17 +0100

Omit an extra message for a memory allocation failure in this function.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/infiniband/hw/ocrdma/ocrdma_main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Devesh Sharma March 8, 2017, 3:03 p.m. UTC | #1
Acked-By: Devesh sharma <devesh.sharma@broadcom.com>

On Wed, Mar 8, 2017 at 6:43 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 7 Mar 2017 22:23:17 +0100
>
> Omit an extra message for a memory allocation failure in this function.
>
> Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/infiniband/hw/ocrdma/ocrdma_main.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c
> index c49b4491d4e7..93113feeb2d5 100644
> --- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c
> +++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c
> @@ -304,10 +304,9 @@ static struct ocrdma_dev *ocrdma_add(struct be_dev_info *dev_info)
>         struct ocrdma_dev *dev;
>
>         dev = (struct ocrdma_dev *)ib_alloc_device(sizeof(*dev));
> -       if (!dev) {
> -               pr_err("Unable to allocate ib device\n");
> +       if (!dev)
>                 return NULL;
> -       }
> +
>         dev->mbx_cmd = kzalloc(sizeof(struct ocrdma_mqe_emb_cmd), GFP_KERNEL);
>         if (!dev->mbx_cmd)
>                 goto idr_err;
> --
> 2.12.0
>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Yuval Shaia March 8, 2017, 3:26 p.m. UTC | #2
On Wed, Mar 08, 2017 at 02:13:11PM +0100, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 7 Mar 2017 22:23:17 +0100
> 
> Omit an extra message for a memory allocation failure in this function.
> 
> Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf

Suggesting to add blank line here.

> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/infiniband/hw/ocrdma/ocrdma_main.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c
> index c49b4491d4e7..93113feeb2d5 100644
> --- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c
> +++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c
> @@ -304,10 +304,9 @@ static struct ocrdma_dev *ocrdma_add(struct be_dev_info *dev_info)
>  	struct ocrdma_dev *dev;
>  
>  	dev = (struct ocrdma_dev *)ib_alloc_device(sizeof(*dev));
> -	if (!dev) {
> -		pr_err("Unable to allocate ib device\n");
> +	if (!dev)
>  		return NULL;
> -	}
> +

Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>

>  	dev->mbx_cmd = kzalloc(sizeof(struct ocrdma_mqe_emb_cmd), GFP_KERNEL);
>  	if (!dev->mbx_cmd)
>  		goto idr_err;
> -- 
> 2.12.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c
index c49b4491d4e7..93113feeb2d5 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c
@@ -304,10 +304,9 @@  static struct ocrdma_dev *ocrdma_add(struct be_dev_info *dev_info)
 	struct ocrdma_dev *dev;
 
 	dev = (struct ocrdma_dev *)ib_alloc_device(sizeof(*dev));
-	if (!dev) {
-		pr_err("Unable to allocate ib device\n");
+	if (!dev)
 		return NULL;
-	}
+
 	dev->mbx_cmd = kzalloc(sizeof(struct ocrdma_mqe_emb_cmd), GFP_KERNEL);
 	if (!dev->mbx_cmd)
 		goto idr_err;