On Sun, Jun 22, 2008 at 01:56:12PM -0500, Menon, Nishanth wrote:
> i2cdev command is introduced here. This allows
> for device creation for doing i2c ops. With tab
> indents corrected.

Nice and short ;) , just one comment...

 +
> +       while ((opt = getopt(argc, argv, "arb:d:")) > 0) {
> +               switch (opt) {
> +               case 'a':
> +                       if (rem) {
> +                               fprintf(stderr,
> +                                       "you cannot add when you selected "
> +                                       "delete!\n");
> +                               goto fail_ret;
> +                       }
> +                       add = 1;
> +                       break;
> +               case 'r':
> +                       if (add) {
> +                               fprintf(stderr,
> +                                       "you cannot delete when you selected "
> +                                       "add!\n");
> +                               goto fail_ret;
> +                       }
> +                       rem = 1;
> +                       break;
> +               case 'b':
> +                       bus_dev = optarg;
> +                       break;
> +               case 'd':
> +                       dev_addr = (int)simple_strtoul(optarg, NULL, 10);
> +                       if (dev_addr > 0xFF) {
> +                               fprintf(stderr, "I2C address are b/w 0 and "
> +                                       "0x7f\n");
> +                               goto fail_ret;
> +                       }
> +                       break;
> +               default:
> +                       fprintf(stderr, "unknown arg %s\n", opt);
> +                       goto fail_ret;
> +               }
> +       }

Instead of two seperate if claues above:

if (add && rem) {
        printf("both remove and add are selected\n");
        goto fail_ret;
}

Regards,
   Sascha

-- 
Pengutronix e.K. - Linux Solutions for Science and Industry
-----------------------------------------------------------
Kontakt-Informationen finden Sie im Header dieser Mail oder
auf der Webseite -> http://www.pengutronix.de/impressum/ <-

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
U-Boot-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Reply via email to