Subject: Re: [PATCH bpf-next] bpf: remove useless variable

From: Stefano Brivio <[email-masked]>
Date: Fri, 14 Dec 2018 18:14:52 +0100

On Fri, 14 Dec 2018 17:03:02 +0000
Martin Lau <[email-masked]> wrote:

> On Thu, Dec 13, 2018 at 10:44:57PM +0100, Andrea Claudi wrote:
> > bytes is initialized to end - start at the beginning of this function,
> > and is never changed. Remove it making the code a bit more readable.
> > 
> > Suggested-by: Stefano Brivio <[email-masked]>
> > Signed-off-by: Andrea Claudi <[email-masked]>  
> The change looks correct.
> I found the original code more intuitive to read though.
> Daniel/John, thoughts?

In detail: the idea behind my suggestion was that:

	bytes_sg_total = start - offset + bytes;

sounds like: start from 'start', move back by 'offset' (where am I
now?), add 'bytes' (what is 'bytes'? Oh, it's end - start...). Whereas:

	bytes_sg_total = end - offset;

looked easier to follow: total bytes are the distance between 'end' and
'offset'.

-- 
Stefano