Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1608355 > unrolled thread
| Started by | Arushi Singhal <arushisinghal19971997@gmail.com> |
|---|---|
| First post | 2017-03-24 12:50 +0100 |
| Last post | 2017-03-24 21:20 +0100 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] staging: lustre: Remove redundant code Arushi Singhal <arushisinghal19971997@gmail.com> - 2017-03-24 12:50 +0100
Re: [PATCH] staging: lustre: Remove redundant code Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-24 14:50 +0100
Re: [PATCH] staging: lustre: Remove redundant code "Dilger, Andreas" <andreas.dilger@intel.com> - 2017-03-24 21:20 +0100
| From | Arushi Singhal <arushisinghal19971997@gmail.com> |
|---|---|
| Date | 2017-03-24 12:50 +0100 |
| Subject | [PATCH] staging: lustre: Remove redundant code |
| Message-ID | <tovTb-VO-13@gated-at.bofh.it> |
Remove the code which do not have any value.
Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
drivers/staging/lustre/lnet/lnet/net_fault.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/staging/lustre/lnet/lnet/net_fault.c b/drivers/staging/lustre/lnet/lnet/net_fault.c
index 18183cbb9859..b60261db9e67 100644
--- a/drivers/staging/lustre/lnet/lnet/net_fault.c
+++ b/drivers/staging/lustre/lnet/lnet/net_fault.c
@@ -997,11 +997,6 @@ lnet_fault_ctl(int opc, struct libcfs_ioctl_data *data)
int
lnet_fault_init(void)
{
- BUILD_BUG_ON(LNET_PUT_BIT != 1 << LNET_MSG_PUT);
- BUILD_BUG_ON(LNET_ACK_BIT != 1 << LNET_MSG_ACK);
- BUILD_BUG_ON(LNET_GET_BIT != 1 << LNET_MSG_GET);
- BUILD_BUG_ON(LNET_REPLY_BIT != 1 << LNET_MSG_REPLY);
-
mutex_init(&delay_dd.dd_mutex);
spin_lock_init(&delay_dd.dd_lock);
init_waitqueue_head(&delay_dd.dd_waitq);
--
2.11.0
[toc] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-03-24 14:50 +0100 |
| Message-ID | <toxLj-2hq-7@gated-at.bofh.it> |
| In reply to | #1608355 |
On Fri, Mar 24, 2017 at 05:09:53PM +0530, Arushi Singhal wrote:
> Remove the code which do not have any value.
>
> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
> ---
> drivers/staging/lustre/lnet/lnet/net_fault.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/drivers/staging/lustre/lnet/lnet/net_fault.c b/drivers/staging/lustre/lnet/lnet/net_fault.c
> index 18183cbb9859..b60261db9e67 100644
> --- a/drivers/staging/lustre/lnet/lnet/net_fault.c
> +++ b/drivers/staging/lustre/lnet/lnet/net_fault.c
> @@ -997,11 +997,6 @@ lnet_fault_ctl(int opc, struct libcfs_ioctl_data *data)
> int
> lnet_fault_init(void)
> {
> - BUILD_BUG_ON(LNET_PUT_BIT != 1 << LNET_MSG_PUT);
> - BUILD_BUG_ON(LNET_ACK_BIT != 1 << LNET_MSG_ACK);
> - BUILD_BUG_ON(LNET_GET_BIT != 1 << LNET_MSG_GET);
> - BUILD_BUG_ON(LNET_REPLY_BIT != 1 << LNET_MSG_REPLY);
Why does this not have any value? How are you ensuring that these
requirements are now being met?
thanks,
greg k-h
[toc] | [prev] | [next] | [standalone]
| From | "Dilger, Andreas" <andreas.dilger@intel.com> |
|---|---|
| Date | 2017-03-24 21:20 +0100 |
| Message-ID | <toDQK-6Kj-9@gated-at.bofh.it> |
| In reply to | #1608398 |
On Mar 24, 2017, at 07:44, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>
> On Fri, Mar 24, 2017 at 05:09:53PM +0530, Arushi Singhal wrote:
>> Remove the code which do not have any value.
>>
>> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
>> ---
>> drivers/staging/lustre/lnet/lnet/net_fault.c | 5 -----
>> 1 file changed, 5 deletions(-)
>>
>> diff --git a/drivers/staging/lustre/lnet/lnet/net_fault.c b/drivers/staging/lustre/lnet/lnet/net_fault.c
>> index 18183cbb9859..b60261db9e67 100644
>> --- a/drivers/staging/lustre/lnet/lnet/net_fault.c
>> +++ b/drivers/staging/lustre/lnet/lnet/net_fault.c
>> @@ -997,11 +997,6 @@ lnet_fault_ctl(int opc, struct libcfs_ioctl_data *data)
>> int
>> lnet_fault_init(void)
>> {
>> - BUILD_BUG_ON(LNET_PUT_BIT != 1 << LNET_MSG_PUT);
>> - BUILD_BUG_ON(LNET_ACK_BIT != 1 << LNET_MSG_ACK);
>> - BUILD_BUG_ON(LNET_GET_BIT != 1 << LNET_MSG_GET);
>> - BUILD_BUG_ON(LNET_REPLY_BIT != 1 << LNET_MSG_REPLY);
>
> Why does this not have any value? How are you ensuring that these
> requirements are now being met?
It was my recommendation to remove these checks, though on closer review I might have
been a bit premature. For some reason I thought the LNET_*_BIT constants were defined
in terms of LNET_MSG_*, but I see they are not.
In conjunction with this change, the definition of LNET_*_BIT should be changed to be
defined in terms of the LNET_MSG_* constants:
#define LNET_PUT_BIT BIT(LNET_MSG_PUT)
#define LNET_ACK_BIT BIT(LNET_MSG_ACK)
#define LNET_GET_BIT BIT(LNET_MSG_GET)
#define LNET_REPLY_BIT BIT(LNET_MSG_REPLY)
The alternative would be to remove the LNET_*_BIT constants and use BIT(LNET_MSG_*)
directly in the code, since that is easy enough to read compared to (1 << LNET_MSG_*)
everywhere. There don't seem to be a lot of users, so this wouldn't be a giant patch.
Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web