All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] redundant code in common/cmd_i2c.
@ 2009-11-11 15:14 PratapChandu
  2009-11-12  8:14 ` Heiko Schocher
  0 siblings, 1 reply; 4+ messages in thread
From: PratapChandu @ 2009-11-11 15:14 UTC (permalink / raw)
  To: u-boot

The following code fragment in the file common/cmd_i2c.c  seems to be redundant.
Is not good to delete  ?

Line 330 - 336 is like below

#if 0
        for (timeout = 0; timeout < 10; timeout++) {
            udelay(2000);
            if (i2c_probe(chip) == 0)
                break;
        }
#endif


Regards
Pratap Chandu
Indian Institute of Tecnology , Roorkee

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] redundant code in common/cmd_i2c.
  2009-11-11 15:14 [U-Boot] redundant code in common/cmd_i2c PratapChandu
@ 2009-11-12  8:14 ` Heiko Schocher
  2009-11-12 14:38   ` Detlev Zundel
  0 siblings, 1 reply; 4+ messages in thread
From: Heiko Schocher @ 2009-11-12  8:14 UTC (permalink / raw)
  To: u-boot

Hello PratapChandu,

PratapChandu wrote:
> The following code fragment in the file common/cmd_i2c.c  seems to be redundant.
> Is not good to delete  ?
> 
> Line 330 - 336 is like below
> 
> #if 0
>         for (timeout = 0; timeout < 10; timeout++) {
>             udelay(2000);
>             if (i2c_probe(chip) == 0)
>                 break;
>         }
> #endif

Yes, this seems to be dead code. Please provide a patch for removing
it.

Thanks.

bye
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] redundant code in common/cmd_i2c.
  2009-11-12  8:14 ` Heiko Schocher
@ 2009-11-12 14:38   ` Detlev Zundel
  2009-11-13 10:03     ` Heiko Schocher
  0 siblings, 1 reply; 4+ messages in thread
From: Detlev Zundel @ 2009-11-12 14:38 UTC (permalink / raw)
  To: u-boot

Hi Heiko,

> Hello PratapChandu,
>
> PratapChandu wrote:
>> The following code fragment in the file common/cmd_i2c.c  seems to be redundant.
>> Is not good to delete  ?
>> 
>> Line 330 - 336 is like below
>> 
>> #if 0
>>         for (timeout = 0; timeout < 10; timeout++) {
>>             udelay(2000);
>>             if (i2c_probe(chip) == 0)
>>                 break;
>>         }
>> #endif
>
> Yes, this seems to be dead code. Please provide a patch for removing
> it.

Ah uh, check the comment above which is directly related to this piece
of code.  if you remove only the code, you have a dangling comment.
Maybe this was meant to be an option but nobody cared to make it
optional?

Actually I do not know if this was ever used, but we should try to do
the change consistently.

Cheers
  Detlev

-- 
[Linux] USB consoles was a  bad hack written on a drunken dare.   I'm still
constantly amazed that the thing even works at all, let alone the fact that
people are actually using it :) 
                            -- Greg KH <20090420225358.GC28697@kroah.com>
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] redundant code in common/cmd_i2c.
  2009-11-12 14:38   ` Detlev Zundel
@ 2009-11-13 10:03     ` Heiko Schocher
  0 siblings, 0 replies; 4+ messages in thread
From: Heiko Schocher @ 2009-11-13 10:03 UTC (permalink / raw)
  To: u-boot

Hello Detlev,

Detlev Zundel wrote:
>> Hello PratapChandu,
>>
>> PratapChandu wrote:
>>> The following code fragment in the file common/cmd_i2c.c  seems to be redundant.
>>> Is not good to delete  ?
>>>
>>> Line 330 - 336 is like below
>>>
>>> #if 0
>>>         for (timeout = 0; timeout < 10; timeout++) {
>>>             udelay(2000);
>>>             if (i2c_probe(chip) == 0)
>>>                 break;
>>>         }
>>> #endif
>> Yes, this seems to be dead code. Please provide a patch for removing
>> it.
> 
> Ah uh, check the comment above which is directly related to this piece
> of code.  if you remove only the code, you have a dangling comment.
> Maybe this was meant to be an option but nobody cared to make it
> optional?

Yep, you are right, a patch schould fix the comment too, or (maybe better?)
make this as an option configurable ...

> Actually I do not know if this was ever used, but we should try to do
> the change consistently.

Yep.

Thanks for detecting this!

bye
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-11-13 10:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-11 15:14 [U-Boot] redundant code in common/cmd_i2c PratapChandu
2009-11-12  8:14 ` Heiko Schocher
2009-11-12 14:38   ` Detlev Zundel
2009-11-13 10:03     ` Heiko Schocher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.