public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH v4 0/2] iio: frequency: ad9832: cleanups
@ 2026-04-15  8:08 Joshua Crofts
  2026-04-15  8:08 ` [PATCH v4 1/2] iio: frequency: ad9832: remove kernel.h proxy header Joshua Crofts
  2026-04-15  8:08 ` [PATCH v4 2/2] iio: frequency: ad9832: simplify bitwise math Joshua Crofts
  0 siblings, 2 replies; 12+ messages in thread
From: Joshua Crofts @ 2026-04-15  8:08 UTC (permalink / raw)
  To: lars, Michael.Hennerich, jic23, gregkh
  Cc: dlechner, nuno.sa, andy, linux-iio, linux-staging, linux-kernel,
	Joshua Crofts

This series cleans up issues in the AD9832 driver,
including proxy header removal and bit math
simplification.

v2:
 - PATCH 1: removed redundant bits.h include as it
   is implied in bitops.h
 - PATCH 2: changed ull to u64 type
v3:
 - PATCH 2: remove rogue vim typo
v4:
 - PATCH 1: removed slab.h based on IWYU
   recommendation, header reordering

Joshua Crofts (2):
  iio: frequency: ad9832: remove kernel.h proxy header.
  iio: frequency: ad9832: simplify bitwise math

 drivers/staging/iio/frequency/ad9832.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

-- 
2.47.3


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

* [PATCH v4 1/2] iio: frequency: ad9832: remove kernel.h proxy header.
  2026-04-15  8:08 [PATCH v4 0/2] iio: frequency: ad9832: cleanups Joshua Crofts
@ 2026-04-15  8:08 ` Joshua Crofts
  2026-04-15  8:56   ` Andy Shevchenko
  2026-04-15  8:08 ` [PATCH v4 2/2] iio: frequency: ad9832: simplify bitwise math Joshua Crofts
  1 sibling, 1 reply; 12+ messages in thread
From: Joshua Crofts @ 2026-04-15  8:08 UTC (permalink / raw)
  To: lars, Michael.Hennerich, jic23, gregkh
  Cc: dlechner, nuno.sa, andy, linux-iio, linux-staging, linux-kernel,
	Joshua Crofts

Remove kernel.h proxy header and add bitops.h for
better dependency control and code clarity. Also
removed slab.h and moved asm header below generic
linux headers.

Checked with IWYU.

Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
---
 drivers/staging/iio/frequency/ad9832.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/iio/frequency/ad9832.c b/drivers/staging/iio/frequency/ad9832.c
index b87ea1781b..fbcfdbd398 100644
--- a/drivers/staging/iio/frequency/ad9832.c
+++ b/drivers/staging/iio/frequency/ad9832.c
@@ -5,21 +5,19 @@
  * Copyright 2011 Analog Devices Inc.
  */
 
-#include <asm/div64.h>
-
 #include <linux/bitfield.h>
-#include <linux/bits.h>
+#include <linux/bitops.h>
 #include <linux/clk.h>
 #include <linux/device.h>
 #include <linux/err.h>
-#include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/regulator/consumer.h>
-#include <linux/slab.h>
 #include <linux/spi/spi.h>
 #include <linux/sysfs.h>
 #include <linux/unaligned.h>
 
+#include <asm/div64.h>
+
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
 
-- 
2.47.3


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

* [PATCH v4 2/2] iio: frequency: ad9832: simplify bitwise math
  2026-04-15  8:08 [PATCH v4 0/2] iio: frequency: ad9832: cleanups Joshua Crofts
  2026-04-15  8:08 ` [PATCH v4 1/2] iio: frequency: ad9832: remove kernel.h proxy header Joshua Crofts
@ 2026-04-15  8:08 ` Joshua Crofts
  2026-04-15  8:58   ` Andy Shevchenko
  1 sibling, 1 reply; 12+ messages in thread
From: Joshua Crofts @ 2026-04-15  8:08 UTC (permalink / raw)
  To: lars, Michael.Hennerich, jic23, gregkh
  Cc: dlechner, nuno.sa, andy, linux-iio, linux-staging, linux-kernel,
	Joshua Crofts

Refactor the ad9832_calc_freqreg by adding a BIT_ULL()
macro instead of manual bit shifting for better
readability.

Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
---
 drivers/staging/iio/frequency/ad9832.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/frequency/ad9832.c b/drivers/staging/iio/frequency/ad9832.c
index fbcfdbd398..cd7c7727f7 100644
--- a/drivers/staging/iio/frequency/ad9832.c
+++ b/drivers/staging/iio/frequency/ad9832.c
@@ -111,8 +111,8 @@ struct ad9832_state {
 
 static unsigned long ad9832_calc_freqreg(unsigned long mclk, unsigned long fout)
 {
-	unsigned long long freqreg = (u64)fout *
-				     (u64)((u64)1L << AD9832_FREQ_BITS);
+	u64 freqreg = (u64)fout * BIT_ULL(AD9832_FREQ_BITS);
+
 	do_div(freqreg, mclk);
 	return freqreg;
 }
-- 
2.47.3


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

* Re: [PATCH v4 1/2] iio: frequency: ad9832: remove kernel.h proxy header.
  2026-04-15  8:08 ` [PATCH v4 1/2] iio: frequency: ad9832: remove kernel.h proxy header Joshua Crofts
@ 2026-04-15  8:56   ` Andy Shevchenko
  2026-04-15  9:07     ` Joshua Crofts
  2026-04-15  9:53     ` Joshua Crofts
  0 siblings, 2 replies; 12+ messages in thread
From: Andy Shevchenko @ 2026-04-15  8:56 UTC (permalink / raw)
  To: Joshua Crofts
  Cc: lars, Michael.Hennerich, jic23, gregkh, dlechner, nuno.sa, andy,
	linux-iio, linux-staging, linux-kernel

On Wed, Apr 15, 2026 at 08:08:11AM +0000, Joshua Crofts wrote:

Drop the period at the end of Subject.

> Remove kernel.h proxy header and add bitops.h for
> better dependency control and code clarity. Also
> removed slab.h and moved asm header below generic
> linux headers.

I wonder if we need to elaborate a bit on 'linux' word as usually we refer to
the project as Linux. Maybe write it as '<linux/*>' (without quotes)?

> Checked with IWYU.

We have a (recently new) tag: Assisted-by or so. Can we use it here?

Otherwise LGTM, so after addressing the above:
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v4 2/2] iio: frequency: ad9832: simplify bitwise math
  2026-04-15  8:08 ` [PATCH v4 2/2] iio: frequency: ad9832: simplify bitwise math Joshua Crofts
@ 2026-04-15  8:58   ` Andy Shevchenko
  0 siblings, 0 replies; 12+ messages in thread
From: Andy Shevchenko @ 2026-04-15  8:58 UTC (permalink / raw)
  To: Joshua Crofts
  Cc: lars, Michael.Hennerich, jic23, gregkh, dlechner, nuno.sa, andy,
	linux-iio, linux-staging, linux-kernel

On Wed, Apr 15, 2026 at 08:08:12AM +0000, Joshua Crofts wrote:
> Refactor the ad9832_calc_freqreg by adding a BIT_ULL()
> macro instead of manual bit shifting for better
> readability.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v4 1/2] iio: frequency: ad9832: remove kernel.h proxy header.
  2026-04-15  8:56   ` Andy Shevchenko
@ 2026-04-15  9:07     ` Joshua Crofts
  2026-04-15  9:53     ` Joshua Crofts
  1 sibling, 0 replies; 12+ messages in thread
From: Joshua Crofts @ 2026-04-15  9:07 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: lars, Michael.Hennerich, jic23, gregkh, dlechner, nuno.sa, andy,
	linux-iio, linux-staging, linux-kernel

On Wed, 15 Apr 2026 at 10:56, Andy Shevchenko
<andriy.shevchenko@intel.com> wrote:
> > Remove kernel.h proxy header and add bitops.h for
> > better dependency control and code clarity. Also
> > removed slab.h and moved asm header below generic
> > linux headers.
>
> I wonder if we need to elaborate a bit on 'linux' word as usually we refer to
> the project as Linux. Maybe write it as '<linux/*>' (without quotes)?
>
> > Checked with IWYU.
>
> We have a (recently new) tag: Assisted-by or so. Can we use it here?

Thanks for the reviews and patience with my patches. I seem to have finally
learned the workflow. I'll send a v5 addressing the issues above tomorrow.

-- 
Kind regards

CJD

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

* Re: [PATCH v4 1/2] iio: frequency: ad9832: remove kernel.h proxy header.
  2026-04-15  8:56   ` Andy Shevchenko
  2026-04-15  9:07     ` Joshua Crofts
@ 2026-04-15  9:53     ` Joshua Crofts
  2026-04-15 10:07       ` Andy Shevchenko
  1 sibling, 1 reply; 12+ messages in thread
From: Joshua Crofts @ 2026-04-15  9:53 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: lars, Michael.Hennerich, jic23, gregkh, dlechner, nuno.sa, andy,
	linux-iio, linux-staging, linux-kernel

On Wed, 15 Apr 2026 at 10:56, Andy Shevchenko
<andriy.shevchenko@intel.com> wrote:
> > Checked with IWYU.
>
> We have a (recently new) tag: Assisted-by or so. Can we use it here?

BTW, I thought that the Assisted-by tag only applied to AI coding assistants,
per the documentation.

-- 
Kind regards

CJD

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

* Re: [PATCH v4 1/2] iio: frequency: ad9832: remove kernel.h proxy header.
  2026-04-15  9:53     ` Joshua Crofts
@ 2026-04-15 10:07       ` Andy Shevchenko
  2026-04-15 10:08         ` Andy Shevchenko
  0 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2026-04-15 10:07 UTC (permalink / raw)
  To: Joshua Crofts
  Cc: lars, Michael.Hennerich, jic23, gregkh, dlechner, nuno.sa, andy,
	linux-iio, linux-staging, linux-kernel

On Wed, Apr 15, 2026 at 11:53:44AM +0200, Joshua Crofts wrote:
> On Wed, 15 Apr 2026 at 10:56, Andy Shevchenko
> <andriy.shevchenko@intel.com> wrote:
> > > Checked with IWYU.
> >
> > We have a (recently new) tag: Assisted-by or so. Can we use it here?

> BTW, I thought that the Assisted-by tag only applied to AI coding assistants,
> per the documentation.

Mainly for that, but it's not limited to. Coccinelle is not an AI tool, yet
you may found it in the tag. Ex.: 8aa9fd0350b8 ("parisc: update outdated
comments for renamed ccio_alloc_consistent()").

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v4 1/2] iio: frequency: ad9832: remove kernel.h proxy header.
  2026-04-15 10:07       ` Andy Shevchenko
@ 2026-04-15 10:08         ` Andy Shevchenko
  2026-04-15 10:17           ` Joshua Crofts
  0 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2026-04-15 10:08 UTC (permalink / raw)
  To: Joshua Crofts
  Cc: lars, Michael.Hennerich, jic23, gregkh, dlechner, nuno.sa, andy,
	linux-iio, linux-staging, linux-kernel

On Wed, Apr 15, 2026 at 01:07:16PM +0300, Andy Shevchenko wrote:
> On Wed, Apr 15, 2026 at 11:53:44AM +0200, Joshua Crofts wrote:
> > On Wed, 15 Apr 2026 at 10:56, Andy Shevchenko
> > <andriy.shevchenko@intel.com> wrote:
> > > > Checked with IWYU.
> > >
> > > We have a (recently new) tag: Assisted-by or so. Can we use it here?
> 
> > BTW, I thought that the Assisted-by tag only applied to AI coding assistants,
> > per the documentation.
> 
> Mainly for that, but it's not limited to. Coccinelle is not an AI tool, yet
> you may found it in the tag. Ex.: 8aa9fd0350b8 ("parisc: update outdated
> comments for renamed ccio_alloc_consistent()").

Ah, all of them have the first one an AI... Perhaps you are right.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v4 1/2] iio: frequency: ad9832: remove kernel.h proxy header.
  2026-04-15 10:08         ` Andy Shevchenko
