Re: [PATCH 1/4] slice: remove unneeded len from OP_SLICE

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

 




On 25/02/2021 23:39, Luc Van Oostenryck wrote:
> OP_SLICE::len is necessarily equal to the result size.
> So remove this redundancy.
> 
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
> ---
>  Documentation/IR.rst | 2 +-
>  linearize.c          | 3 +--
>  linearize.h          | 2 +-
>  3 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/IR.rst b/Documentation/IR.rst
> index 38df84ff3954..c7db32073361 100644
> --- a/Documentation/IR.rst
> +++ b/Documentation/IR.rst
> @@ -408,7 +408,7 @@ Others
>  	Extract a "slice" from an aggregate.
>  
>  	* .base: (pseudo_t) aggregate (alias .src)
> -	* .from, .len: offet & size of the "slice" within the aggregate
> +	* .from: offet of the "slice" within the aggregate

s/offet/offset/

ATB,
Ramsay Jones

>  	* .target: result
>  	* .type: type of .target
>  
> diff --git a/linearize.c b/linearize.c
> index 0c9b0e59cc4b..96a717bc2909 100644
> --- a/linearize.c
> +++ b/linearize.c
> @@ -470,7 +470,7 @@ const char *show_instruction(struct instruction *insn)
>  		break;
>  
>  	case OP_SLICE:
> -		buf += sprintf(buf, "%s <- %s, %d, %d", show_pseudo(insn->target), show_pseudo(insn->base), insn->from, insn->len);
> +		buf += sprintf(buf, "%s <- %s, %d", show_pseudo(insn->target), show_pseudo(insn->base), insn->from);
>  		break;
>  
>  	case OP_NOT: case OP_NEG:
> @@ -1239,7 +1239,6 @@ static pseudo_t linearize_slice(struct entrypoint *ep, struct expression *expr)
>  
>  	insn->target = new;
>  	insn->from = expr->r_bitpos;
> -	insn->len = expr->r_nrbits;
>  	use_pseudo(insn, pre, &insn->base);
>  	add_one_insn(ep, insn);
>  	return new;
> diff --git a/linearize.h b/linearize.h
> index cf0cf066a8e5..4d83675caaf1 100644
> --- a/linearize.h
> +++ b/linearize.h
> @@ -129,7 +129,7 @@ struct instruction {
>  		};
>  		struct /* slice */ {
>  			pseudo_t base;
> -			unsigned from, len;
> +			unsigned from;
>  		};
>  		struct /* setval */ {
>  			struct expression *val;
> 



[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