All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org,
	 Krzysztof Kozlowski <krzk@kernel.org>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	 linux-i2c@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH RFC] i2c: Add a void pointer to i2c_device_id
Date: Mon, 29 Apr 2024 15:55:57 +0200	[thread overview]
Message-ID: <f6ddimzsqjuweaeagsmnfowcktofngjrafosab6owxj4mxkulk@2f6mg7wfdk6p> (raw)
In-Reply-To: <Zi92UCnZa90DXAI9@smile.fi.intel.com>

[-- Attachment #1: Type: text/plain, Size: 2311 bytes --]

Hello Andy,

On Mon, Apr 29, 2024 at 01:28:32PM +0300, Andy Shevchenko wrote:
> On Mon, Apr 29, 2024 at 12:21:05PM +0200, Uwe Kleine-König wrote:
> > On Mon, Apr 29, 2024 at 11:54:29AM +0300, Andy Shevchenko wrote:
> > > On Fri, Apr 26, 2024 at 11:38:33PM +0200, Uwe Kleine-König wrote:
> 
> ...
> 
> > > >  static const struct i2c_device_id wlf_gf_module_id[] = {
> > > > -	{ "wlf-gf-module", 0 },
> > > > +	{ "wlf-gf-module", },
> > > 
> > > In such cases the inner comma is redundant as well.
> > 
> > I would tend to keep the comma, but no strong opinion on my side.
> 
> It's just a confusing leftover in my opinion.
> 
> > If another member init is added later, the line has to be touched
> > anyhow, but in the layout:
> > 
> > 	... = {
> > 		{
> > 			"wlf-gf-module",
> > 		},
> > 		{ }
> > 	}
> > 
> > I'd keep it for sure.
> 
> That's not what I object. Here I am 100% with you.

OK, agreed. I'm not sure yet if I prefer

	static const struct i2c_device_id wlf_gf_module_id[] = {
		{ "wlf-gf-module" },
		{ }
	};

or

	static const struct i2c_device_id wlf_gf_module_id[] = {
		{ .name = "wlf-gf-module" },
		{ }
	};

> > > In general idea might be okay, but I always have the same Q (do we have it
> > > being clarified in the documentation, btw): is an ID table the ABI or not?
> > > In another word, how should we treat the changes there, because ID tables
> > > are being used by the user space tools.
> > 
> > Note that the layout doesn't change and the traditional interpretation
> > of the data still works fine. Or do you see something that I miss?
> 
> Do we have any configurations / architectures / etc when
> sizeof(kernel_ulong_t) != sizeof(void *) ? If not, we are fine.

According to https://wiki.debian.org/ArchitectureSpecificsMemo (my goto
address for such questions) we have sizeof(void *) == sizeof(long) on
all archs. Also storing a pointer in today's struct
i2c_device_id::driver_data is so common that it should be safe to assume
that sizeof(void *) <= sizeof(kernel_ulong_t). And that <= is enough
that the union doesn't get bigger.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2024-04-29 13:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 21:38 [PATCH RFC] i2c: Add a void pointer to i2c_device_id Uwe Kleine-König
2024-04-29  8:54 ` Andy Shevchenko
2024-04-29 10:21   ` Uwe Kleine-König
2024-04-29 10:28     ` Andy Shevchenko
2024-04-29 13:55       ` Uwe Kleine-König [this message]
2024-04-29 15:17         ` Andy Shevchenko

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=f6ddimzsqjuweaeagsmnfowcktofngjrafosab6owxj4mxkulk@2f6mg7wfdk6p \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@pengutronix.de \
    --cc=krzk@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    /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.