All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.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:09:23 +0200	[thread overview]
Message-ID: <aC3so4VSWcqLy-Nx@hovoldconsulting.com> (raw)
In-Reply-To: <2025052133-recreate-attitude-c564@gregkh>

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).

> 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.

Johan

  reply	other threads:[~2025-05-21 15:09 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 [this message]
2025-05-21 15:11   ` 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=aC3so4VSWcqLy-Nx@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=gregkh@linuxfoundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.