public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Justin Madru <jdm64@gawab.com>
To: Ray Lee <ray-lk@madrabbit.org>
Cc: gregkh@suse.de, linux-kernel@vger.kernel.org,
	Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH] staging: s5k3e2fx.c: reduce complexity by factoring
Date: Tue, 15 Dec 2009 10:37:10 -0800	[thread overview]
Message-ID: <4B27D756.4050102@gawab.com> (raw)
In-Reply-To: <2c0942db0912142002p638a187araa837812862e5b17@mail.gmail.com>

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

  reply	other threads:[~2009-12-15 18:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-06  2:03 [PATCH] staging: s5k3e2fx.c: reduce complexity by factoring Justin Madru
2009-12-09  9:57 ` Dan Carpenter
2009-12-15  0:38   ` Justin Madru
2009-12-15  0:47     ` Greg KH
2009-12-15  4:02 ` Ray Lee
2009-12-15 18:37   ` Justin Madru [this message]
2009-12-15 19:10     ` Ray Lee
2009-12-15 20:57       ` Justin Madru

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B27D756.4050102@gawab.com \
    --to=jdm64@gawab.com \
    --cc=error27@gmail.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ray-lk@madrabbit.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox