public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] drivers/staging: Fixed sparse error "directive in argument list"
@ 2014-10-11 19:13 Filipe Gonçalves
  2014-10-11 20:15 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Filipe Gonçalves @ 2014-10-11 19:13 UTC (permalink / raw)
  To: oleg.drokin, andreas.dilger, gregkh, devel, linux-kernel
  Cc: Filipe Gonçalves

This patch fixes a sparse warning on layout.c (ptlrpc) that was caused by having preprocessor directives in the arguments to a macro.

Signed-off-by: Filipe Gonçalves <filipe@codinghighway.com>
---
 drivers/staging/lustre/lustre/ptlrpc/layout.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/layout.c b/drivers/staging/lustre/lustre/ptlrpc/layout.c
index 5b83371..211df78 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/layout.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/layout.c
@@ -978,10 +978,11 @@ struct req_msg_field RMF_CONN =
 EXPORT_SYMBOL(RMF_CONN);
 
 struct req_msg_field RMF_CONNECT_DATA =
+#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 50, 0)
 	DEFINE_MSGF("cdata",
 		    RMF_F_NO_SIZE_CHECK /* we allow extra space for interop */,
-#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 50, 0)
 		    sizeof(struct obd_connect_data),
+		    lustre_swab_connect, NULL);
 #else
 /* For interoperability with 1.8 and 2.0 clients/servers.
  * The RPC verification code allows larger RPC buffers, but not
@@ -990,9 +991,11 @@ struct req_msg_field RMF_CONNECT_DATA =
  * size is at least as large as obd_connect_data_v1.  That is not
  * not in itself harmful, since the chance of just corrupting this
  * field is low.  See JIRA LU-16 for details. */
+	DEFINE_MSGF("cdata",
+		    RMF_F_NO_SIZE_CHECK /* we allow extra space for interop */,
 		    sizeof(struct obd_connect_data_v1),
-#endif
 		    lustre_swab_connect, NULL);
+#endif
 EXPORT_SYMBOL(RMF_CONNECT_DATA);
 
 struct req_msg_field RMF_DLM_REQ =
-- 
1.9.1


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

* Re: [PATCH 1/1] drivers/staging: Fixed sparse error "directive in argument list"
  2014-10-11 19:13 [PATCH 1/1] drivers/staging: Fixed sparse error "directive in argument list" Filipe Gonçalves
@ 2014-10-11 20:15 ` Greg KH
  2014-10-11 21:06   ` Filipe Gonçalves
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2014-10-11 20:15 UTC (permalink / raw)
  To: Filipe Gonçalves; +Cc: oleg.drokin, andreas.dilger, devel, linux-kernel

On Sat, Oct 11, 2014 at 08:13:42PM +0100, Filipe Gonçalves wrote:
> This patch fixes a sparse warning on layout.c (ptlrpc) that was caused by having preprocessor directives in the arguments to a macro.
> 
> Signed-off-by: Filipe Gonçalves <filipe@codinghighway.com>
> ---
>  drivers/staging/lustre/lustre/ptlrpc/layout.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/ptlrpc/layout.c b/drivers/staging/lustre/lustre/ptlrpc/layout.c
> index 5b83371..211df78 100644
> --- a/drivers/staging/lustre/lustre/ptlrpc/layout.c
> +++ b/drivers/staging/lustre/lustre/ptlrpc/layout.c
> @@ -978,10 +978,11 @@ struct req_msg_field RMF_CONN =
>  EXPORT_SYMBOL(RMF_CONN);
>  
>  struct req_msg_field RMF_CONNECT_DATA =
> +#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 50, 0)
>  	DEFINE_MSGF("cdata",
>  		    RMF_F_NO_SIZE_CHECK /* we allow extra space for interop */,
> -#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 50, 0)
>  		    sizeof(struct obd_connect_data),
> +		    lustre_swab_connect, NULL);

Ick ick ick.

Yeah, sparse might complain about this, but how about just properly
deleting the #ifdef entirely, and not perpetuate it even more?

It shouldn't be needed anymore now that the code is in the kernel tree.

greg k-h

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

