All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] IB/isert: remove unneeded new lines
@ 2021-01-10 11:19 Max Gurtovoy
  2021-01-10 11:19 ` [PATCH 2/3] IB/isert: remove unneeded semicolon Max Gurtovoy
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Max Gurtovoy @ 2021-01-10 11:19 UTC (permalink / raw)
  To: linux-rdma, dledford, jgg, leonro, sagi
  Cc: oren, Max Gurtovoy, Israel Rukshin

The Linux convention is to have only 1 new line between functions.

Reviewed-by: Israel Rukshin <israelr@nvidia.com>
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
 drivers/infiniband/ulp/isert/ib_isert.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 2ba27221ea85..5958929b7dec 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -71,7 +71,6 @@ static int isert_sg_tablesize_set(const char *val, const struct kernel_param *kp
 	return param_set_int(val, kp);
 }
 
-
 static inline bool
 isert_prot_cmd(struct isert_conn *conn, struct se_cmd *cmd)
 {
@@ -79,7 +78,6 @@ isert_prot_cmd(struct isert_conn *conn, struct se_cmd *cmd)
 		cmd->prot_op != TARGET_PROT_NORMAL);
 }
 
-
 static void
 isert_qp_event_callback(struct ib_event *e, void *context)
 {
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/3] IB/isert: remove unneeded semicolon
  2021-01-10 11:19 [PATCH 1/3] IB/isert: remove unneeded new lines Max Gurtovoy
@ 2021-01-10 11:19 ` Max Gurtovoy
  2021-01-10 11:36   ` Leon Romanovsky
  2021-01-14  0:07   ` Sagi Grimberg
  2021-01-10 11:19 ` [PATCH 3/3] IB/isert: simplify signature cap check Max Gurtovoy
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 14+ messages in thread
From: Max Gurtovoy @ 2021-01-10 11:19 UTC (permalink / raw)
  To: linux-rdma, dledford, jgg, leonro, sagi
  Cc: oren, Max Gurtovoy, Israel Rukshin

No need to add semicolon after closing bracket.

Reviewed-by: Israel Rukshin <israelr@nvidia.com>
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
 drivers/infiniband/ulp/isert/ib_isert.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 5958929b7dec..96514f675427 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -1991,7 +1991,7 @@ isert_set_dif_domain(struct se_cmd *se_cmd, struct ib_sig_domain *domain)
 	if (se_cmd->prot_type == TARGET_DIF_TYPE1_PROT ||
 	    se_cmd->prot_type == TARGET_DIF_TYPE2_PROT)
 		domain->sig.dif.ref_remap = true;
-};
+}
 
 static int
 isert_set_sig_attrs(struct se_cmd *se_cmd, struct ib_sig_attrs *sig_attrs)
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/3] IB/isert: simplify signature cap check
  2021-01-10 11:19 [PATCH 1/3] IB/isert: remove unneeded new lines Max Gurtovoy
  2021-01-10 11:19 ` [PATCH 2/3] IB/isert: remove unneeded semicolon Max Gurtovoy
@ 2021-01-10 11:19 ` Max Gurtovoy
  2021-01-14  0:08   ` Sagi Grimberg
  2021-01-14  0:06 ` [PATCH 1/3] IB/isert: remove unneeded new lines Sagi Grimberg
  2021-01-18 21:02 ` Jason Gunthorpe
  3 siblings, 1 reply; 14+ messages in thread
From: Max Gurtovoy @ 2021-01-10 11:19 UTC (permalink / raw)
  To: linux-rdma, dledford, jgg, leonro, sagi
  Cc: oren, Max Gurtovoy, Israel Rukshin

Use if/else clause instead of "condition ? val1 : val2" to make the code
cleaner and simpler.

Reviewed-by: Israel Rukshin <israelr@nvidia.com>
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
 drivers/infiniband/ulp/isert/ib_isert.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 96514f675427..7305ed8976c2 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -230,8 +230,10 @@ isert_create_device_ib_res(struct isert_device *device)
 	}
 
 	/* Check signature cap */
-	device->pi_capable = ib_dev->attrs.device_cap_flags &
-			     IB_DEVICE_INTEGRITY_HANDOVER ? true : false;
+	if (ib_dev->attrs.device_cap_flags & IB_DEVICE_INTEGRITY_HANDOVER)
+		device->pi_capable = true;
+	else
+		device->pi_capable = false;
 
 	return 0;
 }
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/3] IB/isert: remove unneeded semicolon
  2021-01-10 11:19 ` [PATCH 2/3] IB/isert: remove unneeded semicolon Max Gurtovoy
@ 2021-01-10 11:36   ` Leon Romanovsky
  2021-01-10 12:07     ` Max Gurtovoy
  2021-01-14  0:07   ` Sagi Grimberg
  1 sibling, 1 reply; 14+ messages in thread
