From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Ricardo B. Marliere" <ricardo@marliere.net>
Cc: Alex Elder <elder@ieee.org>, Johan Hovold <johan@kernel.org>,
Alex Elder <elder@kernel.org>,
greybus-dev@lists.linaro.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] greybus: constify the struct device_type usage
Date: Sun, 25 Feb 2024 09:33:22 +0100 [thread overview]
Message-ID: <2024022553-deepness-sublevel-73de@gregkh> (raw)
In-Reply-To: <ids3525jm5zkwkgizt2xtg3do37kqqtfdy5gc2cptdduexoe7r@cr4yxh3tykkh>
On Sat, Feb 24, 2024 at 05:22:39PM -0300, Ricardo B. Marliere wrote:
> On 24 Feb 09:43, Alex Elder wrote:
> > On 2/19/24 6:40 AM, Ricardo B. Marliere wrote:
> > > Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
> > > core can properly handle constant struct device_type. Move the
> > > greybus_hd_type, greybus_module_type, greybus_interface_type,
> > > greybus_control_type, greybus_bundle_type and greybus_svc_type variables to
> > > be constant structures as well, placing it into read-only memory which can
> > > not be modified at runtime.
> > >
> > > Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
> >
> > This looks good to me. Assuming it compiles cleanly:
> >
> > Reviewed-by: Alex Elder <elder@linaro.org>
>
> Hi Alex!
>
> Thanks for reviewing.
>
> >
> > On another subject:
> >
> > Johan might disagree, but I think it would be nice to make
> > the definitions of the Greybus device types as static (private)
> > and make the is_gb_host_device() etc. functions real functions
> > rather than static inlines in <linux/greybus.h>.
> >
> > It turns out that all of the is_gb_*() functions are called only
> > from drivers/greybus/core.c; they could all be moved there rather
> > than advertising them in <linux/greybus.h>.
>
> I guess it depends whether they would be used somewhere else in the
> future. Perhaps it was left there with that intention when it was first
> being developed? I agree, though. Will happily send a patch with this if
> desired.
Let's clean the code up for what we have today. If it's needed in the
future, we can move the structures then.
thanks,
greg k-h
next prev parent reply other threads:[~2024-02-25 8:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-19 12:40 Ricardo B. Marliere
2024-02-24 15:43 ` Alex Elder
2024-02-24 20:22 ` Ricardo B. Marliere
2024-02-25 8:33 ` Greg Kroah-Hartman [this message]
2024-02-25 11:04 ` Ricardo B. Marliere
2024-02-26 19:50 ` Alex Elder
2024-02-26 20:21 ` Ricardo B. Marliere
2024-02-26 21:00 ` Ricardo B. Marliere
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=2024022553-deepness-sublevel-73de@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=elder@ieee.org \
--cc=elder@kernel.org \
--cc=greybus-dev@lists.linaro.org \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ricardo@marliere.net \
/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®