* Re: [PATCH 1/1] drivers/staging: Fixed sparse error "directive in argument list"
  2014-10-11 20:15 ` Greg KH
@ 2014-10-11 21:06   ` Filipe Gonçalves
  2014-10-11 21:49     ` Drokin, Oleg
  0 siblings, 1 reply; 5+ messages in thread
From: Filipe Gonçalves @ 2014-10-11 21:06 UTC (permalink / raw)
  To: Greg KH; +Cc: oleg.drokin, andreas.dilger, devel, linux-kernel

Ah .. right! I didn't know what OBD_OCD_VERSION() was. Now I see it's
a way to test kernel version. I am going to submit a new patch
shortly.

Thanks,
Filipe

On Sat, Oct 11, 2014 at 9:15 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Sat, Oct 11, 2014 at 08:13:42PM +0100, Filipe Gonçalves wrote:
>> This patch fixes a sparse warning on layout.c (ptlrpc) that was caused by having preprocessor directives in the arguments to a macro.
>>
>> Signed-off-by: Filipe Gonçalves <filipe@codinghighway.com>
>> ---
>>  drivers/staging/lustre/lustre/ptlrpc/layout.c | 7 +++++--
>>  1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/staging/lustre/lustre/ptlrpc/layout.c b/drivers/staging/lustre/lustre/ptlrpc/layout.c
>> index 5b83371..211df78 100644
>> --- a/drivers/staging/lustre/lustre/ptlrpc/layout.c
>> +++ b/drivers/staging/lustre/lustre/ptlrpc/layout.c
>> @@ -978,10 +978,11 @@ struct req_msg_field RMF_CONN =
>>  EXPORT_SYMBOL(RMF_CONN);
>>
>>  struct req_msg_field RMF_CONNECT_DATA =
>> +#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 50, 0)
>>       DEFINE_MSGF("cdata",
>>                   RMF_F_NO_SIZE_CHECK /* we allow extra space for interop */,
>> -#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 50, 0)
>>                   sizeof(struct obd_connect_data),
>> +                 lustre_swab_connect, NULL);
>
> Ick ick ick.
>
> Yeah, sparse might complain about this, but how about just properly
> deleting the #ifdef entirely, and not perpetuate it even more?
>
> It shouldn't be needed anymore now that the code is in the kernel tree.
>
> greg k-h

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

* Re: [PATCH 1/1] drivers/staging: Fixed sparse error "directive in argument list"
  2014-10-11 21:06   ` Filipe Gonçalves
@ 2014-10-11 21:49     ` Drokin, Oleg
  2014-10-11 22:02       ` Filipe Gonçalves
  0 siblings, 1 reply; 5+ messages in thread
From: Drokin, Oleg @ 2014-10-11 21:49 UTC (permalink / raw)
  To: Filipe Gonçalves
  Cc: Greg KH, Dilger, Andreas, devel,
	<linux-kernel@vger.kernel.org>

Hello!

   No, it's not the way to test the kernel version, it's the way to test internal
   lustre version.
   Either way maintaining compatibility with Lustre 1.8 and 2.0 servers should not
   be important anymore, so it's fine to drop this check indeed.

Bye,
    Oleg
On Oct 11, 2014, at 5:06 PM, Filipe Gonçalves wrote:

> Ah .. right! I didn't know what OBD_OCD_VERSION() was. Now I see it's
> a way to test kernel version. I am going to submit a new patch
> shortly.
> 
> Thanks,
> Filipe
> 
> On Sat, Oct 11, 2014 at 9:15 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
>> 
>> On Sat, Oct 11, 2014 at 08:13:42PM +0100, Filipe Gonçalves wrote:
>>> This patch fixes a sparse warning on layout.c (ptlrpc) that was caused by having preprocessor directives in the arguments to a macro.
>>> 
>>> Signed-off-by: Filipe Gonçalves <filipe@codinghighway.com>
>>> ---
>>> drivers/staging/lustre/lustre/ptlrpc/layout.c | 7 +++++--
>>> 1 file changed, 5 insertions(+), 2 deletions(-)
>>> 
>>> diff --git a/drivers/staging/lustre/lustre/ptlrpc/layout.c b/drivers/staging/lustre/lustre/ptlrpc/layout.c
>>> index 5b83371..211df78 100644
>>> --- a/drivers/staging/lustre/lustre/ptlrpc/layout.c
>>> +++ b/drivers/staging/lustre/lustre/ptlrpc/layout.c
>>> @@ -978,10 +978,11 @@ struct req_msg_field RMF_CONN =
>>> EXPORT_SYMBOL(RMF_CONN);
>>> 
>>> struct req_msg_field RMF_CONNECT_DATA =
>>> +#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 50, 0)
>>>      DEFINE_MSGF("cdata",
>>>                  RMF_F_NO_SIZE_CHECK /* we allow extra space for interop */,
>>> -#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 50, 0)
>>>                  sizeof(struct obd_connect_data),
>>> +                 lustre_swab_connect, NULL);
>> 
>> Ick ick ick.
>> 
>> Yeah, sparse might complain about this, but how about just properly
>> deleting the #ifdef entirely, and not perpetuate it even more?
>> 
>> It shouldn't be needed anymore now that the code is in the kernel tree.
>> 
>> greg k-h


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

* Re: [PATCH 1/1] drivers/staging: Fixed sparse error "directive in argument list"
  2014-10-11 21:49     ` Drokin, Oleg
@ 2014-10-11 22:02       ` Filipe Gonçalves
  0 siblings, 0 replies; 5+ messages in thread
From: Filipe Gonçalves @ 2014-10-11 22:02 UTC (permalink / raw)
  To: Drokin, Oleg
  Cc: Greg KH, Dilger, Andreas, devel,
	<linux-kernel@vger.kernel.org>

Hi,

Oops.. sorry for the mess then. I am still trying to get to know the
codebase. I submitted a new patch where I removed the check.

Thanks for your patience :)

Best,
Filipe

On Sat, Oct 11, 2014 at 10:49 PM, Drokin, Oleg <oleg.drokin@intel.com> wrote:
>
> Hello!
>
>    No, it's not the way to test the kernel version, it's the way to test internal
>    lustre version.
>    Either way maintaining compatibility with Lustre 1.8 and 2.0 servers should not
>    be important anymore, so it's fine to drop this check indeed.
>
> Bye,
>     Oleg
> On Oct 11, 2014, at 5:06 PM, Filipe Gonçalves wrote:
>
>> Ah .. right! I didn't know what OBD_OCD_VERSION() was. Now I see it's
>> a way to test kernel version. I am going to submit a new patch
>> shortly.
>>
>> Thanks,
>> Filipe
>>
>> On Sat, Oct 11, 2014 at 9:15 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
>>>
>>> On Sat, Oct 11, 2014 at 08:13:42PM +0100, Filipe Gonçalves wrote:
>>>> This patch fixes a sparse warning on layout.c (ptlrpc) that was caused by having preprocessor directives in the arguments to a macro.
>>>>
>>>> Signed-off-by: Filipe Gonçalves <filipe@codinghighway.com>
>>>> ---
>>>> drivers/staging/lustre/lustre/ptlrpc/layout.c | 7 +++++--
>>>> 1 file changed, 5 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/staging/lustre/lustre/ptlrpc/layout.c b/drivers/staging/lustre/lustre/ptlrpc/layout.c
>>>> index 5b83371..211df78 100644
>>>> --- a/drivers/staging/lustre/lustre/ptlrpc/layout.c
>>>> +++ b/drivers/staging/lustre/lustre/ptlrpc/layout.c
>>>> @@ -978,10 +978,11 @@ struct req_msg_field RMF_CONN =
>>>> EXPORT_SYMBOL(RMF_CONN);
>>>>
>>>> struct req_msg_field RMF_CONNECT_DATA =
>>>> +#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 50, 0)
>>>>      DEFINE_MSGF("cdata",
>>>>                  RMF_F_NO_SIZE_CHECK /* we allow extra space for interop */,
>>>> -#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 50, 0)
>>>>                  sizeof(struct obd_connect_data),
>>>> +                 lustre_swab_connect, NULL);
>>>
>>> Ick ick ick.
>>>
>>> Yeah, sparse might complain about this, but how about just properly
>>> deleting the #ifdef entirely, and not perpetuate it even more?
>>>
>>> It shouldn't be needed anymore now that the code is in the kernel tree.
>>>
>>> greg k-h
>

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

end of thread, other threads:[~2014-10-11 23:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-11 19:13 [PATCH 1/1] drivers/staging: Fixed sparse error "directive in argument list" Filipe Gonçalves
2014-10-11 20:15 ` Greg KH
2014-10-11 21:06   ` Filipe Gonçalves
2014-10-11 21:49     ` Drokin, Oleg
2014-10-11 22:02       ` Filipe Gonçalves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox