From: "Uwe Kleine-König" <ukleinek@kernel.org>
To: Priya Bala Govindasamy <pgovind2@uci.edu>
Cc: Michal Wilczynski <m.wilczynski@samsung.com>,
ojeda@kernel.org, boqun@kernel.org, gary@garyguo.net,
bjorn3_gh@protonmail.com, lossin@kernel.org,
a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu,
dakr@kernel.org, daniel.almeida@collabora.com,
tamird@kernel.org, acourbot@nvidia.com, work@onurozkan.dev,
elle@weathered-steel.dev, linux-pwm@vger.kernel.org,
rust-for-linux@vger.kernel.org, ardalan@uci.edu,
zhiyunq@cs.ucr.edu, dzueck@uci.edu
Subject: Re: [PATCH 1/1] rust: pwm: reject over-aligned driver data in `Chip::new()`
Date: Fri, 27 Nov 2026 10:31:04 +0100 [thread overview]
Message-ID: <awlNXMCAAlf5trfM@monoceros> (raw)
In-Reply-To: <awlMukHhET0ALF2j@monoceros>
[-- Attachment #1: Type: text/plain, Size: 1204 bytes --]
On Fri, Nov 27, 2026 at 10:28:09AM +0100, Uwe Kleine-König wrote:
> Hello,
>
> On Thu, Nov 26, 2026 at 09:38:59AM -0800, Priya Bala Govindasamy wrote:
> > On Wed, Nov 25, 2026 at 7:42 AM Michal Wilczynski
> > <m.wilczynski@samsung.com> wrote:
> > > The C layout uses PWMCHIP_ALIGN, which is private to core.c. If Uwe
> > > agrees it might be a good idea to move it to include/linux/pwm.h and
> > > assert against that, so the two can't drift apart.
> >
> > Thanks for your comments. As per Gary and Uwe's feedback, I will
> > shorten the commit message in the v2 patch. Just to confirm, for v2
> > should I only update the commit message, or also move PWMCHIP_ALIGN
> > into include/linux/pwm.h?
>
> There is precedent on a symbol that is only in include/linux/pwm.h for
> Rust. So if you group PWMCHIP_ALIGN to pwmchip_release() and extend the
> comment accordingly that would be ok for me.
But having said that, I wonder if PWMCHIP_ALIGN is really needed. Isn't
is possible to just check after pwmchip_alloc() if the alignment for T
is good enough? Hmm, maybe that doesn't work as it's a runtime check and
Rust might want to know during compile time?
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2026-11-27 9:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 20:25 [PATCH 0/1] rust: pwm: reject over-aligned driver data in `Chip::new()` Priya Bala Govindasamy
2026-11-13 20:25 ` [PATCH 1/1] " Priya Bala Govindasamy
2026-11-25 15:42 ` Michal Wilczynski
2026-11-26 17:38 ` Priya Bala Govindasamy
2026-11-27 9:28 ` Uwe Kleine-König
2026-11-27 9:31 ` Uwe Kleine-König [this message]
2026-11-25 16:19 ` Gary Guo
2026-11-25 17:32 ` Uwe Kleine-König
2026-11-25 17:45 ` Gary Guo
2026-11-25 23:15 ` 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=awlNXMCAAlf5trfM@monoceros \
--to=ukleinek@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=aliceryhl@google.com \
--cc=ardalan@uci.edu \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=dzueck@uci.edu \
--cc=elle@weathered-steel.dev \
--cc=gary@garyguo.net \
--cc=linux-pwm@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=m.wilczynski@samsung.com \
--cc=ojeda@kernel.org \
--cc=pgovind2@uci.edu \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=work@onurozkan.dev \
--cc=zhiyunq@cs.ucr.edu \
/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