From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org,
Geert Uytterhoeven <geert+renesas@glider.be>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Andi Shyti <andi.shyti@kernel.org>,
linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH 2/4] usb: typec: tcpci_rt1711h: Convert enum->pointer for data in the match tables
Date: Mon, 21 Aug 2023 16:04:14 +0300 [thread overview]
Message-ID: <ZONgzqlS8bGP0umn@smile.fi.intel.com> (raw)
In-Reply-To: <20230820184402.102486-3-biju.das.jz@bp.renesas.com>
On Sun, Aug 20, 2023 at 07:44:00PM +0100, Biju Das wrote:
> Convert enum->pointer for data in the match tables, so that
> device_get_match_data() can do match against OF/ACPI/I2C tables, once i2c
> bus type match support added to it and it returns NULL for non-match.
>
> Therefore it is better to convert enum->pointer for data match and extend
> match support for both ID and OF tables by using i2c_get_match_data() by
> adding struct rt1711h_chip_info with did variable and replacing did->info
> in struct rt1711h_chip. Later patches will add more hw differences to
> struct rt1711h_chip_info and avoid checking did for HW differences.
...
> +struct rt1711h_chip_info {
> + u16 did;
> +};
> +
> struct rt1711h_chip {
> struct tcpci_data data;
> struct tcpci *tcpci;
> struct device *dev;
> struct regulator *vbus;
> bool src_en;
> - u16 did;
> + const struct rt1711h_chip_info *info;
Have you run pahole? I believe now you wasting a few more bytes
(besides the pointer requirement) due to (mis)placing a new member.
> };
...
For all your work likes this as I noted in the reply to Guenter that
the couple of the selling points here are:
1) avoidance of the pointer abuse in OF table
(we need that to be a valid pointer);
2) preservation of the const qualifier (despite kernel_ulong_t
being used in the middle).
With that added I believe you can sell this much more easier.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-08-21 13:04 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-20 18:43 [PATCH 0/4] onvert enum->pointer for data in the rt1711h match tables Biju Das
2023-08-20 18:43 ` [PATCH 1/4] usb: typec: tcpci_rt1711h: Make similar OF and ID table Biju Das
2023-08-20 18:44 ` [PATCH 2/4] usb: typec: tcpci_rt1711h: Convert enum->pointer for data in the match tables Biju Das
2023-08-21 13:04 ` Andy Shevchenko [this message]
2023-08-21 13:27 ` Geert Uytterhoeven
2023-08-21 15:24 ` Andy Shevchenko
2023-08-21 15:40 ` Geert Uytterhoeven
2023-08-21 16:05 ` Guenter Roeck
2023-08-21 17:08 ` Andy Shevchenko
2023-08-22 7:21 ` Geert Uytterhoeven
2023-08-22 11:44 ` Andy Shevchenko
2023-08-22 12:00 ` Geert Uytterhoeven
2023-08-22 12:08 ` Andy Shevchenko
2023-08-22 12:51 ` Biju Das
2023-08-22 13:23 ` Andy Shevchenko
2023-08-23 14:49 ` Andi Shyti
2023-08-23 15:10 ` Geert Uytterhoeven
2023-08-23 15:20 ` Greg Kroah-Hartman
2023-08-23 15:36 ` Dmitry Torokhov
2023-08-21 16:45 ` Biju Das
2023-08-20 18:44 ` [PATCH 3/4] usb: typec: tcpci_rt1711h: Add rxdz_sel variable to struct rt1711h_chip_info Biju Das
2023-08-21 13:06 ` Andy Shevchenko
2023-08-21 13:33 ` Geert Uytterhoeven
2023-08-21 15:26 ` Andy Shevchenko
2023-08-20 18:44 ` [PATCH 4/4] usb: typec: tcpci_rt1711h: Add enable_pd30_extended_message feature bit " Biju Das
2023-08-21 13:08 ` Andy Shevchenko
2023-08-21 14:12 ` Guenter Roeck
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=ZONgzqlS8bGP0umn@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=andi.shyti@kernel.org \
--cc=biju.das.jz@bp.renesas.com \
--cc=dmitry.torokhov@gmail.com \
--cc=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@roeck-us.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 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.