lkml.org 
[lkml]   [2009]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: s5k3e2fx.c: reduce complexity by factoring
On 12/14/2009 08:02 PM, Ray Lee wrote:
> On Sat, Dec 5, 2009 at 6:03 PM, Justin Madru<jdm64@gawab.com> wrote:
>
>> I was style fixing some code when I ran into this code.
>> It seems like the code could be reduced, by factoring the expression.
>> But this results in a very simple expression.
>>
>> Am I assuming something wrong? Or is this a bug in the original code?
>> This doesn't look right because the assignment of s_move[i] has no mention
>> of the loop counter.
>>
> Algebraic factoring is not valid in general when dealing with pure
> integer expressions that may contain rounding issues. I haven't
> checked to see if that's the case with the code you're changing, but
> that sort of expression you're removing is very commonly used exactly
> to deal with rounding issues.
>

I know that's true and that's why I was questioning if my patch actually
removed a necessary calculation.
But, wouldn't you agree that if the code was suppose to deal with
"rounding issues" that there's a
simpler expression?

Justin


\
 
 \ /
  Last update: 2009-12-15 19:43    [W:0.091 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site