* [RESEND PATCH v2 0/2] iio: frequency: ad9832: cleanups
@ 2026-04-11 8:58 Joshua Crofts
2026-04-11 8:58 ` [RESEND PATCH v2 1/2] iio: frequency: ad9832: remove kernel.h proxy header Joshua Crofts
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Joshua Crofts @ 2026-04-11 8:58 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.
Resent because of typo in linux-staging list
email.
v2:
- PATCH 1: removed redundant bits.h include as it
is implied in bitops.h
- PATCH 2: changed ull to u64 type
Joshua Crofts (2):
iio: frequency: ad9832: remove kernel.h proxy header.
iio: frequency: ad9832: simplify bitwise math
drivers/staging/iio/frequency/ad9832.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 11+ messages in thread* [RESEND PATCH v2 1/2] iio: frequency: ad9832: remove kernel.h proxy header. 2026-04-11 8:58 [RESEND PATCH v2 0/2] iio: frequency: ad9832: cleanups Joshua Crofts @ 2026-04-11 8:58 ` Joshua Crofts 2026-04-11 8:58 ` [RESEND PATCH v2 2/2] iio: frequency: ad9832: simplify bitwise math Joshua Crofts 2026-04-14 7:26 ` [RESEND PATCH v2 0/2] iio: frequency: ad9832: cleanups Andy Shevchenko 2 siblings, 0 replies; 11+ messages in thread From: Joshua Crofts @ 2026-04-11 8:58 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. Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> --- v2: - removed redundant bits.h header drivers/staging/iio/frequency/ad9832.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/iio/frequency/ad9832.c b/drivers/staging/iio/frequency/ad9832.c index b87ea1781b..8873a6d11e 100644 --- a/drivers/staging/iio/frequency/ad9832.c +++ b/drivers/staging/iio/frequency/ad9832.c @@ -8,11 +8,10 @@ #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> -- 2.34.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [RESEND PATCH v2 2/2] iio: frequency: ad9832: simplify bitwise math 2026-04-11 8:58 [RESEND PATCH v2 0/2] iio: frequency: ad9832: cleanups Joshua Crofts 2026-04-11 8:58 ` [RESEND PATCH v2 1/2] iio: frequency: ad9832: remove kernel.h proxy header Joshua Crofts @ 2026-04-11 8:58 ` Joshua Crofts 2026-04-11 10:38 ` Dan Carpenter 2026-04-14 7:26 ` [RESEND PATCH v2 0/2] iio: frequency: ad9832: cleanups Andy Shevchenko 2 siblings, 1 reply; 11+ messages in thread From: Joshua Crofts @ 2026-04-11 8:58 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> --- v2: - changed ull to u64 type 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 8873a6d11e..4221e51dc4 100644 --- a/drivers/staging/iio/frequency/ad9832.c +++ b/drivers/staging/iio/frequency/ad9832.c @@ -112,8 +112,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)i; + do_div(freqreg, mclk); return freqreg; } -- 2.34.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [RESEND PATCH v2 2/2] iio: frequency: ad9832: simplify bitwise math 2026-04-11 8:58 ` [RESEND PATCH v2 2/2] iio: frequency: ad9832: simplify bitwise math Joshua Crofts @ 2026-04-11 10:38 ` Dan Carpenter 2026-04-11 10:47 ` Joshua Crofts 0 siblings, 1 reply; 11+ messages in thread From: Dan Carpenter @ 2026-04-11 10:38 UTC (permalink / raw) To: Joshua Crofts Cc: lars, Michael.Hennerich, jic23, gregkh, dlechner, nuno.sa, andy, linux-iio, linux-staging, linux-kernel On Sat, Apr 11, 2026 at 10:58:48AM +0200, Joshua Crofts wrote: > 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> > --- > v2: > - changed ull to u64 type > > 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 8873a6d11e..4221e51dc4 100644 > --- a/drivers/staging/iio/frequency/ad9832.c > +++ b/drivers/staging/iio/frequency/ad9832.c > @@ -112,8 +112,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)i; ^ This extra i char is something I really dread as a vim user. :P regards, dan carpenter ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RESEND PATCH v2 2/2] iio: frequency: ad9832: simplify bitwise math 2026-04-11 10:38 ` Dan Carpenter @ 2026-04-11 10:47 ` Joshua Crofts 2026-04-11 10:52 ` Dan Carpenter ` (2 more replies) 0 siblings, 3 replies; 11+ messages in thread From: Joshua Crofts @ 2026-04-11 10:47 UTC (permalink / raw) To: Dan Carpenter Cc: lars, Michael.Hennerich, jic23, gregkh, dlechner, nuno.sa, andy, linux-iio, linux-staging, linux-kernel On Sat, 11 Apr 2026 at 12:38, Dan Carpenter <error27@gmail.com> wrote: > > 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)i; > ^ > This extra i char is something I really dread as a vim user. :P Damn, that's embarrassing... Should I wait 24 hours before submitting a fix even if it's this trivial? Thanks. -- Kind regards CJD ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RESEND PATCH v2 2/2] iio: frequency: ad9832: simplify bitwise math 2026-04-11 10:47 ` Joshua Crofts @ 2026-04-11 10:52 ` Dan Carpenter 2026-04-11 18:38 ` David Lechner 2026-04-14 7:27 ` Andy Shevchenko 2 siblings, 0 replies; 11+ messages in thread From: Dan Carpenter @ 2026-04-11 10:52 UTC (permalink / raw) To: Joshua Crofts Cc: lars, Michael.Hennerich, jic23, gregkh, dlechner, nuno.sa, andy, linux-iio, linux-staging, linux-kernel On Sat, Apr 11, 2026 at 12:47:42PM +0200, Joshua Crofts wrote: > On Sat, 11 Apr 2026 at 12:38, Dan Carpenter <error27@gmail.com> wrote: > > > 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)i; > > ^ > > This extra i char is something I really dread as a vim user. :P > > Damn, that's embarrassing... Should I wait 24 hours before submitting a fix > even if it's this trivial? Thanks. We're not the boss of you. Do whatever you want to. :P regards, dan carpenter ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RESEND PATCH v2 2/2] iio: frequency: ad9832: simplify bitwise math 2026-04-11 10:47 ` Joshua Crofts 2026-04-11 10:52 ` Dan Carpenter @ 2026-04-11 18:38 ` David Lechner 2026-04-14 7:27 ` Andy Shevchenko 2 siblings, 0 replies; 11+ messages in thread From: David Lechner @ 2026-04-11 18:38 UTC (permalink / raw) To: Joshua Crofts, Dan Carpenter Cc: lars, Michael.Hennerich, jic23, gregkh, nuno.sa, andy, linux-iio, linux-staging, linux-kernel On 4/11/26 5:47 AM, Joshua Crofts wrote: > On Sat, 11 Apr 2026 at 12:38, Dan Carpenter <error27@gmail.com> wrote: >>> 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)i; >> ^ >> This extra i char is something I really dread as a vim user. :P > > Damn, that's embarrassing... Should I wait 24 hours before submitting a fix > even if it's this trivial? Thanks. > The risk of not waiting though is now you have a review tag on v2 and you've already sent a v3 without it. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RESEND PATCH v2 2/2] iio: frequency: ad9832: simplify bitwise math 2026-04-11 10:47 ` Joshua Crofts 2026-04-11 10:52 ` Dan Carpenter 2026-04-11 18:38 ` David Lechner @ 2026-04-14 7:27 ` Andy Shevchenko 2026-04-14 7:39 ` Joshua Crofts 2 siblings, 1 reply; 11+ messages in thread From: Andy Shevchenko @ 2026-04-14 7:27 UTC (permalink / raw) To: Joshua Crofts Cc: Dan Carpenter, lars, Michael.Hennerich, jic23, gregkh, dlechner, nuno.sa, andy, linux-iio, linux-staging, linux-kernel On Sat, Apr 11, 2026 at 12:47:42PM +0200, Joshua Crofts wrote: > On Sat, 11 Apr 2026 at 12:38, Dan Carpenter <error27@gmail.com> wrote: ... > > > + u64 freqreg = (u64)fout * BIT_ULL(AD9832_FREQ_BITS)i; > > ^ > > This extra i char is something I really dread as a vim user. :P > > Damn, that's embarrassing... Should I wait 24 hours before submitting a fix > even if it's this trivial? Thanks. Yes, please slow down as you also missed a tag. -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RESEND PATCH v2 2/2] iio: frequency: ad9832: simplify bitwise math 2026-04-14 7:27 ` Andy Shevchenko @ 2026-04-14 7:39 ` Joshua Crofts 2026-04-14 7:48 ` Andy Shevchenko 0 siblings, 1 reply; 11+ messages in thread From: Joshua Crofts @ 2026-04-14 7:39 UTC (permalink / raw) To: Andy Shevchenko Cc: Dan Carpenter, lars, Michael.Hennerich, jic23, gregkh, dlechner, nuno.sa, andy, linux-iio, linux-staging, linux-kernel On Tue, 14 Apr 2026 at 09:27, Andy Shevchenko <andriy.shevchenko@intel.com> wrote: > Yes, please slow down as you also missed a tag. Yes, I've realized that it was stupid not to wait. What is the proper etiquette here if the v3 patch doesn't have the reviewed-by tag? Should I do a RESEND PATCH or a v4? I've attached the tag in a reply to the v3 cover letter but not sure if that will do something. Thanks for your response. -- Kind regards CJD ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RESEND PATCH v2 2/2] iio: frequency: ad9832: simplify bitwise math 2026-04-14 7:39 ` Joshua Crofts @ 2026-04-14 7:48 ` Andy Shevchenko 0 siblings, 0 replies; 11+ messages in thread From: Andy Shevchenko @ 2026-04-14 7:48 UTC (permalink / raw) To: Joshua Crofts Cc: Dan Carpenter, lars, Michael.Hennerich, jic23, gregkh, dlechner, nuno.sa, andy, linux-iio, linux-staging, linux-kernel On Tue, Apr 14, 2026 at 09:39:04AM +0200, Joshua Crofts wrote: > On Tue, 14 Apr 2026 at 09:27, Andy Shevchenko > <andriy.shevchenko@intel.com> wrote: > > Yes, please slow down as you also missed a tag. > > Yes, I've realized that it was stupid not to wait. What is the proper > etiquette here if the > v3 patch doesn't have the reviewed-by tag? Should I do a RESEND PATCH or a v4? > I've attached the tag in a reply to the v3 cover letter but not sure > if that will do something. In this case it was fine what you have done with attaching the missed tag, but be careful in the future. -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RESEND PATCH v2 0/2] iio: frequency: ad9832: cleanups 2026-04-11 8:58 [RESEND PATCH v2 0/2] iio: frequency: ad9832: cleanups Joshua Crofts 2026-04-11 8:58 ` [RESEND PATCH v2 1/2] iio: frequency: ad9832: remove kernel.h proxy header Joshua Crofts 2026-04-11 8:58 ` [RESEND PATCH v2 2/2] iio: frequency: ad9832: simplify bitwise math Joshua Crofts @ 2026-04-14 7:26 ` Andy Shevchenko 2 siblings, 0 replies; 11+ messages in thread From: Andy Shevchenko @ 2026-04-14 7:26 UTC (permalink / raw) To: Joshua Crofts Cc: lars, Michael.Hennerich, jic23, gregkh, dlechner, nuno.sa, andy, linux-iio, linux-staging, linux-kernel On Sat, Apr 11, 2026 at 10:58:46AM +0200, Joshua Crofts wrote: > This series cleans up issues in the AD9832 driver, > including proxy header removal and bit math > simplification. > > Resent because of typo in linux-staging list > email. Seems Nuno already gave a tag that's missing here... -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-04-14 7:49 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-04-11 8:58 [RESEND PATCH v2 0/2] iio: frequency: ad9832: cleanups Joshua Crofts 2026-04-11 8:58 ` [RESEND PATCH v2 1/2] iio: frequency: ad9832: remove kernel.h proxy header Joshua Crofts 2026-04-11 8:58 ` [RESEND PATCH v2 2/2] iio: frequency: ad9832: simplify bitwise math Joshua Crofts 2026-04-11 10:38 ` Dan Carpenter 2026-04-11 10:47 ` Joshua Crofts 2026-04-11 10:52 ` Dan Carpenter 2026-04-11 18:38 ` David Lechner 2026-04-14 7:27 ` Andy Shevchenko 2026-04-14 7:39 ` Joshua Crofts 2026-04-14 7:48 ` Andy Shevchenko 2026-04-14 7:26 ` [RESEND PATCH v2 0/2] iio: frequency: ad9832: cleanups Andy Shevchenko
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox