From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Fri, 20 Jul 2012 00:32:00 -0400 Subject: [U-Boot] [PATCH 3/7] dfu: DFU backend implementation In-Reply-To: <1341308291-14663-4-git-send-email-l.majewski@samsung.com> References: <1341308291-14663-1-git-send-email-l.majewski@samsung.com> <1341308291-14663-4-git-send-email-l.majewski@samsung.com> Message-ID: <201207200032.01591.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. URL: