From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH] usb: typec: ucsi: Changing the driver data type to void
Date: Tue, 18 Jun 2024 16:14:57 +0300 [thread overview]
Message-ID: <ZnGIURLIAMijpYUb@kuha.fi.intel.com> (raw)
In-Reply-To: <2024061858-boring-wrecker-3871@gregkh>
On Tue, Jun 18, 2024 at 02:20:03PM +0200, Greg Kroah-Hartman wrote:
> On Tue, Jun 18, 2024 at 03:00:24PM +0300, Heikki Krogerus wrote:
> > Let's use the same data type as struct device.
> >
> > Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> > ---
> > drivers/usb/typec/ucsi/ucsi.h | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/ucsi/ucsi.h
> > index 97eda8cd63df..1280cac314fe 100644
> > --- a/drivers/usb/typec/ucsi/ucsi.h
> > +++ b/drivers/usb/typec/ucsi/ucsi.h
> > @@ -395,7 +395,7 @@ struct ucsi_debugfs_entry {
> > struct ucsi {
> > u16 version;
> > struct device *dev;
> > - struct driver_data *driver_data;
> > + void *driver_data;
>
> Nice, but why?
>
> And how was this building? I don't see a "struct driver_data" defined
> anywhere here.
I had not even thought about that, but that's weird.
I can write anything after "struct" there, and it will just build
without any warnings or errors. The complier does not seem to even
check the type in this case, since the member is always assigned a
void pointer.
So this is actually a bug, no?
thanks,
--
heikki
next prev parent reply other threads:[~2024-06-18 13:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-18 12:00 [PATCH] usb: typec: ucsi: Changing the driver data type to void Heikki Krogerus
2024-06-18 12:20 ` Greg Kroah-Hartman
2024-06-18 13:14 ` Heikki Krogerus [this message]
2024-06-18 13:58 ` 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=ZnGIURLIAMijpYUb@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox