/linux-6.12.1/Documentation/staging/ |
D | crc32.rst | 5 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.12.1/drivers/acpi/acpica/ |
D | utmath.c | 318 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 …]
|
D | exconvrt.c | 271 u32 remainder; in acpi_ex_convert_to_ascii() local 300 remainder = 0; in acpi_ex_convert_to_ascii() 309 &remainder); in acpi_ex_convert_to_ascii() 314 if (remainder != 0) { in acpi_ex_convert_to_ascii() 319 string[k] = (u8) (ACPI_ASCII_ZERO + remainder); in acpi_ex_convert_to_ascii()
|
/linux-6.12.1/lib/math/ |
D | test_div64.c | 57 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); \
|
D | div64.c | 68 s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) in div_s64_rem() argument 73 quotient = div_u64_rem(-dividend, abs(divisor), (u32 *)remainder); in div_s64_rem() 74 *remainder = -*remainder; in div_s64_rem() 78 quotient = div_u64_rem(dividend, abs(divisor), (u32 *)remainder); in div_s64_rem() 99 u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) in div64_u64_rem() argument 107 *remainder = rem32; in div64_u64_rem() 115 *remainder = dividend - quot * divisor; in div64_u64_rem() 116 if (*remainder >= divisor) { in div64_u64_rem() 118 *remainder -= divisor; in div64_u64_rem() 180 u32 iter_div_u64_rem(u64 dividend, u32 divisor, u64 *remainder) in iter_div_u64_rem() argument [all …]
|
/linux-6.12.1/include/linux/ |
D | math64.h | 26 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.12.1/drivers/gpu/drm/amd/display/dc/dml/ |
D | dml_inline_defs.h | 129 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.12.1/drivers/gpu/drm/amd/display/dc/spl/ |
D | spl_os_types.h | 23 static inline uint64_t spl_div_u64_rem(uint64_t dividend, uint32_t divisor, uint32_t *remainder) in spl_div_u64_rem() argument 25 return div_u64_rem(dividend, divisor, remainder); in spl_div_u64_rem() 38 static inline uint64_t spl_div64_u64_rem(uint64_t dividend, uint64_t divisor, uint64_t *remainder) in spl_div64_u64_rem() argument 40 return div64_u64_rem(dividend, divisor, remainder); in spl_div64_u64_rem()
|
D | spl_fixpt31_32.c | 28 unsigned long long *remainder) in complete_integer_division_u64() argument 34 result = spl_div64_u64_rem(dividend, divisor, remainder); in complete_integer_division_u64() 59 unsigned long long remainder; in spl_fixpt_from_fraction() local 64 arg1_value, arg2_value, &remainder); in spl_fixpt_from_fraction() 73 remainder <<= 1; in spl_fixpt_from_fraction() 77 if (remainder >= arg2_value) { in spl_fixpt_from_fraction() 79 remainder -= arg2_value; in spl_fixpt_from_fraction() 86 unsigned long long summand = (remainder << 1) >= arg2_value; in spl_fixpt_from_fraction()
|
/linux-6.12.1/drivers/gpu/drm/amd/display/dc/basics/ |
D | bw_fixed.c | 65 uint64_t remainder; in bw_frc_to_fixed() local 74 res_value = div64_u64_rem(arg1_value, arg2_value, &remainder); in bw_frc_to_fixed() 83 remainder <<= 1; in bw_frc_to_fixed() 87 if (remainder >= arg2_value) { in bw_frc_to_fixed() 89 remainder -= arg2_value; in bw_frc_to_fixed() 96 uint64_t summand = (remainder << 1) >= arg2_value; in bw_frc_to_fixed()
|
D | fixpt31_32.c | 50 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()
|
D | conversion.c | 140 uint32_t remainder; in find_gcd() local 143 remainder = a % b; in find_gcd() 145 b = remainder; in find_gcd()
|
/linux-6.12.1/net/sunrpc/ |
D | socklib.c | 269 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.12.1/drivers/net/wireless/realtek/rtw89/ |
D | util.h | 43 static inline s32 s32_div_u32_round_down(s32 dividend, u32 divisor, s32 *remainder) in s32_div_u32_round_down() argument 57 if (remainder) in s32_div_u32_round_down() 58 *remainder = i_remainder; in s32_div_u32_round_down()
|
/linux-6.12.1/drivers/pci/ |
D | doe.c | 149 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.12.1/drivers/pwm/ |
D | pwm-gpio.c | 44 u32 remainder; in pwm_gpio_round() local 50 remainder = do_div(dividend, hrtimer_resolution); in pwm_gpio_round() 51 dest->period -= remainder; in pwm_gpio_round() 54 remainder = do_div(dividend, hrtimer_resolution); in pwm_gpio_round() 55 dest->duty_cycle -= remainder; in pwm_gpio_round()
|
/linux-6.12.1/kernel/time/ |
D | timeconv.c | 53 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.12.1/drivers/mmc/core/ |
D | sdio_io.c | 318 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.12.1/drivers/clk/at91/ |
D | clk-pll.c | 175 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.12.1/lib/ |
D | string_helpers.c | 59 u32 remainder = 0, sf_cap; in string_get_size() local 97 remainder = do_div(size, divisor[units_base]); in string_get_size() 111 remainder *= 1000; in string_get_size() 112 remainder >>= 10; in string_get_size() 117 remainder += rounding[j]; in string_get_size() 118 if (remainder >= 1000) { in string_get_size() 119 remainder -= 1000; in string_get_size() 124 snprintf(tmp, sizeof(tmp), ".%03u", remainder); in string_get_size()
|
/linux-6.12.1/drivers/spi/ |
D | spi-slave-mt27xx.c | 167 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(®_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 ®_val, remainder); in mtk_spi_slave_interrupt()
|
/linux-6.12.1/drivers/gpu/drm/sun4i/ |
D | sun8i_vi_layer.c | 81 int mask, remainder; in sun8i_vi_layer_update_coord() local 84 remainder = (state->src.x1 >> 16) & mask; in sun8i_vi_layer_update_coord() 85 src_w = (src_w + remainder) & ~mask; in sun8i_vi_layer_update_coord() 86 hphase += remainder << 16; in sun8i_vi_layer_update_coord() 90 int mask, remainder; in sun8i_vi_layer_update_coord() local 93 remainder = (state->src.y1 >> 16) & mask; in sun8i_vi_layer_update_coord() 94 src_h = (src_h + remainder) & ~mask; in sun8i_vi_layer_update_coord() 95 vphase += remainder << 16; in sun8i_vi_layer_update_coord()
|
/linux-6.12.1/drivers/video/fbdev/ |
D | asiliantfb.c | 118 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.12.1/arch/x86/boot/ |
D | string.c | 201 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.12.1/drivers/dma/qcom/ |
D | qcom_adm.c | 236 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 …]
|