diff mbox

[11/26] IB/ocrdma: Delete unnecessary braces

Message ID c4c62b82-db2a-3db9-03c4-9f8d95a6a29b@users.sourceforge.net (mailing list archive)
State Changes Requested
Headers show

Commit Message

SF Markus Elfring March 8, 2017, 1:04 p.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 7 Mar 2017 21:12:56 +0100

Do not use curly brackets at some source code places
where a single statement should be sufficient.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

Comments

Yuval Shaia March 8, 2017, 2:24 p.m. UTC | #1
On Wed, Mar 08, 2017 at 02:04:56PM +0100, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 7 Mar 2017 21:12:56 +0100
> 
> Do not use curly brackets at some source code places
> where a single statement should be sufficient.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 17 ++++++++---------
>  1 file changed, 8 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
> index aa32bc9f323d..d5b988b011d1 100644
> --- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
> +++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
> @@ -1092,14 +1092,14 @@ static int ocrdma_mbx_cmd(struct ocrdma_dev *dev, struct ocrdma_mqe *mqe)
>  	if (cqe_status || ext_status) {
>  		pr_err("%s() cqe_status=0x%x, ext_status=0x%x,",
>  		       __func__, cqe_status, ext_status);
> -		if (rsp) {
> +		if (rsp)
>  			/* This is for embedded cmds. */
>  			pr_err("opcode=0x%x, subsystem=0x%x\n",
>  			       (rsp->subsys_op & OCRDMA_MBX_RSP_OPCODE_MASK) >>
>  				OCRDMA_MBX_RSP_OPCODE_SHIFT,
>  				(rsp->subsys_op & OCRDMA_MBX_RSP_SUBSYS_MASK) >>
>  				OCRDMA_MBX_RSP_SUBSYS_SHIFT);
> -		}
> +

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

>  		status = ocrdma_get_mbx_cqe_errno(cqe_status);
>  		goto mbx_err;
>  	}
> @@ -1600,10 +1600,9 @@ void ocrdma_alloc_pd_pool(struct ocrdma_dev *dev)
>  		return;
>  
>  	status = ocrdma_mbx_alloc_pd_range(dev);
> -	if (status) {
> +	if (status)
>  		pr_err("%s(%d) Unable to initialize PD pool, using default.\n",
>  			 __func__, dev->id);
> -	}
>  }
>  
>  static void ocrdma_free_pd_pool(struct ocrdma_dev *dev)
> @@ -2997,11 +2996,10 @@ static int ocrdma_parse_dcbxcfg_rsp(struct ocrdma_dev *dev, int ptype,
>  					goto out;
>  				}
>  			}
> -			if (slindx == OCRDMA_MAX_SERVICE_LEVEL_INDEX) {
> +			if (slindx == OCRDMA_MAX_SERVICE_LEVEL_INDEX)
>  				pr_info("%s ocrdma%d application priority not set for 0x%x protocol\n",
>  					dev_name(&dev->nic_info.pdev->dev),
>  					dev->id, proto);
> -			}
>  		}
>  	}
>  
> @@ -3158,16 +3156,17 @@ static int ocrdma_modify_eqd(struct ocrdma_dev *dev, struct ocrdma_eq *eq,
>  			     int num)
>  {
>  	int num_eqs, i = 0;
> -	if (num > 8) {
> +
> +	if (num > 8)
>  		while (num) {
>  			num_eqs = min(num, 8);
>  			ocrdma_mbx_modify_eqd(dev, &eq[i], num_eqs);
>  			i += num_eqs;
>  			num -= num_eqs;
>  		}
> -	} else {
> +	else
>  		ocrdma_mbx_modify_eqd(dev, eq, num);
> -	}
> +
>  	return 0;
>  }
>  
> -- 
> 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
Devesh Sharma March 8, 2017, 2:59 p.m. UTC | #2
On Wed, Mar 8, 2017 at 6:34 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 7 Mar 2017 21:12:56 +0100
>
> Do not use curly brackets at some source code places
> where a single statement should be sufficient.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 17 ++++++++---------
>  1 file changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
> index aa32bc9f323d..d5b988b011d1 100644
> --- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
> +++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
> @@ -1092,14 +1092,14 @@ static int ocrdma_mbx_cmd(struct ocrdma_dev *dev, struct ocrdma_mqe *mqe)
>         if (cqe_status || ext_status) {
>                 pr_err("%s() cqe_status=0x%x, ext_status=0x%x,",
>                        __func__, cqe_status, ext_status);
> -               if (rsp) {
> +               if (rsp)
>                         /* This is for embedded cmds. */
>                         pr_err("opcode=0x%x, subsystem=0x%x\n",
>                                (rsp->subsys_op & OCRDMA_MBX_RSP_OPCODE_MASK) >>
>                                 OCRDMA_MBX_RSP_OPCODE_SHIFT,
>                                 (rsp->subsys_op & OCRDMA_MBX_RSP_SUBSYS_MASK) >>
>                                 OCRDMA_MBX_RSP_SUBSYS_SHIFT);
> -               }
> +
>                 status = ocrdma_get_mbx_cqe_errno(cqe_status);
>                 goto mbx_err;
>         }
> @@ -1600,10 +1600,9 @@ void ocrdma_alloc_pd_pool(struct ocrdma_dev *dev)
>                 return;
>
>         status = ocrdma_mbx_alloc_pd_range(dev);
> -       if (status) {
> +       if (status)
>                 pr_err("%s(%d) Unable to initialize PD pool, using default.\n",
>                          __func__, dev->id);
> -       }
>  }
>
>  static void ocrdma_free_pd_pool(struct ocrdma_dev *dev)
> @@ -2997,11 +2996,10 @@ static int ocrdma_parse_dcbxcfg_rsp(struct ocrdma_dev *dev, int ptype,
>                                         goto out;
>                                 }
>                         }
> -                       if (slindx == OCRDMA_MAX_SERVICE_LEVEL_INDEX) {
> +                       if (slindx == OCRDMA_MAX_SERVICE_LEVEL_INDEX)
>                                 pr_info("%s ocrdma%d application priority not set for 0x%x protocol\n",
>                                         dev_name(&dev->nic_info.pdev->dev),
>                                         dev->id, proto);
> -                       }
>                 }
>         }
>
> @@ -3158,16 +3156,17 @@ static int ocrdma_modify_eqd(struct ocrdma_dev *dev, struct ocrdma_eq *eq,
>                              int num)
>  {
>         int num_eqs, i = 0;
> -       if (num > 8) {
> +
> +       if (num > 8)
>                 while (num) {
>                         num_eqs = min(num, 8);
>                         ocrdma_mbx_modify_eqd(dev, &eq[i], num_eqs);
>                         i += num_eqs;
>                         num -= num_eqs;
>                 }

May be compiler would give you a warning here, could you check once?

> -       } else {
> +       else
>                 ocrdma_mbx_modify_eqd(dev, eq, num);
> -       }
> +
>         return 0;
>  }
>
> --
> 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
diff mbox

