From: Johan Hovold <johan@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-staging@lists.linux.dev
Subject: Re: [PATCH] staging: greybus: gbphy: fix up const issue with the match callback
Date: Thu, 22 May 2025 14:55:58 +0200 [thread overview]
Message-ID: <aC8e3ldqe6j2vxv7@hovoldconsulting.com> (raw)
In-Reply-To: <2025052155-peddling-happier-f825@gregkh>
On Wed, May 21, 2025 at 04:55:55PM +0200, Greg Kroah-Hartman wrote:
> gbphy_dev_match_id() should be taking a const pointer, as the pointer
> passed to it from the container_of() call was const to start with (it
> was accidentally cast away with the call.) Fix this all up by correctly
> marking the pointer types.
This one too should have a:
Fixes: d69d80484598 ("driver core: have match() callback in struct bus_type take a const *")
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> drivers/staging/greybus/gbphy.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/greybus/gbphy.c b/drivers/staging/greybus/gbphy.c
> index 6adcad286633..ab8a1af36808 100644
> --- a/drivers/staging/greybus/gbphy.c
> +++ b/drivers/staging/greybus/gbphy.c
> @@ -102,8 +102,8 @@ static int gbphy_dev_uevent(const struct device *dev, struct kobj_uevent_env *en
> }
>
> static const struct gbphy_device_id *
> -gbphy_dev_match_id(struct gbphy_device *gbphy_dev,
> - struct gbphy_driver *gbphy_drv)
> +gbphy_dev_match_id(const struct gbphy_device *gbphy_dev,
> + const struct gbphy_driver *gbphy_drv)
> {
> const struct gbphy_device_id *id = gbphy_drv->id_table;
>
> @@ -119,8 +119,8 @@ gbphy_dev_match_id(struct gbphy_device *gbphy_dev,
>
> static int gbphy_dev_match(struct device *dev, const struct device_driver *drv)
> {
> - struct gbphy_driver *gbphy_drv = to_gbphy_driver(drv);
> - struct gbphy_device *gbphy_dev = to_gbphy_dev(dev);
> + const struct gbphy_driver *gbphy_drv = to_gbphy_driver(drv);
> + const struct gbphy_device *gbphy_dev = to_gbphy_dev(dev);
Making the dev pointers const is arguably a separate change, but I guess
it's related enough:
Reviewed-by: Johan Hovold <johan@kernel.org>
Johan
next prev parent reply other threads:[~2025-05-22 12:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-21 14:55 [PATCH] staging: greybus: gbphy: fix up const issue with the match callback Greg Kroah-Hartman
2025-05-22 12:55 ` Johan Hovold [this message]
2025-05-22 13:10 ` Greg Kroah-Hartman
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=aC8e3ldqe6j2vxv7@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-staging@lists.linux.dev \
/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