From: Leon Romanovsky @ 2021-01-10 11:36 UTC (permalink / raw)
  To: Max Gurtovoy; +Cc: linux-rdma, dledford, jgg, sagi, oren, Israel Rukshin

On Sun, Jan 10, 2021 at 11:19:02AM +0000, Max Gurtovoy wrote:
> No need to add semicolon after closing bracket.
>
> Reviewed-by: Israel Rukshin <israelr@nvidia.com>
> Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
> ---
>  drivers/infiniband/ulp/isert/ib_isert.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
> index 5958929b7dec..96514f675427 100644
> --- a/drivers/infiniband/ulp/isert/ib_isert.c
> +++ b/drivers/infiniband/ulp/isert/ib_isert.c
> @@ -1991,7 +1991,7 @@ isert_set_dif_domain(struct se_cmd *se_cmd, struct ib_sig_domain *domain)
>  	if (se_cmd->prot_type == TARGET_DIF_TYPE1_PROT ||
>  	    se_cmd->prot_type == TARGET_DIF_TYPE2_PROT)
>  		domain->sig.dif.ref_remap = true;
> -};
> +}

The same goes for iser_set_dif_domain() and iser_cleanup_handler().

Thanks

>
>  static int
>  isert_set_sig_attrs(struct se_cmd *se_cmd, struct ib_sig_attrs *sig_attrs)
> --
> 2.25.4
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/3] IB/isert: remove unneeded semicolon
  2021-01-10 11:36   ` Leon Romanovsky
@ 2021-01-10 12:07     ` Max Gurtovoy
  0 siblings, 0 replies; 14+ messages in thread
From: Max Gurtovoy @ 2021-01-10 12:07 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: linux-rdma, dledford, jgg, sagi, oren, Israel Rukshin


On 1/10/2021 1:36 PM, Leon Romanovsky wrote:
> On Sun, Jan 10, 2021 at 11:19:02AM +0000, Max Gurtovoy wrote:
>> No need to add semicolon after closing bracket.
>>
>> Reviewed-by: Israel Rukshin <israelr@nvidia.com>
>> Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
>> ---
>>   drivers/infiniband/ulp/isert/ib_isert.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
>> index 5958929b7dec..96514f675427 100644
>> --- a/drivers/infiniband/ulp/isert/ib_isert.c
>> +++ b/drivers/infiniband/ulp/isert/ib_isert.c
>> @@ -1991,7 +1991,7 @@ isert_set_dif_domain(struct se_cmd *se_cmd, struct ib_sig_domain *domain)
>>   	if (se_cmd->prot_type == TARGET_DIF_TYPE1_PROT ||
>>   	    se_cmd->prot_type == TARGET_DIF_TYPE2_PROT)
>>   		domain->sig.dif.ref_remap = true;
>> -};
>> +}
> The same goes for iser_set_dif_domain() and iser_cleanup_handler().

Good catch, I'll send iSER fixes in different series.

This series is for minor fixes for iSERT.

>
> Thanks
>
>>   static int
>>   isert_set_sig_attrs(struct se_cmd *se_cmd, struct ib_sig_attrs *sig_attrs)
>> --
>> 2.25.4
>>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] IB/isert: remove unneeded new lines
  2021-01-10 11:19 [PATCH 1/3] IB/isert: remove unneeded new lines Max Gurtovoy
  2021-01-10 11:19 ` [PATCH 2/3] IB/isert: remove unneeded semicolon Max Gurtovoy
  2021-01-10 11:19 ` [PATCH 3/3] IB/isert: simplify signature cap check Max Gurtovoy
@ 2021-01-14  0:06 ` Sagi Grimberg
  2021-01-18 21:02 ` Jason Gunthorpe
  3 siblings, 0 replies; 14+ messages in thread
From: Sagi Grimberg @ 2021-01-14  0:06 UTC (permalink / raw)
  To: Max Gurtovoy, linux-rdma, dledford, jgg, leonro; +Cc: oren, Israel Rukshin

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/3] IB/isert: remove unneeded semicolon
  2021-01-10 11:19 ` [PATCH 2/3] IB/isert: remove unneeded semicolon Max Gurtovoy
  2021-01-10 11:36   ` Leon Romanovsky
@ 2021-01-14  0:07   ` Sagi Grimberg
  1 sibling, 0 replies; 14+ messages in thread
From: Sagi Grimberg @ 2021-01-14  0:07 UTC (permalink / raw)
  To: Max Gurtovoy, linux-rdma, dledford, jgg, leonro; +Cc: oren, Israel Rukshin

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] IB/isert: simplify signature cap check
  2021-01-10 11:19 ` [PATCH 3/3] IB/isert: simplify signature cap check Max Gurtovoy