@ 2026-04-15 10:17           ` Joshua Crofts
  2026-04-15 10:21             ` Andy Shevchenko
  0 siblings, 1 reply; 12+ messages in thread
From: Joshua Crofts @ 2026-04-15 10:17 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: lars, Michael.Hennerich, jic23, gregkh, dlechner, nuno.sa, andy,
	linux-iio, linux-staging, linux-kernel

On Wed, 15 Apr 2026 at 12:08, Andy Shevchenko
<andriy.shevchenko@intel.com> wrote:
> Ah, all of them have the first one an AI... Perhaps you are right.

Therefore, should I send a v5 amending the period and <linux/*> header fix?

-- 
Kind regards

CJD

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

* Re: [PATCH v4 1/2] iio: frequency: ad9832: remove kernel.h proxy header.
  2026-04-15 10:17           ` Joshua Crofts
@ 2026-04-15 10:21             ` Andy Shevchenko
  2026-04-15 10:32               ` Joshua Crofts
  0 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2026-04-15 10:21 UTC (permalink / raw)
  To: Joshua Crofts
  Cc: lars, Michael.Hennerich, jic23, gregkh, dlechner, nuno.sa, andy,
	linux-iio, linux-staging, linux-kernel

On Wed, Apr 15, 2026 at 12:17:13PM +0200, Joshua Crofts wrote:
> On Wed, 15 Apr 2026 at 12:08, Andy Shevchenko
> <andriy.shevchenko@intel.com> wrote:
> > Ah, all of them have the first one an AI... Perhaps you are right.
> 
> Therefore, should I send a v5 amending the period and <linux/*> header fix?

Yes, please. And don't forget to carry on the given tag.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v4 1/2] iio: frequency: ad9832: remove kernel.h proxy header.
  2026-04-15 10:21             ` Andy Shevchenko
@ 2026-04-15 10:32               ` Joshua Crofts
  0 siblings, 0 replies; 12+ messages in thread
From: Joshua Crofts @ 2026-04-15 10:32 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: lars, Michael.Hennerich, jic23, gregkh, dlechner, nuno.sa, andy,
	linux-iio, linux-staging, linux-kernel

On Wed, 15 Apr 2026 at 12:21, Andy Shevchenko
<andriy.shevchenko@intel.com> wrote:
> Yes, please. And don't forget to carry on the given tag.

Okay, will do tomorrow.

-- 
Kind regards

CJD

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

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

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-15  8:08 [PATCH v4 0/2] iio: frequency: ad9832: cleanups Joshua Crofts
2026-04-15  8:08 ` [PATCH v4 1/2] iio: frequency: ad9832: remove kernel.h proxy header Joshua Crofts
2026-04-15  8:56   ` Andy Shevchenko
2026-04-15  9:07     ` Joshua Crofts
2026-04-15  9:53     ` Joshua Crofts
2026-04-15 10:07       ` Andy Shevchenko
2026-04-15 10:08         ` Andy Shevchenko
2026-04-15 10:17           ` Joshua Crofts
2026-04-15 10:21             ` Andy Shevchenko
2026-04-15 10:32               ` Joshua Crofts
2026-04-15  8:08 ` [PATCH v4 2/2] iio: frequency: ad9832: simplify bitwise math Joshua Crofts
2026-04-15  8:58   ` Andy Shevchenko

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