Patch

diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
index aa32bc9f323d..d5b988b011d1 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
@@ -1092,14 +1092,14 @@  static int ocrdma_mbx_cmd(struct ocrdma_dev *dev, struct ocrdma_mqe *mqe)
 	if (cqe_status || ext_status) {
 		pr_err("%s() cqe_status=0x%x, ext_status=0x%x,",
 		       __func__, cqe_status, ext_status);
-		if (rsp) {
+		if (rsp)
 			/* This is for embedded cmds. */
 			pr_err("opcode=0x%x, subsystem=0x%x\n",
 			       (rsp->subsys_op & OCRDMA_MBX_RSP_OPCODE_MASK) >>
 				OCRDMA_MBX_RSP_OPCODE_SHIFT,
 				(rsp->subsys_op & OCRDMA_MBX_RSP_SUBSYS_MASK) >>
 				OCRDMA_MBX_RSP_SUBSYS_SHIFT);
-		}
+
 		status = ocrdma_get_mbx_cqe_errno(cqe_status);
 		goto mbx_err;
 	}
@@ -1600,10 +1600,9 @@  void ocrdma_alloc_pd_pool(struct ocrdma_dev *dev)
 		return;
 
 	status = ocrdma_mbx_alloc_pd_range(dev);
-	if (status) {
+	if (status)
 		pr_err("%s(%d) Unable to initialize PD pool, using default.\n",
 			 __func__, dev->id);
-	}
 }
 
 static void ocrdma_free_pd_pool(struct ocrdma_dev *dev)
@@ -2997,11 +2996,10 @@  static int ocrdma_parse_dcbxcfg_rsp(struct ocrdma_dev *dev, int ptype,
 					goto out;
 				}
 			}
-			if (slindx == OCRDMA_MAX_SERVICE_LEVEL_INDEX) {
+			if (slindx == OCRDMA_MAX_SERVICE_LEVEL_INDEX)
 				pr_info("%s ocrdma%d application priority not set for 0x%x protocol\n",
 					dev_name(&dev->nic_info.pdev->dev),
 					dev->id, proto);
-			}
 		}
 	}
 
@@ -3158,16 +3156,17 @@  static int ocrdma_modify_eqd(struct ocrdma_dev *dev, struct ocrdma_eq *eq,
 			     int num)
 {
 	int num_eqs, i = 0;
-	if (num > 8) {
+
+	if (num > 8)
 		while (num) {
 			num_eqs = min(num, 8);
 			ocrdma_mbx_modify_eqd(dev, &eq[i], num_eqs);
 			i += num_eqs;
 			num -= num_eqs;
 		}
-	} else {
+	else
 		ocrdma_mbx_modify_eqd(dev, eq, num);
-	}
+
 	return 0;
 }