uml: vector: fix definitios of VECTOR_WRITE and VECTOR_HEADERS

Message ID 20230209161916.3729757-1-carlos.bilbao@amd.com
State New
Headers
Series uml: vector: fix definitios of VECTOR_WRITE and VECTOR_HEADERS |

Commit Message

Carlos Bilbao Feb. 9, 2023, 4:19 p.m. UTC
  Fix definitions of VECTOR_WRITE and VECTOR_HEADERS with proper bitwise
operand for bit shift.

Signed-off-by: Carlos Bilbao <carlos.bilbao@amd.com>
---
 arch/um/drivers/vector_user.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Carlos Bilbao Feb. 9, 2023, 5:04 p.m. UTC | #1
Just noticed commit typo, if you could please fix, s/definitios/definitions

On 2/9/23 10:19, Carlos Bilbao wrote:

> Fix definitions of VECTOR_WRITE and VECTOR_HEADERS with proper bitwise
> operand for bit shift.
>
> Signed-off-by: Carlos Bilbao <carlos.bilbao@amd.com>
> ---
>   arch/um/drivers/vector_user.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/um/drivers/vector_user.h b/arch/um/drivers/vector_user.h
> index 3a73d17a0161..f7d3956f5c15 100644
> --- a/arch/um/drivers/vector_user.h
> +++ b/arch/um/drivers/vector_user.h
> @@ -68,8 +68,8 @@ struct vector_fds {
>   };
>   
>   #define VECTOR_READ	1
> -#define VECTOR_WRITE	(1 < 1)
> -#define VECTOR_HEADERS	(1 < 2)
> +#define VECTOR_WRITE	(1 << 1)
> +#define VECTOR_HEADERS	(1 << 2)
>   
>   extern struct arglist *uml_parse_vector_ifspec(char *arg);
>
  
Anton Ivanov Feb. 9, 2023, 5:12 p.m. UTC | #2
On 09/02/2023 16:19, Carlos Bilbao wrote:
> Fix definitions of VECTOR_WRITE and VECTOR_HEADERS with proper bitwise
> operand for bit shift.
> 
> Signed-off-by: Carlos Bilbao <carlos.bilbao@amd.com>
> ---
>   arch/um/drivers/vector_user.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/um/drivers/vector_user.h b/arch/um/drivers/vector_user.h
> index 3a73d17a0161..f7d3956f5c15 100644
> --- a/arch/um/drivers/vector_user.h
> +++ b/arch/um/drivers/vector_user.h
> @@ -68,8 +68,8 @@ struct vector_fds {
>   };
>   
>   #define VECTOR_READ	1
> -#define VECTOR_WRITE	(1 < 1)
> -#define VECTOR_HEADERS	(1 < 2)
> +#define VECTOR_WRITE	(1 << 1)
> +#define VECTOR_HEADERS	(1 << 2)
>   
>   extern struct arglist *uml_parse_vector_ifspec(char *arg);
>   

I need to have a look at the code how it even worked before. Will ack 
after that.
  
Anton Ivanov Feb. 9, 2023, 5:33 p.m. UTC | #3
On 09/02/2023 16:19, Carlos Bilbao wrote:
> Fix definitions of VECTOR_WRITE and VECTOR_HEADERS with proper bitwise
> operand for bit shift.
> 
> Signed-off-by: Carlos Bilbao <carlos.bilbao@amd.com>
> ---
>   arch/um/drivers/vector_user.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/um/drivers/vector_user.h b/arch/um/drivers/vector_user.h
> index 3a73d17a0161..f7d3956f5c15 100644
> --- a/arch/um/drivers/vector_user.h
> +++ b/arch/um/drivers/vector_user.h
> @@ -68,8 +68,8 @@ struct vector_fds {
>   };
>   
>   #define VECTOR_READ	1
> -#define VECTOR_WRITE	(1 < 1)
> -#define VECTOR_HEADERS	(1 < 2)
> +#define VECTOR_WRITE	(1 << 1)
> +#define VECTOR_HEADERS	(1 << 2)
>   
>   extern struct arglist *uml_parse_vector_ifspec(char *arg);
>   

These are no longer used. They were used in some very early versions of 
the code.

They should just be removed instead of redefined correctly.
  
Carlos Bilbao Feb. 9, 2023, 6:14 p.m. UTC | #4
On 2/9/23 11:33, Anton Ivanov wrote:

> On 09/02/2023 16:19, Carlos Bilbao wrote:
>> Fix definitions of VECTOR_WRITE and VECTOR_HEADERS with proper bitwise
>> operand for bit shift.
>>
>> Signed-off-by: Carlos Bilbao <carlos.bilbao@amd.com>
>> ---
>>   arch/um/drivers/vector_user.h | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/um/drivers/vector_user.h 
>> b/arch/um/drivers/vector_user.h
>> index 3a73d17a0161..f7d3956f5c15 100644
>> --- a/arch/um/drivers/vector_user.h
>> +++ b/arch/um/drivers/vector_user.h
>> @@ -68,8 +68,8 @@ struct vector_fds {
>>   };
>>     #define VECTOR_READ    1
>> -#define VECTOR_WRITE    (1 < 1)
>> -#define VECTOR_HEADERS    (1 < 2)
>> +#define VECTOR_WRITE    (1 << 1)
>> +#define VECTOR_HEADERS    (1 << 2)
>>     extern struct arglist *uml_parse_vector_ifspec(char *arg);
>
> These are no longer used. They were used in some very early versions 
> of the code.
>
> They should just be removed instead of redefined correctly.
>
Ack, sending patch your way.

Thanks,

Carlos
  

Patch

diff --git a/arch/um/drivers/vector_user.h b/arch/um/drivers/vector_user.h
index 3a73d17a0161..f7d3956f5c15 100644
--- a/arch/um/drivers/vector_user.h
+++ b/arch/um/drivers/vector_user.h
@@ -68,8 +68,8 @@  struct vector_fds {
 };
 
 #define VECTOR_READ	1
-#define VECTOR_WRITE	(1 < 1)
-#define VECTOR_HEADERS	(1 < 2)
+#define VECTOR_WRITE	(1 << 1)
+#define VECTOR_HEADERS	(1 << 2)
 
 extern struct arglist *uml_parse_vector_ifspec(char *arg);