Dear Chuanhua Han,

In message 
<am6pr04mb43572355560df1349d6bc16097...@am6pr04mb4357.eurprd04.prod.outlook.com>
 you wrote:
> 
> > This is a really long list where you repeat the very same code again and 
> > again
> > and again.  Would it not make sense to declare a data array (holding pairs 
> > of
> > <offset>, <data> entries), and then iterrate over the loop?  The could 
> > would be
> > much easier to read and also much smaller...
> It seems feasible to use the array you mentioned, but some of the
> values to be set by i2c are obtained by index I /j in other
> arrays.

Yes, so what? You can write these values into your data array, too,
right?

>  So we keep setting the i2c register in the same way as before.

Please don't.  This code is ugly.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Physician: One upon whom we set our hopes when ill and our dogs  when
well.                                                - Ambrose Bierce
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to