Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1260653lqa; Mon, 29 Apr 2024 03:21:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX99Duq1jYrb6+ZPBg0JT6uancZMz8yaejkpKG5ryhkKyQnbkMTzNb3Nbycf8yDndeFj/ybWQLusDCQW6fGbYkmCY0JYMjhb8ZmnV5Pbg== X-Google-Smtp-Source: AGHT+IEcT/PZw0nuzPI4kkzq9Td5g0TMsjGLmzSEJztFicSxbhWbW0o3Ul64zMiurQrzwIFH4tv4 X-Received: by 2002:a50:f699:0:b0:572:795a:b913 with SMTP id d25-20020a50f699000000b00572795ab913mr3834993edn.34.1714386094656; Mon, 29 Apr 2024 03:21:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714386094; cv=pass; d=google.com; s=arc-20160816; b=M5qG30mLC2Ix0uj+y+Z6DyPF3NEipHT3nrRTNmAZckS4P5x51cg8KHZ93Rz9k5HZw3 vVUPIgr+BIPS5eUYrlQ4ve5XVue+PFLyAiQc+FJ+xIipVFDELEUnnFT1yg98uX3sq5Cz X1GEnm7ItWyJHm7YOBY14mmxakblyfcxLAf38ciaeYqgH+WiK36Blfgpar4Rkse7fww/ 3fnQKhACmVV418GxU6Oa6gWoQ4RMU6PG1Upt/S++//PwY5G8P6wRYnIX+BTiIAwuE/u3 KeKGTdpiS/ZfsqU+q0SJwRJibdAjTbRYu/d7ux1NwXgdevyMalDULl0YqWxRPczWKrS5 VoDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=zZEdOmvAE8z8foc+3stOGhIBUzBR4L2sptUpRcPTIHo=; fh=mp5dXrPiRTLy0WeGcL4Be+g2ODZx4bHQ2UXHL7DrIbU=; b=PRUEX7USbQaoUtgbVqV/Y8E7bttBoN9EXQy9xXazLo6jfp7YV93yCWjkjR5i7oAgEr 0Q2bFDakwRWUsVOP+6IJXcspHpyEc3UQOTThoeybW7hNtZMIuMeVaZDWQ4w5CvSTzKkt rVMQtaGFSBDJM6wdePQfwAmb+tDFysxQeEKuvinv/BnyUDi2DvW9GNBnFgEXKL2QXq6W WKypB/IFYgcklSRlfMYRFcfItfG7m+DSHae/JwKAQr9iynmos2lWgdftT6n/0sSVio5B zZhvYcs0TK/NJSE58PhiwdRjY97VQv33nr7bXI3pxSFSraFDwmZ2yuBJYU03/M5+HFIb +6LA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-162042-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162042-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id r27-20020a50aadb000000b005727c1d1567si1796978edc.214.2024.04.29.03.21.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 03:21:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162042-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-162042-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162042-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 397D31F222C9 for ; Mon, 29 Apr 2024 10:21:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE7BA39852; Mon, 29 Apr 2024 10:21:20 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A234B2D05D for ; Mon, 29 Apr 2024 10:21:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714386080; cv=none; b=lad/MWJ1ORz8rWK43HOsKGnSNtFyHU+QzptRUE6nn5x8MT14Nb0yXHXx4G/1cuA4e/m1WbxTTGhI3yBnctUG+DadTWWuKj2TfY7mTcwq7dtPGL7JFSYk+HonyquNPJ08P3rfzGiWCcVZwxYJSYKa59fhV7vorT57sE6Q6g+tBSA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714386080; c=relaxed/simple; bh=9zXkXARb0Y7OThiBiWvdEzXLPbICHSg8JrvKpqC7LCw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fsfan/hjne4NJPJUePJyFJSuTyCujkkB7SOymBbYWgjlpajZ0B1MwO68gjZUJ6/d1FAUVeS30Fe9WU8lxf8wUkAL6rbMgw48UuXgujRyw+ufBVnwLtKjrIhAfsKWMvU3Ku9wY8W9UNhbohPxjr20r4pgKPDT6gwO9Z8w5SnHNF0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s1O8B-0005bP-Ut; Mon, 29 Apr 2024 12:21:07 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s1O8A-00ExbE-2L; Mon, 29 Apr 2024 12:21:06 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1s1O89-00BJHy-3B; Mon, 29 Apr 2024 12:21:05 +0200 Date: Mon, 29 Apr 2024 12:21:05 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Andy Shevchenko Cc: Arnd Bergmann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Krzysztof Kozlowski , Wolfram Sang , linux-i2c@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH RFC] i2c: Add a void pointer to i2c_device_id Message-ID: References: <20240426213832.915485-2-u.kleine-koenig@pengutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yfivxb4d4fdixn6l" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org --yfivxb4d4fdixn6l Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, 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=F6nig wrote: > > Traditionally a struct i2c_device_id has a kernel_ulong_t member to > > store some chip variant data. Some drivers use it to store an enum, > > others to store a pointer. In the latter case there is some ugly(?) > > casting involved. To improve that, add a void pointer in an anonymous > > union together with the integer driver_data. > >=20 > > This way a i2c_device_id requires usage of a designated initializer when > > the driver_data or data member should be initialized, but IMHO that's > > fine and you might even consider that an advantage. >=20 > ... >=20 > > static const struct i2c_device_id wlf_gf_module_id[] =3D { > > - { "wlf-gf-module", 0 }, > > + { "wlf-gf-module", }, >=20 > In such cases the inner comma is redundant as well. I would tend to keep the comma, but no strong opinion on my side. If another member init is added later, the line has to be touched anyhow, but in the layout: ... =3D { { "wlf-gf-module", }, { } } I'd keep it for sure. > > { } > > }; >=20 > ... >=20 > 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? Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --yfivxb4d4fdixn6l Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmYvdJAACgkQj4D7WH0S /k5SrAf/UQu0T91ViSkNd60kQV/AoTviGlvx8F5UlQbv/Vqu3BH9V2qGdpKpBhZh rp4lcTa2z6SegBoH6yctMYp9vfPWE1MB0URyTm2Hvzj9zCxOB7bu2gtuAzYeKvLG UyAzHCqa9K+AwWgSAb/rH3aqy3pHwxL3JoB+FSgcu75SBgpPkRukZgJDrCB7gWzb AUlb0Z3LrSjRUGSVvxxSxNy5S69CSDMQ20cvK8of7mno8uL0MYJ/RKCRfx+XGsvm V0HZwZgSI+D/oNCIKLtB9DoH/3W9xGCZIgnfBDWbtKGizCt9A9bDujaR8cYAdGrR dM19ko2kATgu3pL2e/Jf1ly3N97j1Q== =eVcX -----END PGP SIGNATURE----- --yfivxb4d4fdixn6l--