@ 2021-01-14  0:08   ` Sagi Grimberg
  2021-01-14  7:29     ` Leon Romanovsky
  0 siblings, 1 reply; 14+ messages in thread
From: Sagi Grimberg @ 2021-01-14  0:08 UTC (permalink / raw)
  To: Max Gurtovoy, linux-rdma, dledford, jgg, leonro; +Cc: oren, Israel Rukshin


> Use if/else clause instead of "condition ? val1 : val2" to make the code
> cleaner and simpler.

Not sure what is cleaner and simpler for a simple condition, but I don't
mind either way...

Acked-by: Sagi Grimberg <sagi@grimberg.me>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] IB/isert: simplify signature cap check
  2021-01-14  0:08   ` Sagi Grimberg
@ 2021-01-14  7:29     ` Leon Romanovsky
  2021-01-14 12:49       ` Jason Gunthorpe
  0 siblings, 1 reply; 14+ messages in thread
From: Leon Romanovsky @ 2021-01-14  7:29 UTC (permalink / raw)
  To: Sagi Grimberg
  Cc: Max Gurtovoy, linux-rdma, dledford, jgg, oren, Israel Rukshin

On Wed, Jan 13, 2021 at 04:08:29PM -0800, Sagi Grimberg wrote:
>
> > Use if/else clause instead of "condition ? val1 : val2" to make the code
> > cleaner and simpler.
>
> Not sure what is cleaner and simpler for a simple condition, but I don't
> mind either way...

Agree, probably even more cleaner variant will be:
 device->pi_capable = !!(ib_dev->attrs.device_cap_flags & IB_DEVICE_INTEGRITY_HANDOVER);

Thanks

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] IB/isert: simplify signature cap check
  2021-01-14  7:29     ` Leon Romanovsky
@ 2021-01-14 12:49       ` Jason Gunthorpe
  2021-01-14 12:54         ` Max Gurtovoy
  2021-01-14 12:59         ` Leon Romanovsky
  0 siblings, 2 replies; 14+ messages in thread
From: Jason Gunthorpe @ 2021-01-14 12:49 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Sagi Grimberg, Max Gurtovoy, linux-rdma, dledford, oren, Israel Rukshin

On Thu, Jan 14, 2021 at 09:29:38AM +0200, Leon Romanovsky wrote:
> On Wed, Jan 13, 2021 at 04:08:29PM -0800, Sagi Grimberg wrote:
> >
> > > Use if/else clause instead of "condition ? val1 : val2" to make the code
> > > cleaner and simpler.
> >
> > Not sure what is cleaner and simpler for a simple condition, but I don't
> > mind either way...
> 
> Agree, probably even more cleaner variant will be:
>  device->pi_capable = !!(ib_dev->attrs.device_cap_flags & IB_DEVICE_INTEGRITY_HANDOVER);

Gah, !! is rarely a sign of something good..

Jason

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] IB/isert: simplify signature cap check
  2021-01-14 12:49       ` Jason Gunthorpe
@ 2021-01-14 12:54         ` Max Gurtovoy
  2021-01-14 13:00           ` Leon Romanovsky
  2021-01-14 12:59         ` Leon Romanovsky
  1 sibling, 1 reply; 14+ messages in thread
From: Max Gurtovoy @ 2021-01-14 12:54 UTC (permalink / raw)
  To: Jason Gunthorpe, Leon Romanovsky
  Cc: Sagi Grimberg, linux-rdma, dledford, oren, Israel Rukshin


On 1/14/2021 2:49 PM, Jason Gunthorpe wrote:
> On Thu, Jan 14, 2021 at 09:29:38AM +0200, Leon Romanovsky wrote:
>> On Wed, Jan 13, 2021 at 04:08:29PM -0800, Sagi Grimberg wrote:
>>>> Use if/else clause instead of "condition ? val1 : val2" to make the code
>>>> cleaner and simpler.
>>> Not sure what is cleaner and simpler for a simple condition, but I don't
>>> mind either way...
>> Agree, probably even more cleaner variant will be:
>>   device->pi_capable = !!(ib_dev->attrs.device_cap_flags & IB_DEVICE_INTEGRITY_HANDOVER);
> Gah, !! is rarely a sign of something good..

can we take the series as-is ?

We have enough Acks and eyes on these minor cleanups.


>
> Jason

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] IB/isert: simplify signature cap check
  2021-01-14 12:49       ` Jason Gunthorpe
  2021-01-14 12:54         ` Max Gurtovoy
@ 2021-01-14 12:59         ` Leon Romanovsky
  1 sibling, 0 replies; 14+ messages in thread
