From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Johan Hovold <johan@kernel.org>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH] USB: serial: bus: fix const issue in usb_serial_device_match()
Date: Wed, 21 May 2025 17:11:58 +0200 [thread overview]
Message-ID: <2025052140-amnesty-wing-b0f0@gregkh> (raw)
In-Reply-To: <aC3so4VSWcqLy-Nx@hovoldconsulting.com>
On Wed, May 21, 2025 at 05:09:23PM +0200, Johan Hovold wrote:
> On Wed, May 21, 2025 at 03:41:34PM +0200, Greg Kroah-Hartman wrote:
> > usb_serial_device_match() takes a const pointer, and then decides to
> > cast it away into a non-const one, which is not a good thing to do
> > overall. Fix this up by properly setting the pointers to be const to
> > preserve that attribute.
>
> I think this deserves a Fixes tag as this is a recent issue introduced
> by commit d69d80484598 ("driver core: have match() callback in struct
> bus_type take a const *") (even if we only use the address of the
> pointer).
Oops, yes, that is needed, sorry about that.
> > Cc: Johan Hovold <johan@kernel.org>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> > @@ -17,7 +17,7 @@ static int usb_serial_device_match(struct device *dev,
> > const struct device_driver *drv)
> > {
> > const struct usb_serial_port *port = to_usb_serial_port(dev);
> > - struct usb_serial_driver *driver = to_usb_serial_driver(drv);
> > + const struct usb_serial_driver *driver = to_usb_serial_driver(drv);
> >
> > /*
> > * drivers are already assigned to ports in serial_probe so it's
>
> Now applied with a Fixes tag added.
Great, thanks!
greg k-h
prev parent reply other threads:[~2025-05-21 15:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-21 13:41 [PATCH] USB: serial: bus: fix const issue in usb_serial_device_match() Greg Kroah-Hartman
2025-05-21 15:09 ` Johan Hovold
2025-05-21 15:11 ` Greg Kroah-Hartman [this message]
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=2025052140-amnesty-wing-b0f0@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=johan@kernel.org \
--cc=linux-usb@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