From 54ab8bb7d7ae330d272320105f2ef92df6e548b6 Mon Sep 17 00:00:00 2001 From: "jk7744.park" Date: Sat, 24 Oct 2015 18:28:19 +0900 Subject: [PATCH] tizen 2.4 release --- arch/arm/cpu/armv7/s5p-common/usb_downloader.c | 3 ++- common/cmd_ext2.c | 2 +- common/cmd_usbd.c | 23 ++++++++++++++--------- drivers/misc/max77693_fg.c | 3 ++- drivers/misc/mbr.c | 3 ++- drivers/mobile/pit.c | 12 +++++++----- fs/ext4/res_gdt.c | 2 +- 7 files changed, 29 insertions(+), 19 deletions(-) diff --git a/arch/arm/cpu/armv7/s5p-common/usb_downloader.c b/arch/arm/cpu/armv7/s5p-common/usb_downloader.c index f7c8034..da9cad1 100644 --- a/arch/arm/cpu/armv7/s5p-common/usb_downloader.c +++ b/arch/arm/cpu/armv7/s5p-common/usb_downloader.c @@ -25,6 +25,7 @@ #include #include "usb-hs-otg.h" #include +#include #define TX_DATA_LEN 5 #define RX_DATA_LEN 1024 @@ -78,7 +79,7 @@ static void usbd_set_mmc_dev(struct usbd_ops *usbd) /* FIXME */ usbd->mmc_max = 0xf000; usbd->mmc_blk = mmc->read_bl_len; - usbd->mmc_total = mmc->capacity / mmc->read_bl_len; + usbd->mmc_total = lldiv(mmc->capacity, mmc->read_bl_len); sprintf(mmc_name, "%c%c%c", mmc->cid[0] & 0xff, (mmc->cid[1] >> 24), (mmc->cid[1] >> 16) & 0xff); diff --git a/common/cmd_ext2.c b/common/cmd_ext2.c index 313e050..40313d2 100644 --- a/common/cmd_ext2.c +++ b/common/cmd_ext2.c @@ -736,7 +736,7 @@ int mkfs_ext2(block_dev_desc_t *dev_desc, int part_no) if (!get_partition_info(dev_desc, part_no, &info)) { kilobytes = (info.size * info.blksz)/1024; volume_size_bytes = info.size * info.blksz; - volume_size_sect = volume_size_bytes / bytes_per_sect; + volume_size_sect = lldiv(volume_size_bytes, bytes_per_sect); total_sector = volume_size_sect; } else { diff --git a/common/cmd_usbd.c b/common/cmd_usbd.c index dac979c..31b7fca 100644 --- a/common/cmd_usbd.c +++ b/common/cmd_usbd.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -356,7 +357,8 @@ static int fusing_mmc(u32 pit_idx, u32 addr, u32 len, u32 is_last) sprintf(buf, "mmc boot 0 1 1 %d", PIT_BOOTPARTn_GET(part_id)); if (run_command(buf, 0) > 0) { sprintf(buf, "mmc write 0 0x%x 0 0x%x", addr, - (u32)pitparts[pit_idx].size / usbd_ops.mmc_blk); + (u32)lldiv(pitparts[pit_idx].size, + usbd_ops.mmc_blk)); ret = run_command(buf, 0); } else ERROR("s-boot update failed\n"); @@ -374,9 +376,10 @@ static int fusing_mmc(u32 pit_idx, u32 addr, u32 len, u32 is_last) if (part_fstype == PART_FS_TYPE_BASIC) { DEBUG(3, "at hidden partition\n"); ret = mmc_cmd(OPS_WRITE, usbd_ops.mmc_dev, - pitparts[pit_idx].offset / usbd_ops.mmc_blk, - pitparts[pit_idx].size / usbd_ops.mmc_blk, - (void *)addr); + lldiv(pitparts[pit_idx].offset, + usbd_ops.mmc_blk), + lldiv(pitparts[pit_idx].size, + usbd_ops.mmc_blk), (void *)addr); } else { DEBUG(3, "at normal partition as image\n"); int part_base = pit_get_partition_base(); @@ -459,7 +462,8 @@ static int update_pit(void) int mbr_idx = pit_get_partition_base(); memcpy((void *)download_addr, (void *)mbr, len); set_gpt_info(&mmc->block_dev, (char *)download_addr, len, - pitparts[mbr_idx].offset / usbd_ops.mmc_blk); + lldiv(pitparts[mbr_idx].offset, + usbd_ops.mmc_blk)); } /* @@ -475,7 +479,7 @@ static int update_pit(void) /* just erase partition head to format at writing */ DEBUG(1, "erase /boot partition to format"); sprintf(cmd, "mmc erase 0 0x%x 4", - pitparts[boot_idx].offset / usbd_ops.mmc_blk); + lldiv(pitparts[boot_idx].offset, usbd_ops.mmc_blk)); run_command(cmd, 0); } @@ -592,8 +596,8 @@ static int recv_data(int pit_idx) } if (check_speed) - sw_size = (unsigned long long) download_packet_size * - stopwatch_tick_clock() / 1024; /* KB */ + sw_size = lldiv(download_packet_size * stopwatch_tick_clock(), + 1024); /* KB */ while(!final) { if (check_speed) { @@ -621,7 +625,8 @@ static int recv_data(int pit_idx) /* fusing per chunk */ if ((buffered >= PKT_DOWNLOAD_CHUNK_SIZE) || final) { if (check_speed) - printf("[%d MB/s]\n", (u32)(sw_size / sw_time / 1024)); + printf("[%d MB/s]\n", + (u32)lldiv(sw_size, sw_time / 1024)); set_update_state(1); ret = fusing_recv_data(download_addr, pit_idx, MIN(buffered, remained), final); diff --git a/drivers/misc/max77693_fg.c b/drivers/misc/max77693_fg.c index a888092..02ef389 100644 --- a/drivers/misc/max77693_fg.c +++ b/drivers/misc/max77693_fg.c @@ -614,7 +614,8 @@ static int check_fuelgauge_powered(void) void max77693_fg_init(enum battery_type batt_type, int charger_type) { - u32 soc, vcell, vfocv, power_check, table_soc, soc_diff, soc_chk_cnt, check_cnt; + u32 soc, vcell, vfocv, power_check, table_soc, soc_diff; + u32 soc_chk_cnt = 0, check_cnt = 0; u32 raw_data, t_raw_data; u16 status, reg_data; u8 recalculation_type = 0, soc_valid = 0; diff --git a/drivers/misc/mbr.c b/drivers/misc/mbr.c index c4a18dd..b24405e 100644 --- a/drivers/misc/mbr.c +++ b/drivers/misc/mbr.c @@ -6,6 +6,7 @@ #include #include #include +#include #define SIGNATURE ((unsigned short) 0xAA55) @@ -49,7 +50,7 @@ void set_mbr_table(unsigned int start_addr, int parts, unsigned int size = 0; int i, j; - max = mmc->capacity / mmc->read_bl_len; + max = lldiv(mmc->capacity / mmc->read_bl_len); memset(&mbr_table, 0, sizeof(struct mbr)); diff --git a/drivers/mobile/pit.c b/drivers/mobile/pit.c index 1bb4877..de61853 100644 --- a/drivers/mobile/pit.c +++ b/drivers/mobile/pit.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "Tizen_GPT_Ver08.h" #include "Tizen_GPT_Ver13.h" @@ -352,10 +353,10 @@ static void set_mmcparts(char *buf, unsigned long long size, char *name, int id) count_mbr += sprintf(buf + count_mbr, "-(%s)", name); } else { if (size % 1024 == 0) { - size /= 1024; + size = lldiv(size, 1024); if (size % 1024 == 0) count_mbr += sprintf(buf + count_mbr, "%dm", - size / 1024); + lldiv(size, 1024)); else count_mbr += sprintf(buf + count_mbr, "%dk", size); } else { @@ -403,8 +404,8 @@ static int mmc_cmd(int ops, u64 start, u64 cnt, void *addr) return 1; } - start /= mmc->read_bl_len; - cnt /= mmc->read_bl_len; + start = lldiv(start, mmc->read_bl_len); + cnt = lldiv(cnt, mmc->read_bl_len); /*printf("mmc %s 0x%llx 0x%llx\n", ops ? "write" : "read", start, cnt); */ @@ -593,7 +594,8 @@ static int do_pit_update(cmd_tbl_t * cmdtp, int flag, int argc, env = getenv("mbrparts"); if (env && pit_is_switched) { - set_gpt_info(&mmc->block_dev, env, strlen(env), pitparts[partition_index].offset / 512); + set_gpt_info(&mmc->block_dev, env, strlen(env), + lldiv(pitparts[partition_index].offset, 512)); /* file system format */ printf("Please wait for partition format\n"); do_format_parts(); diff --git a/fs/ext4/res_gdt.c b/fs/ext4/res_gdt.c index 1590b52..8f9ac23 100644 --- a/fs/ext4/res_gdt.c +++ b/fs/ext4/res_gdt.c @@ -123,7 +123,7 @@ errcode_t ext2fs_create_resize_inode(ext2_filsys fs) unsigned int grp, last = 0; int gdt_dirty = 0; - gdt_off %= apb; + gdt_off %= (blk_t) apb; if (!dindir_buf[gdt_off]) { /* FIXME XXX XXX blk_t new_blk; -- 2.7.4