On Tuesday 03 July 2012 05:38:07 Lukasz Majewski wrote:
> +             puts("UPLOAD ... done\n");
> +             puts("Ctrl+C to exit ...\n");

combine into a single puts() ?

> +static int dfu_fill_entity(struct dfu_entity *dfu, char* s, int alt,
> +                         char *interface, int num)
> +{
> +     char *st = NULL;
> +     int n = 0;
> +
> +     debug("%s: %s interface: %s num: %d\n", __func__, s, interface, num);
> +
> +     st = dfu_extract_token(&s, &n);
> +     strncpy((char *) &dfu->name, st, n);

what's with the pointless cast ?  just do:
        strncpy(dfu->name, st, n);

also, "n" here is wrong.  it should be sizeof(dfu->name), not (presumably) the 
length of st.  considering this is the 2nd time i noticed this bug in the dfu 
patchset, you might want to do a grep on your patches to see if your other 
string related usage is wrong.

> +void dfu_free_entities(void)
> +{
> +     struct dfu_entity *dfu = NULL, *p = NULL;

no point in assigning to NULL here

> +static char *dfu_get_dev_type(enum dfu_device_type t)

static const char *...

> +{
> +     static char *dev_t[] = {NULL, "MMC", "ONENAND", "NAND" };

static const char * const dev_t[] = {...}

> +static char *dfu_get_layout(enum dfu_device_type l)

static const char *...

> +{
> +     static char *dfu_layout[] = {NULL, "RAW_ADDR", "FAT", "EXT" };

static const char * const dfu_layout[] = {...}

> +void dfu_show_entities(void)
> +{
> +     struct dfu_entity *dfu = NULL;

no point in assigning to NULL

> +struct dfu_entity *dfu_get_entity(int alt)
> +{
> +     struct dfu_entity *dfu = NULL;

no point in assigning to NULL
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to