Message ID | 20210110111903.486681-3-mgurtovoy@nvidia.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Jason Gunthorpe |
Headers | show |
Series | [1/3] IB/isert: remove unneeded new lines | expand |
> 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>
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
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
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
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
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
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; }