[U-Boot] [PATCH 2/4] dfu: generic backend parts

Mike Frysinger vapier at gentoo.org
Sun Jan 8 06:13:36 CET 2012


On Wednesday 09 November 2011 04:52:21 Andrzej Pietrasiewicz wrote:
> --- /dev/null
> +++ b/drivers/usb/dfu/Makefile
>
> +ifdef CONFIG_MMC
> +COBJS-y += mmc.o
> +endif
> +
> +ifdef CONFIG_CMD_FAT
> +COBJS-y += fat.o
> +endif

COBJS-$(CONFIG_XXX) += foo.o

> --- /dev/null
> +++ b/drivers/usb/dfu/fat.c
> @@ -0,0 +1,77 @@
> +#include <common.h>
> +#include <fat.h>
> +#include <dfu_backend.h>

missing intro comment block

> +inline int set_fat_part_num(int pnum)

there seems to be a lot of funcs in this file and others that have misplaced 
"inline" markings

> --- /dev/null
> +++ b/include/dfu_backend.h
>
> +extern void board_dfu_init(void);
> +extern int board_dfu_cleanup(void);
> +extern int usb_gadget_handle_interrupts(void);
> +
> +extern int read_mmc(void *buf, unsigned int len, unsigned long from);
> +extern int write_mmc(void *buf, unsigned int len, unsigned long from);
> +
> +extern block_dev_desc_t *set_fat_dev(block_dev_desc_t *d);
> +extern int set_fat_part_num(int pnum);
> +extern const char *set_fat_filename(const char *fn);
> +extern int read_fat(void *buf, unsigned int len, unsigned long from);
> +extern int write_fat(void *buf, unsigned int len, unsigned long from);
> +
> +extern int read_mbr(struct mmc *mmc, struct mbr_part_data *pd, int
> *extended_lba, int mmc_mbr_dev); +
> +extern int read_block(void *ctx, unsigned int n, void *buf);
> +extern int write_block(void *ctx, unsigned int n, void *buf);
> +extern int generic_prepare(void *ctx, u8 mode);
> +extern int generic_finish(void *ctx, u8 mode);

API needs to be namespaced here with like "dfu_" prefixes

> --- /dev/null
> +++ b/include/mbr.h

file needs protection against multiple inclusion

> +void set_mbr_dev(int dev);
> +void set_mbr_info(char *ramaddr, unsigned int len, unsigned int reserved);
> +void set_mbr_table(unsigned int start_addr, int parts,
> +		unsigned int *blocks, unsigned int *part_offset);
> +int get_mbr_table(unsigned int *part_offset);

seems like you declare funcs here that aren't actually defined ...
-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: <http://lists.denx.de/pipermail/u-boot/attachments/20120108/d4a5dfd1/attachment.pgp>


More information about the U-Boot mailing list