Re: [PATCH for-5.2 v2 3/9] pc-bios/s390-ccw: Introduce ENODEV define and remove guards of others

2020-08-27 Thread Thomas Huth
On 06/08/2020 15.27, Janosch Frank wrote:
> On 8/6/20 12:53 PM, Thomas Huth wrote:
>> Remove the "#ifndef E..." guards from the defines here - the header
>> guard S390_CCW_H at the top of the file should avoid double definition,
>> and if the error code is defined in a different file already, we're in
>> trouble anyway, then it's better to see the error at compile time instead
>> of hunting weird behavior during runtime later.
>> Also define ENODEV - we will use this in a later patch.
>>
>> Signed-off-by: Thomas Huth 
> 
> Would it make sense to use the errno.h numbers for the defines?

Which one? From Linux? From Windows? From BSD? ... I think it's likely
best if we keep them separate to avoid confusion.

 Thomas


> Reviewed-by: Janosch Frank 
> 
>> ---
>>  pc-bios/s390-ccw/s390-ccw.h | 6 ++
>>  1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h
>> index 36b884cced..dbc4c64851 100644
>> --- a/pc-bios/s390-ccw/s390-ccw.h
>> +++ b/pc-bios/s390-ccw/s390-ccw.h
>> @@ -27,12 +27,10 @@ typedef unsigned long long __u64;
>>  #define false 0
>>  #define PAGE_SIZE 4096
>>  
>> -#ifndef EIO
>>  #define EIO 1
>> -#endif
>> -#ifndef EBUSY
>>  #define EBUSY   2
>> -#endif
>> +#define ENODEV  3
>> +
>>  #ifndef NULL
>>  #define NULL0
>>  #endif
>>
> 
> 




Re: [PATCH for-5.2 v2 3/9] pc-bios/s390-ccw: Introduce ENODEV define and remove guards of others

2020-08-06 Thread Janosch Frank
On 8/6/20 12:53 PM, Thomas Huth wrote:
> Remove the "#ifndef E..." guards from the defines here - the header
> guard S390_CCW_H at the top of the file should avoid double definition,
> and if the error code is defined in a different file already, we're in
> trouble anyway, then it's better to see the error at compile time instead
> of hunting weird behavior during runtime later.
> Also define ENODEV - we will use this in a later patch.
> 
> Signed-off-by: Thomas Huth 

Would it make sense to use the errno.h numbers for the defines?

Reviewed-by: Janosch Frank 

> ---
>  pc-bios/s390-ccw/s390-ccw.h | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h
> index 36b884cced..dbc4c64851 100644
> --- a/pc-bios/s390-ccw/s390-ccw.h
> +++ b/pc-bios/s390-ccw/s390-ccw.h
> @@ -27,12 +27,10 @@ typedef unsigned long long __u64;
>  #define false 0
>  #define PAGE_SIZE 4096
>  
> -#ifndef EIO
>  #define EIO 1
> -#endif
> -#ifndef EBUSY
>  #define EBUSY   2
> -#endif
> +#define ENODEV  3
> +
>  #ifndef NULL
>  #define NULL0
>  #endif
> 




signature.asc
Description: OpenPGP digital signature


Re: [PATCH for-5.2 v2 3/9] pc-bios/s390-ccw: Introduce ENODEV define and remove guards of others

2020-08-06 Thread Cornelia Huck
On Thu,  6 Aug 2020 12:53:43 +0200
Thomas Huth  wrote:

> Remove the "#ifndef E..." guards from the defines here - the header
> guard S390_CCW_H at the top of the file should avoid double definition,
> and if the error code is defined in a different file already, we're in
> trouble anyway, then it's better to see the error at compile time instead
> of hunting weird behavior during runtime later.
> Also define ENODEV - we will use this in a later patch.
> 
> Signed-off-by: Thomas Huth 
> ---
>  pc-bios/s390-ccw/s390-ccw.h | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)

Reviewed-by: Cornelia Huck 




[PATCH for-5.2 v2 3/9] pc-bios/s390-ccw: Introduce ENODEV define and remove guards of others

2020-08-06 Thread Thomas Huth
Remove the "#ifndef E..." guards from the defines here - the header
guard S390_CCW_H at the top of the file should avoid double definition,
and if the error code is defined in a different file already, we're in
trouble anyway, then it's better to see the error at compile time instead
of hunting weird behavior during runtime later.
Also define ENODEV - we will use this in a later patch.

Signed-off-by: Thomas Huth 
---
 pc-bios/s390-ccw/s390-ccw.h | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h
index 36b884cced..dbc4c64851 100644
--- a/pc-bios/s390-ccw/s390-ccw.h
+++ b/pc-bios/s390-ccw/s390-ccw.h
@@ -27,12 +27,10 @@ typedef unsigned long long __u64;
 #define false 0
 #define PAGE_SIZE 4096
 
-#ifndef EIO
 #define EIO 1
-#endif
-#ifndef EBUSY
 #define EBUSY   2
-#endif
+#define ENODEV  3
+
 #ifndef NULL
 #define NULL0
 #endif
-- 
2.18.1