From fff6a649c03f28cc6255e48b8dde1342aea532d9 Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Wed, 1 Dec 2010 11:32:56 +0900 Subject: [PATCH] mbr: remove compiler warnings mbr.c: In function 'get_ebr_table': mbr.c:140: warning: implicit declaration of function 'mmc_read_blocks' mbr.c:133: warning: unused variable 'cylinder' mbr.c:133: warning: unused variable 'sector' mbr.c:132: warning: unused variable 'msg' mbr.c:353: warning: initialization from incompatible pointer type cmd_usbd.c: In function 'set_mbr_info': cmd_usbd.c:726: warning: implicit declaration of function 'set_mbr_table' cmd_usbd.c: In function 'do_usbd_down': cmd_usbd.c:1401: warning: implicit declaration of function 'get_mbr_table' Signed-off-by: Minkyu Kang --- common/cmd_usbd.c | 2 ++ drivers/misc/mbr.c | 19 ++++++++++--------- include/mbr.h | 7 +++++++ 3 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 include/mbr.h diff --git a/common/cmd_usbd.c b/common/cmd_usbd.c index 5cd0fae..eba0950 100644 --- a/common/cmd_usbd.c +++ b/common/cmd_usbd.c @@ -30,6 +30,8 @@ static struct part_info *parts[16]; #include #endif +#include + static const char pszMe[] = "usbd: "; static struct usbd_ops usbd_ops; diff --git a/drivers/misc/mbr.c b/drivers/misc/mbr.c index 7d2e687..de728b1 100644 --- a/drivers/misc/mbr.c +++ b/drivers/misc/mbr.c @@ -28,7 +28,7 @@ struct mbr { unsigned short signature; }; -void set_chs_value(struct mbr_partition *part, int part_num) +static inline void set_chs_value(struct mbr_partition *part, int part_num) { /* FIXME */ if (part_num == 0) { @@ -129,15 +129,15 @@ static int get_ebr_table(struct mmc *mmc, struct mbr_partition *mp, { struct mbr *ebr; struct mbr_partition *p; - char buf[512], msg[512]; - int ret, i, sector, cylinder; + char buf[512]; + int ret, i; int lba = 0; if (ebr_next) lba = extended_lba; lba += mp->lba; - ret = mmc_read_blocks(mmc, buf, lba , 1); + ret = mmc->block_dev.block_read(0, lba, 1, buf); if (ret != 1) { printf("%s[%d] mmc_read_blocks %d\n", __func__, __LINE__, ret); return 0; @@ -179,7 +179,7 @@ int get_mbr_table(unsigned int *part_offset) mmc_init(mmc); - ret = mmc_read_blocks(mmc, buf, 0, 1); + ret = mmc->block_dev.block_read(0, 0, 1, buf); if (ret != 1) { printf("%s[%d] mmc_read_blocks %d\n", __func__, __LINE__, ret); return 0; @@ -233,7 +233,8 @@ static void ebr_show(struct mmc *mmc, struct mbr_partition *mp, int ebr_next) lba += mp->lba; printf(">>> Read sector from 0x%08x (LBA: 0x%08x + 0x%x)\n", lba, mp->lba, (lba == mp->lba) ? 0 : lba - mp->lba); - ret = mmc_read_blocks(mmc, buf, lba , 1); + + ret = mmc->block_dev.block_read(0, lba, 1, buf); if (ret != 1) { printf("%s[%d] mmc_read_blocks %d\n", __func__, __LINE__, ret); return; @@ -269,7 +270,7 @@ static void ebr_show(struct mmc *mmc, struct mbr_partition *mp, int ebr_next) } lba += 16; - ret = mmc_read_blocks(mmc, msg, lba, 1); + ret = mmc->block_dev.block_read(0, lba, 1, msg); for (i = 0; i < 8; i++) putc(msg[i]); @@ -291,7 +292,7 @@ static void mbr_show(void) mmc_init(mmc); - ret = mmc_read_blocks(mmc, buf, 0, 1); + ret = mmc->block_dev.block_read(0, 0, 1, buf); if (ret != 1) { printf("%s[%d] mmc_read_blocks %d\n", __func__, __LINE__, ret); return; @@ -333,7 +334,7 @@ static void mbr_show(void) } } -static int do_mbr(cmd_tbl_t *cmdtp, int flag, int argc, const char *argv[]) +static int do_mbr(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { switch (argc) { case 2: diff --git a/include/mbr.h b/include/mbr.h new file mode 100644 index 0000000..e176fac --- /dev/null +++ b/include/mbr.h @@ -0,0 +1,7 @@ +/* + * Copyright (C) 2010 Samsung Electrnoics + */ + +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); -- 2.7.4