From: Leon Romanovsky @ 2021-01-14 12:59 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Sagi Grimberg, Max Gurtovoy, linux-rdma, dledford, oren, Israel Rukshin

On Thu, Jan 14, 2021 at 08:49:39AM -0400, Jason Gunthorpe wrote:
> On Thu, Jan 14, 2021 at 09:29:38AM +0200, Leon Romanovsky wrote:
> > On Wed, Jan 13, 2021 at 04:08:29PM -0800, Sagi Grimberg wrote:
> > >
> > > > Use if/else clause instead of "condition ? val1 : val2" to make the code
> > > > cleaner and simpler.
> > >
> > > Not sure what is cleaner and simpler for a simple condition, but I don't
> > > mind either way...
> >
> > Agree, probably even more cleaner variant will be:
> >  device->pi_capable = !!(ib_dev->attrs.device_cap_flags & IB_DEVICE_INTEGRITY_HANDOVER);
>
> Gah, !! is rarely a sign of something good..

You see, three of us see same code differently.

>
> Jason

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] IB/isert: simplify signature cap check
  2021-01-14 12:54         ` Max Gurtovoy
@ 2021-01-14 13:00           ` Leon Romanovsky
  0 siblings, 0 replies; 14+ messages in thread
From: Leon Romanovsky @ 2021-01-14 13:00 UTC (permalink / raw)
  To: Max Gurtovoy
  Cc: Jason Gunthorpe, Sagi Grimberg, linux-rdma, dledford, oren,
	Israel Rukshin

On Thu, Jan 14, 2021 at 02:54:29PM +0200, Max Gurtovoy wrote:
>
> On 1/14/2021 2:49 PM, Jason Gunthorpe wrote:
> > On Thu, Jan 14, 2021 at 09:29:38AM +0200, Leon Romanovsky wrote:
> > > On Wed, Jan 13, 2021 at 04:08:29PM -0800, Sagi Grimberg wrote:
> > > > > Use if/else clause instead of "condition ? val1 : val2" to make the code
> > > > > cleaner and simpler.
> > > > Not sure what is cleaner and simpler for a simple condition, but I don't
> > > > mind either way...
> > > Agree, probably even more cleaner variant will be:
> > >   device->pi_capable = !!(ib_dev->attrs.device_cap_flags & IB_DEVICE_INTEGRITY_HANDOVER);
> > Gah, !! is rarely a sign of something good..
>
> can we take the series as-is ?

Of course :)

Thanks

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] IB/isert: remove unneeded new lines
  2021-01-10 11:19 [PATCH 1/3] IB/isert: remove unneeded new lines Max Gurtovoy
                   ` (2 preceding siblings ...)
  2021-01-14  0:06 ` [PATCH 1/3] IB/isert: remove unneeded new lines Sagi Grimberg
@ 2021-01-18 21:02 ` Jason Gunthorpe
  3 siblings, 0 replies; 14+ messages in thread
From: Jason Gunthorpe @ 2021-01-18 21:02 UTC (permalink / raw)
  To: Max Gurtovoy; +Cc: linux-rdma, dledford, leonro, sagi, oren, Israel Rukshin

On Sun, Jan 10, 2021 at 11:19:01AM +0000, Max Gurtovoy wrote:
> The Linux convention is to have only 1 new line between functions.
> 
> Reviewed-by: Israel Rukshin <israelr@nvidia.com>
> Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
> Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
> ---
>  drivers/infiniband/ulp/isert/ib_isert.c | 2 --
>  1 file changed, 2 deletions(-)

Series applied to for-next, thanks

Jason

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-01-18 21:07 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-10 11:19 [PATCH 1/3] IB/isert: remove unneeded new lines Max Gurtovoy
2021-01-10 11:19 ` [PATCH 2/3] IB/isert: remove unneeded semicolon Max Gurtovoy
2021-01-10 11:36   ` Leon Romanovsky
2021-01-10 12:07     ` Max Gurtovoy
2021-01-14  0:07   ` Sagi Grimberg
2021-01-10 11:19 ` [PATCH 3/3] IB/isert: simplify signature cap check Max Gurtovoy
2021-01-14  0:08   ` Sagi Grimberg
2021-01-14  7:29     ` Leon Romanovsky
2021-01-14 12:49       ` Jason Gunthorpe
2021-01-14 12:54         ` Max Gurtovoy
2021-01-14 13:00           ` Leon Romanovsky
2021-01-14 12:59         ` Leon Romanovsky
2021-01-14  0:06 ` [PATCH 1/3] IB/isert: remove unneeded new lines Sagi Grimberg
2021-01-18 21:02 ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.