From: Christian Marangi <ansuelsmth@gmail.com>
To: "Uwe Kleine-König" <ukleinek@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org,
Benjamin Larsson <benjamin.larsson@genexis.eu>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Lorenzo Bianconi <lorenzo@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: Re: [PATCH v21] pwm: airoha: Add support for EN7581 SoC
Date: Sat, 5 Jul 2025 10:54:14 +0200 [thread overview]
Message-ID: <6868e83a.050a0220.2d26f8.0920@mx.google.com> (raw)
In-Reply-To: <k3s7wp52oljegusctucabvo2wcmx7defklk7fdtqh32a2vvcux@7tuafqra4nrw>
On Sat, Jul 05, 2025 at 10:47:37AM +0200, Uwe Kleine-König wrote:
> Hello Christian,
>
> On Sat, Jul 05, 2025 at 09:28:20AM +0200, Christian Marangi wrote:
> > Changes v21:
> > - Revert offset to u64 in airoha_pwm_apply_bucket_config
> > (do_div require u64)
>
> I didn't look in detail, but I wonder if you considered using a
> different division function to keep offset not bigger than needed?
>
Hi Uwe,
I used do_div since it can calculate both division and remainder in one
go.
The kernel warning were present only on 32 bit and are caused because
do_div implementation is different on 32 or 64 bit.
On 64 bit it's simply
rem = n % base
div = n / base
but on 32 bit it's much more complex and adds the check n to be an u64.
Also on 64bit n is expected to be u64 but given the simplicity the type
is not checked.
I checked if there is some kind of do_div32 but it doesn't exist and
also using cast doesn't work give the complexity of the macro define (I
tried with (u64)offset.
What do you think should be the best solution here?
--
Ansuel
next prev parent reply other threads:[~2025-07-05 8:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-05 7:28 Christian Marangi
2025-07-05 8:47 ` Uwe Kleine-König
2025-07-05 8:54 ` Christian Marangi [this message]
2025-07-05 15:04 ` Uwe Kleine-König
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6868e83a.050a0220.2d26f8.0920@mx.google.com \
--to=ansuelsmth@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=benjamin.larsson@genexis.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=ukleinek@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®