Home
last modified time | relevance | path

Searched refs:remainder (Results 1 – 25 of 177) sorted by relevance

12345678

/linux-6.6.21/lib/math/
Ddiv64.c67 s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) in div_s64_rem() argument
72 quotient = div_u64_rem(-dividend, abs(divisor), (u32 *)remainder); in div_s64_rem()
73 *remainder = -*remainder; in div_s64_rem()
77 quotient = div_u64_rem(dividend, abs(divisor), (u32 *)remainder); in div_s64_rem()
98 u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) in div64_u64_rem() argument
106 *remainder = rem32; in div64_u64_rem()
114 *remainder = dividend - quot * divisor; in div64_u64_rem()
115 if (*remainder >= divisor) { in div64_u64_rem()
117 *remainder -= divisor; in div64_u64_rem()
179 u32 iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder) in iter_div_u64_rem() argument
[all …]
Dtest_div64.c57 u32 remainder; member
152 static inline bool test_div64_verify(u64 quotient, u32 remainder, int i, int j) in test_div64_verify() argument
155 remainder == test_div64_results[i][j].remainder); in test_div64_verify()
166 u32 remainder; \
169 remainder = do_div(quotient, divisor); \
170 if (!test_div64_verify(quotient, remainder, i, j)) { \
172 dividend, divisor, quotient, remainder); \
175 test_div64_results[i][j].remainder); \
/linux-6.6.21/Documentation/staging/
Dcrc32.rst5 A CRC is a long-division remainder. You add the CRC to the message,
9 remainder computed on the message+CRC is 0. This latter approach
20 Like all division, the remainder is always smaller than the divisor.
36 and append it to the current remainder. Then you figure out the
37 appropriate multiple of the divisor to subtract to being the remainder
39 and to make the XOR cancel, it's just a copy of bit 32 of the remainder.
43 the polynomial from the remainder and we're back to where we started,
49 multiple = remainder & 0x80000000 ? CRCPOLY : 0;
50 remainder = (remainder << 1 | next_input_bit()) ^ multiple;
53 Notice how, to get at bit 32 of the shifted remainder, we look
[all …]
/linux-6.6.21/drivers/acpi/acpica/
Dutmath.c318 union uint64_overlay remainder; in acpi_ut_divide() local
341 remainder.part.hi = 0; in acpi_ut_divide()
351 quotient.part.lo, remainder.part.lo); in acpi_ut_divide()
388 remainder.part.hi = partial3.part.lo; in acpi_ut_divide()
389 remainder.part.lo = partial2.part.lo; in acpi_ut_divide()
396 remainder.full -= divisor.full; in acpi_ut_divide()
400 remainder.full -= divisor.full; in acpi_ut_divide()
404 remainder.full = remainder.full - dividend.full; in acpi_ut_divide()
405 remainder.part.hi = (u32)-((s32)remainder.part.hi); in acpi_ut_divide()
406 remainder.part.lo = (u32)-((s32)remainder.part.lo); in acpi_ut_divide()
[all …]
Dexconvrt.c268 u32 remainder; in acpi_ex_convert_to_ascii() local
297 remainder = 0; in acpi_ex_convert_to_ascii()
306 &remainder); in acpi_ex_convert_to_ascii()
311 if (remainder != 0) { in acpi_ex_convert_to_ascii()
316 string[k] = (u8) (ACPI_ASCII_ZERO + remainder); in acpi_ex_convert_to_ascii()
Dexutils.c342 u32 remainder; in acpi_ex_integer_to_string() local
350 (void)acpi_ut_short_divide(value, 10, &value, &remainder); in acpi_ex_integer_to_string()
351 out_string[count - 1] = (char)('0' + remainder); in acpi_ex_integer_to_string()
/linux-6.6.21/include/linux/
Dmath64.h26 static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) in div_u64_rem() argument
28 *remainder = dividend % divisor; in div_u64_rem()
40 static inline s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) in div_s64_rem() argument
42 *remainder = dividend % divisor; in div_s64_rem()
54 static inline u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) in div64_u64_rem() argument
56 *remainder = dividend % divisor; in div64_u64_rem()
90 static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) in div_u64_rem() argument
92 *remainder = do_div(dividend, divisor); in div_u64_rem()
98 extern s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder);
102 extern u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder);
[all …]
/linux-6.6.21/drivers/gpu/drm/amd/display/dc/dml/
Ddml_inline_defs.h129 unsigned int remainder; in dml_round_to_multiple() local
134 remainder = num % multiple; in dml_round_to_multiple()
136 if (remainder == 0) in dml_round_to_multiple()
140 return (num + multiple - remainder); in dml_round_to_multiple()
142 return (num - remainder); in dml_round_to_multiple()
/linux-6.6.21/drivers/gpu/drm/amd/display/dc/dml/calcs/
Dbw_fixed.c64 uint64_t remainder; in bw_frc_to_fixed() local
73 res_value = div64_u64_rem(arg1_value, arg2_value, &remainder); in bw_frc_to_fixed()
82 remainder <<= 1; in bw_frc_to_fixed()
86 if (remainder >= arg2_value) { in bw_frc_to_fixed()
88 remainder -= arg2_value; in bw_frc_to_fixed()
95 uint64_t summand = (remainder << 1) >= arg2_value; in bw_frc_to_fixed()
/linux-6.6.21/drivers/gpu/drm/amd/display/dc/basics/
Dfixpt31_32.c50 unsigned long long *remainder) in complete_integer_division_u64() argument
56 result = div64_u64_rem(dividend, divisor, remainder); in complete_integer_division_u64()
81 unsigned long long remainder; in dc_fixpt_from_fraction() local
86 arg1_value, arg2_value, &remainder); in dc_fixpt_from_fraction()
95 remainder <<= 1; in dc_fixpt_from_fraction()
99 if (remainder >= arg2_value) { in dc_fixpt_from_fraction()
101 remainder -= arg2_value; in dc_fixpt_from_fraction()
108 unsigned long long summand = (remainder << 1) >= arg2_value; in dc_fixpt_from_fraction()
Dconversion.c106 uint32_t remainder = 0; in find_gcd() local
108 remainder = a % b; in find_gcd()
110 b = remainder; in find_gcd()
/linux-6.6.21/drivers/net/wireless/realtek/rtw89/
Dutil.h23 static inline s32 s32_div_u32_round_down(s32 dividend, u32 divisor, s32 *remainder) in s32_div_u32_round_down() argument
37 if (remainder) in s32_div_u32_round_down()
38 *remainder = i_remainder; in s32_div_u32_round_down()
/linux-6.6.21/net/sunrpc/
Dsocklib.c269 unsigned int remainder = rmsize + xdr->len - base; in xprt_sock_sendmsg() local
283 remainder -= len; in xprt_sock_sendmsg()
284 if (remainder == 0) in xprt_sock_sendmsg()
291 if (remainder == 0 || err != len) in xprt_sock_sendmsg()
302 remainder -= len; in xprt_sock_sendmsg()
303 if (remainder == 0) in xprt_sock_sendmsg()
306 if (remainder == 0 || err != len) in xprt_sock_sendmsg()
/linux-6.6.21/drivers/pci/
Ddoe.c149 size_t length, remainder; in pci_doe_send_req() local
187 remainder = task->request_pl_sz % sizeof(__le32); in pci_doe_send_req()
188 if (remainder) { in pci_doe_send_req()
190 memcpy(&val, &task->request_pl[i], remainder); in pci_doe_send_req()
214 size_t length, payload_length, remainder, received; in pci_doe_recv_resp() local
247 remainder = task->response_pl_sz % sizeof(__le32); in pci_doe_recv_resp()
250 if (!remainder) in pci_doe_recv_resp()
251 remainder = sizeof(__le32); in pci_doe_recv_resp()
256 remainder = sizeof(__le32); in pci_doe_recv_resp()
271 memcpy(&task->response_pl[i], &val, remainder); in pci_doe_recv_resp()
/linux-6.6.21/kernel/time/
Dtimeconv.c53 int remainder; in time64_to_tm() local
55 days = div_s64_rem(totalsecs, SECS_PER_DAY, &remainder); in time64_to_tm()
56 rem = remainder; in time64_to_tm()
/linux-6.6.21/include/vdso/
Dmath64.h6 __iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder) in __iter_div_u64_rem() argument
19 *remainder = dividend; in __iter_div_u64_rem()
/linux-6.6.21/drivers/mmc/core/
Dsdio_io.c318 unsigned remainder = size; in sdio_io_rw_ext_helper() local
331 while (remainder >= func->cur_blksize) { in sdio_io_rw_ext_helper()
334 blocks = remainder / func->cur_blksize; in sdio_io_rw_ext_helper()
345 remainder -= size; in sdio_io_rw_ext_helper()
353 while (remainder > 0) { in sdio_io_rw_ext_helper()
354 size = min(remainder, sdio_max_byte_size(func)); in sdio_io_rw_ext_helper()
362 remainder -= size; in sdio_io_rw_ext_helper()
/linux-6.6.21/drivers/clk/at91/
Dclk-pll.c175 unsigned long remainder; in clk_pll_get_best_div_mul() local
186 remainder = tmprate - rate; in clk_pll_get_best_div_mul()
188 remainder = rate - tmprate; in clk_pll_get_best_div_mul()
195 if (remainder < bestremainder) { in clk_pll_get_best_div_mul()
196 bestremainder = remainder; in clk_pll_get_best_div_mul()
206 if (!remainder) in clk_pll_get_best_div_mul()
/linux-6.6.21/arch/x86/boot/
Dstring.c201 static inline u64 __div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) in __div_u64_rem() argument
215 asm ("divl %2" : "=a" (d.v32[0]), "=d" (*remainder) : in __div_u64_rem()
222 u32 remainder; in __div_u64() local
224 return __div_u64_rem(dividend, divisor, &remainder); in __div_u64()
/linux-6.6.21/lib/
Dstring_helpers.c54 u32 remainder = 0, sf_cap; in string_get_size() local
92 remainder = do_div(size, divisor[units]); in string_get_size()
106 remainder *= 1000; in string_get_size()
107 remainder >>= 10; in string_get_size()
112 remainder += rounding[j]; in string_get_size()
113 if (remainder >= 1000) { in string_get_size()
114 remainder -= 1000; in string_get_size()
119 snprintf(tmp, sizeof(tmp), ".%03u", remainder); in string_get_size()
/linux-6.6.21/drivers/video/fbdev/
Dasiliantfb.c118 unsigned remainder; in asiliant_calc_dclk2() local
123 remainder = 1000000 % pixclock; in asiliant_calc_dclk2()
124 Ftarget = 1000000 * ratio + (1000000 * remainder) / pixclock; in asiliant_calc_dclk2()
132 remainder = Ftarget % Fref; in asiliant_calc_dclk2()
137 unsigned m = n * ratio + (n * remainder) / Fref; in asiliant_calc_dclk2()
227 unsigned long Ftarget, ratio, remainder; in asiliantfb_check_var() local
233 remainder = 1000000 % var->pixclock; in asiliantfb_check_var()
234 Ftarget = 1000000 * ratio + (1000000 * remainder) / var->pixclock; in asiliantfb_check_var()
/linux-6.6.21/drivers/spi/
Dspi-slave-mt27xx.c167 int reg_val, cnt, remainder, ret; in mtk_spi_slave_fifo_transfer() local
183 remainder = xfer->len % 4; in mtk_spi_slave_fifo_transfer()
184 if (xfer->tx_buf && remainder > 0) { in mtk_spi_slave_fifo_transfer()
186 memcpy(&reg_val, xfer->tx_buf + cnt * 4, remainder); in mtk_spi_slave_fifo_transfer()
332 u32 int_status, reg_val, cnt, remainder; in mtk_spi_slave_interrupt() local
363 remainder = trans->len % 4; in mtk_spi_slave_interrupt()
364 if (trans->rx_buf && remainder > 0) { in mtk_spi_slave_interrupt()
367 &reg_val, remainder); in mtk_spi_slave_interrupt()
Dspi-qup.c263 u32 remainder, words_per_block, num_words; in spi_qup_read() local
266 remainder = DIV_ROUND_UP(spi_qup_len(controller) - controller->rx_bytes, in spi_qup_read()
275 if (!remainder) in spi_qup_read()
279 num_words = (remainder > words_per_block) ? in spi_qup_read()
280 words_per_block : remainder; in spi_qup_read()
292 remainder -= num_words; in spi_qup_read()
299 } while (remainder); in spi_qup_read()
308 if (!remainder) { in spi_qup_read()
350 u32 remainder, words_per_block, num_words; in spi_qup_write() local
352 remainder = DIV_ROUND_UP(spi_qup_len(controller) - controller->tx_bytes, in spi_qup_write()
[all …]
/linux-6.6.21/drivers/dma/qcom/
Dqcom_adm.c236 u32 remainder = sg_dma_len(sg); in adm_process_fc_descriptors() local
254 while (remainder >= burst) { in adm_process_fc_descriptors()
261 rows = remainder / burst; in adm_process_fc_descriptors()
267 remainder -= burst * rows; in adm_process_fc_descriptors()
272 if (remainder) { in adm_process_fc_descriptors()
275 single_desc->len = remainder; in adm_process_fc_descriptors()
303 u32 remainder = sg_dma_len(sg); in adm_process_non_fc_descriptors() local
321 single_desc->len = (remainder > ADM_MAX_XFER) ? in adm_process_non_fc_descriptors()
322 ADM_MAX_XFER : remainder; in adm_process_non_fc_descriptors()
324 remainder -= single_desc->len; in adm_process_non_fc_descriptors()
[all …]
/linux-6.6.21/drivers/net/usb/
Dkalmia.c164 u8 remainder, padlen = 0; in kalmia_tx_fixup() local
209 remainder = skb->len % KALMIA_ALIGN_SIZE; in kalmia_tx_fixup()
210 if (remainder > 0) { in kalmia_tx_fixup()
211 padlen = KALMIA_ALIGN_SIZE - remainder; in kalmia_tx_fixup()

12345678