From: Len Bao <len.bao@gmx.us>
To: Linus Walleij <linusw@kernel.org>
Cc: Len Bao <len.bao@gmx.us>, Bartosz Golaszewski <brgl@kernel.org>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org, Kees Cook <kees@kernel.org>
Subject: Re: [PATCH] gpiolib: Mark gpio_devt, gpiolib_initialized and gpio_stub_drv as __ro_after_init
Date: Sat, 30 May 2026 10:08:07 +0000 [thread overview]
Message-ID: <ahq3BxvtVcF0Zife@ubuntu> (raw)
In-Reply-To: <CAD++jL=5W56YAgJ8o7XXZRJQ_LJxW87SPc_C0VEYW0EccxpJ5Q@mail.gmail.com>
Hi Linus,
On Mon, May 25, 2026 at 10:10:02AM +0200, Linus Walleij wrote:
> Hi Len,
>
> thanks for your patch!
>
> On Sat, May 16, 2026 at 12:58 PM Len Bao <len.bao@gmx.us> wrote:
>
> > The 'gpio_devt' and 'gpiolib_initialized' variables are initialized only
> > during the init phase in the 'gpiolib_dev_init' function and never
> > changed. So, mark these as __ro_after_init.
> >
> > The 'gpio_stub_drv' variable is initialized only in the declaration and
> > never changed. So, this variable could be 'const', but using the
> > 'driver_register' and 'driver_unregister' functions discards the 'const'
> > qualifier. Therefore, as an alternative, mark it as a __ro_after_init.
> >
> > Signed-off-by: Len Bao <len.bao@gmx.us>
>
> Patches like this should be CC to linux-hardening.
Ok, next time I will CC to linux-hardening. Thanks for the guidance.
> Anyways it looks good to me!
> Reviewed-by: Linus Walleij <linusw@kernel.org>
Thanks for your time to look at this.
Regards,
Len Bao
> Yours,
> Linus Walleij
next prev parent reply other threads:[~2026-05-30 10:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-16 10:57 [PATCH] gpiolib: Mark gpio_devt, gpiolib_initialized and gpio_stub_drv as __ro_after_init Len Bao
2026-05-25 8:10 ` Linus Walleij
2026-05-30 10:08 ` Len Bao [this message]
2026-05-26 8:56 ` Bartosz Golaszewski
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=ahq3BxvtVcF0Zife@ubuntu \
--to=len.bao@gmx.us \
--cc=brgl@kernel.org \
--cc=kees@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.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