Re: [PATCH 3/5] bitwise: allow compares for bitwise types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 27/06/2022 20:05, Luc Van Oostenryck wrote:
> Currently, bitwise types are restricted to bitwise operations
> (&, |, ^ and ~) as well as equality comparisons.
> 
> This patch makes the others comparisons valid for bitwise types
> too.
> 
> Warning: This change make sense in the context of [1] but

The [1] reference seems to be missing :)

ATB,
Ramsay Jones

>          doesn't make sense for the 'main' bitwise types:
>          __be32 and friends.
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
> ---
>  evaluate.c                       | 4 ++++
>  validation/bitwise-cmp.c         | 1 -
>  validation/linear/bitwise-cmps.c | 1 -
>  3 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/evaluate.c b/evaluate.c
> index bcbcdf1ef0cc..bb8c0caa905a 100644
> --- a/evaluate.c
> +++ b/evaluate.c
> @@ -435,6 +435,10 @@ static int restricted_binop(int op, struct symbol *type)
>  		case '^':
>  		case '?':
>  			return 2;	/* keep fouled */
> +		case '<':
> +		case '>':
> +		case SPECIAL_LTE:
> +		case SPECIAL_GTE:
>  		case SPECIAL_EQUAL:
>  		case SPECIAL_NOTEQUAL:
>  			return 3;	/* warn if fouled */
> diff --git a/validation/bitwise-cmp.c b/validation/bitwise-cmp.c
> index ca12b5e51e8e..8c3e6894072d 100644
> --- a/validation/bitwise-cmp.c
> +++ b/validation/bitwise-cmp.c
> @@ -28,5 +28,4 @@ static int gtx(b32 x, b32 y)  { return (x >  y); }
>  
>  /*
>   * check-name: bitwise-cmp
> - * check-known-to-fail
>   */
> diff --git a/validation/linear/bitwise-cmps.c b/validation/linear/bitwise-cmps.c
> index 6122944a42c6..f83ab7fe47db 100644
> --- a/validation/linear/bitwise-cmps.c
> +++ b/validation/linear/bitwise-cmps.c
> @@ -8,7 +8,6 @@ static int gtu(bs32 x, bs32 y)  { return (x >  y); }
>  /*
>   * check-name: bitwise-cmps
>   * check-command: test-linearize -Wno-decl $file
> - * check-known-to-fail
>   *
>   * check-output-ignore
>   * check-output-excludes: setb\\.



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux