mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] iio: imu: bmi323: remove unnecessary cast in watermark limit
@ 2026-06-08 12:15 Hungyu Lin
  2026-06-08 20:20 ` Nuno Sá
  2026-06-09 13:28 ` Andy Shevchenko
  0 siblings, 2 replies; 4+ messages in thread
From: Hungyu Lin @ 2026-06-08 12:15 UTC (permalink / raw)
  To: jagathjog1996, jic23
  Cc: dlechner, nuno.sa, andy, linux-iio, linux-kernel, Hungyu Lin

Remove the explicit u32 cast in the watermark limit calculation.

The BMI323_FIFO_FULL_IN_FRAMES macro can be used directly with
min() without triggering type issues.

Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
---
Changes in v2:
- Drop the unnecessary cast instead of using min_t().
- Follow reviewer feedback from David Laight and Andy Shevchenko.

 drivers/iio/imu/bmi323/bmi323_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/imu/bmi323/bmi323_core.c b/drivers/iio/imu/bmi323/bmi323_core.c
index f3d499423399..72955a697a93 100644
--- a/drivers/iio/imu/bmi323/bmi323_core.c
+++ b/drivers/iio/imu/bmi323/bmi323_core.c
@@ -1128,7 +1128,7 @@ static int bmi323_set_watermark(struct iio_dev *indio_dev, unsigned int val)
 {
 	struct bmi323_data *data = iio_priv(indio_dev);
 
-	val = min(val, (u32)BMI323_FIFO_FULL_IN_FRAMES);
+	val = min(val, BMI323_FIFO_FULL_IN_FRAMES);
 
 	guard(mutex)(&data->mutex);
 	data->watermark = val;
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-06-10 15:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-08 12:15 [PATCH v2] iio: imu: bmi323: remove unnecessary cast in watermark limit Hungyu Lin
2026-06-08 20:20 ` Nuno Sá
2026-06-09 13:28 ` Andy Shevchenko
2026-06-10 15:36   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®