linux/drivers/staging
Archit Anant 0e2af0fc30 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>
History 2026-02-23 20:44:19 +00:00
..
axis-fifo staging: axis-fifo: Fix indentation 2026-01-27 15:34:32 +01:00
fbtft treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
greybus Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
iio staging: iio: impedance-analyzer: ad5933: use div64_ul() instead of do_div() 2026-02-23 20:44:19 +00:00
media Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
most Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
nvec Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
octeon Staging driver changes for 6.18-rc1 2025-10-04 16:17:14 -07:00
rtl8723bs Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
sm750fb staging: sm750fb: Clean up variable names 2026-02-07 14:33:29 +01:00
vc04_services Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vme_user Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
Kconfig staging: gpib: Destage gpib 2025-11-24 17:52:11 +01:00
Makefile staging: gpib: Destage gpib 2025-11-24 17:52:11 +01:00