RE: [PATCH 2/2] usb: typec: ucsi: Don't create power supplies for dGPUs

Limonciello, Mario
2023-05-18T15:31:34Z

[AMD Official Use Only - General]

> -----Original Message-----
> From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Sent: Wednesday, May 17, 2023 2:14 PM
> To: Greg KH <greg@kroah.com>
> Cc: Limonciello, Mario <Mario.Limonciello@amd.com>;
> heikki.krogerus@linux.intel.com; rafael@kernel.org; ajayg@nvidia.com; linux-
> i2c@vger.kernel.org; linux-pm@vger.kernel.org; linux-kernel@vger.kernel.org;
> linux-usb@vger.kernel.org; Quan, Evan <Evan.Quan@amd.com>; Lazar, Lijo
> <Lijo.Lazar@amd.com>; Goswami, Sanket <Sanket.Goswami@amd.com>
> Subject: Re: [PATCH 2/2] usb: typec: ucsi: Don't create power supplies for
> dGPUs
>
> On Wed, May 17, 2023 at 08:58:49PM +0200, Greg KH wrote:
> > On Wed, May 17, 2023 at 08:14:13PM +0300, Andy Shevchenko wrote:
> > > On Tue, May 16, 2023 at 01:25:41PM -0500, Mario Limonciello wrote:
>
> ...
>
> > > > +static const struct property_entry dgpu_properties[] = {
> > > > + /* USB-C doesn't power the system */
> > > > + PROPERTY_ENTRY_U8("scope", POWER_SUPPLY_SCOPE_DEVICE),
> > > > + {},
> > >
> > > Comma is not needed in terminator entry.
> >
> > But it's encouraged!
>
> Why?! This might lead to the subtle mistakes going unnoticed during rebases.
> Yes, it's quite unlikely, but it might be still possible to have the empty
> entry in the middle of the array. Why should we shoot ourselves in the foot
> if we can avoid it without any effort?
>
> Hence I can say it's discouraged.
>

I tend to agree with Andy here, you should never be placing something after the
terminator entry and putting a comma there means a mistake /can/ happen.
I will pick up the tags and respin a v2 with this changed and patch 1 dropped
since it went through another tree.