diff options
| author | Archit Anant <architanant5@gmail.com> | 2026-02-18 15:53:27 +0300 |
|---|---|---|
| committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2026-02-23 23:44:19 +0300 |
| commit | 0e2af0fc30eca0ae92abcf1c8fc7be94a8cc95c3 (patch) | |
| tree | 66dc09beae631aae1a0c5c72532fdd8e90eda81f /include/linux | |
| parent | 08eea726f4a30dc7e3ee4bf76a1497c54948ff51 (diff) | |
| download | linux-0e2af0fc30eca0ae92abcf1c8fc7be94a8cc95c3.tar.xz | |
staging: iio: impedance-analyzer: ad5933: use div64_ul() instead of do_div()
Replace do_div() with div64_ul() since the remainder is not used.
div64_ul() is the preferred API for 64-bit by 32-bit division when
only the quotient is needed.
Also replace explicit casting and shifting with the BIT_ULL(27) macro
for clarity.
Note: A mathematical simplification to `(freq * BIT_ULL(29)) / mclk` was
suggested during review to improve precision. However, as confirmed by
maintainers, the original driver's truncation via `(mclk / 4)` might
be intentional or relied upon by userspace. Since hardware is not
available for verification, this patch preserves the original logic
to avoid regression risk in the absence of testing.
Issue identified by coccicheck using do_div.cocci.
Signed-off-by: Archit Anant <architanant5@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
