Re: [PATCH] net: tg3: tidy up loop, remove need to compute off with a multiply

2020-05-08 Thread Michael Chan
On Fri, May 8, 2020 at 7:31 PM Joe Perches wrote: > > On Fri, 2020-05-08 at 18:48 -0700, Jakub Kicinski wrote: > > On Sat, 9 May 2020 00:31:03 +0100 Colin Ian King wrote: > > > > My preference would be for > > > > > > > > { > > > > int i; > > > > u32 off = 0; > > > > > > > > for (i = 0; i <

Re: [PATCH] net: tg3: tidy up loop, remove need to compute off with a multiply

2020-05-08 Thread Joe Perches
On Fri, 2020-05-08 at 18:48 -0700, Jakub Kicinski wrote: > On Sat, 9 May 2020 00:31:03 +0100 Colin Ian King wrote: > > > My preference would be for > > > > > > { > > > int i; > > > u32 off = 0; > > > > > > for (i = 0; i < TG3_SD_NUM_RECS; i++) { > > > tg3_ape_scratchpad_read(tp,

Re: [PATCH] net: tg3: tidy up loop, remove need to compute off with a multiply

2020-05-08 Thread Jakub Kicinski
On Sat, 9 May 2020 00:31:03 +0100 Colin Ian King wrote: > > My preference would be for > > > > { > > int i; > > u32 off = 0; > > > > for (i = 0; i < TG3_SD_NUM_RECS; i++) { > > tg3_ape_scratchpad_read(tp, (u32 *)ocir, off, TC3_OCIR_LEN); > > > > if

Re: [PATCH] net: tg3: tidy up loop, remove need to compute off with a multiply

2020-05-08 Thread Colin Ian King
On 09/05/2020 00:21, Joe Perches wrote: > On Fri, 2020-05-08 at 23:53 +0100, Colin King wrote: >> From: Colin Ian King >> >> Currently the value for 'off' is computed using a multiplication and >> a couple of statements later off is being incremented by len and >> this value is never read. Clean

Re: [PATCH] net: tg3: tidy up loop, remove need to compute off with a multiply

2020-05-08 Thread Joe Perches
On Fri, 2020-05-08 at 23:53 +0100, Colin King wrote: > From: Colin Ian King > > Currently the value for 'off' is computed using a multiplication and > a couple of statements later off is being incremented by len and > this value is never read. Clean up the code by removing the > multiplication

Re: [PATCH] net: tg3: tidy up loop, remove need to compute off with a multiply

2020-05-08 Thread Michael Chan
On Fri, May 8, 2020 at 3:53 PM Colin King wrote: > > From: Colin Ian King > > Currently the value for 'off' is computed using a multiplication and > a couple of statements later off is being incremented by len and > this value is never read. Clean up the code by removing the > multiplication

[PATCH] net: tg3: tidy up loop, remove need to compute off with a multiply

2020-05-08 Thread Colin King
From: Colin Ian King Currently the value for 'off' is computed using a multiplication and a couple of statements later off is being incremented by len and this value is never read. Clean up the code by removing the multiplication and just increment off by len on each iteration. Also use len