hv: clean up div related code

- replace udiv64 with direct integer divide
- remove lib/div.c

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Shiqing Gao
2018-09-12 13:31:42 +08:00
committed by lijinxia
parent 1d2ed1adee
commit 7cab77dace
4 changed files with 2 additions and 132 deletions

View File

@@ -348,8 +348,6 @@ static int print_decimal(struct print_param *param, int64_t value)
union u_qword v;
/* next value in 32/64 bit */
union u_qword nv;
/* helper union for division result */
struct udiv_result d;
int ret;
/* assume an unsigned 64 bit value */
@@ -381,10 +379,9 @@ static int print_decimal(struct print_param *param, int64_t value)
/* process 64 bit value as long as needed */
while (v.dwords.high != 0U) {
/* determine digits from right to left */
udiv64(v.qword, 10U, &d);
pos--;
*pos = d.r.dwords.low + '0';
v.qword = d.q.qword;
*pos = (char)(v.qword % 10UL) + '0';
v.qword = v.qword / 10UL;
}
/* process 32 bit (or reduced 64 bit) value */