Received: by 10.223.185.116 with SMTP id b49csp3863031wrg; Tue, 13 Feb 2018 08:53:07 -0800 (PST) X-Google-Smtp-Source: AH8x226r4y8W2Q3MvJjJCBrER/qK813ogkIETZkpbNSoFC2KGvBPWHfP3e5hHS349jutkOD6xSQp X-Received: by 2002:a17:902:7614:: with SMTP id k20-v6mr1661516pll.343.1518540787106; Tue, 13 Feb 2018 08:53:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518540787; cv=none; d=google.com; s=arc-20160816; b=gy+8vx10hG4AbPEKAW+BigbJtoi+1uqy4lkXz01VajqqZu5Rr9S1j6FOmRB6I4fFpe k0khI7F5g3IjuXKG0DWV/0diFMuq7O2KyHCUZL4h6W8jj+YIQ+KDhdYNEY7Jivr324Ja domZ9qvAF6WK9DwLo/JOdYne5aSOsKbZImH3f2TrOqQCXt3bhb8pzDOuye2TCDNvxPGn n3zyfA4N5u2VqZa5tRFWwyiz1AMistzvpSTCMAlgCuC1V6U4EJbf+sqpK/n5XWO8IqGB vtyJBF9Pz9MtrJfKvmqCTcJxzJHAS6zw/zkLzuUZnzcxGWJN7QPIP8BY+BgcENSt5JQ/ mOcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=fi1w4087c0ChY72hzqUYNF951XLRz52v11p7GRjNPzc=; b=Y6hhjYzef3F1XsskQJ7CQtP3yFWoFOcgNMuV++VoAOzu8qOzaIcVME3rOVJeHyf6kC KJxDAsod9N3i5kkCKSLyWJs6nitIcg6DV1z5rRhhZ92FAX9RQjpR3lCor+8nFVu2FSJ5 xaLBsd5iM4bK6FUVyjjyLR2+CLJkaeC3OYvnC8xCPhveSMl6/8vCaqZ4cLcM+B39C1bg V8XpZE3MmmgwYU/tddtqT1nO5Iyop70e4tydXZoOkAQCGOseVtErlJQcET2jVeVih/Iw E0pvFAbBeTCiMbZ0J5+9Rq0PFuCQX48iI+XD96lA3HfJGeZ7mu2/ofncYG7eWqNgn5VM kXgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lUzPqjMZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y10si8294485pff.4.2018.02.13.08.52.52; Tue, 13 Feb 2018 08:53:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lUzPqjMZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934731AbeBMQu3 (ORCPT + 99 others); Tue, 13 Feb 2018 11:50:29 -0500 Received: from mail-wr0-f169.google.com ([209.85.128.169]:34040 "EHLO mail-wr0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934514AbeBMQu1 (ORCPT ); Tue, 13 Feb 2018 11:50:27 -0500 Received: by mail-wr0-f169.google.com with SMTP id m5so7215712wrg.1; Tue, 13 Feb 2018 08:50:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fi1w4087c0ChY72hzqUYNF951XLRz52v11p7GRjNPzc=; b=lUzPqjMZ3Jr6vDWnn4e/y8lDPuUtpsvHOp+K+9qtuLRroSh1QZZcPTDq+nF4RDq7UJ Mo8cOwVp0UBmMnPCjwj3KJF5Eg83hH0A5PdvYXKR3Km/jEWOH+TeG9aXilagyksm4NIO eKVIyXAK0fzrniwoftFKfxmdVHjYQSGDXevxH55n8U6FZbe4qb69yE8XHn1AAkR6/L8O mA10kfLaj9YSk5YUfboqT0YTXoTVNzCynEGjzvjd5HT2ZL/VQ5E7AjgAR7msdM9D4YXQ KXgGGxAcletfeLy+uv9OElxPX8E00lOVetlvMvx5ANobJ3quqH/HT5dxKXd5YkBisM1j 0VJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=fi1w4087c0ChY72hzqUYNF951XLRz52v11p7GRjNPzc=; b=qbS8o89TxWT3ASdqRmQPjICazaLJbRA+XTAYCQkYPtn0Br0AvIXJ4xGkSdYbSdh03A CYfcKYNXnbRihpU0kgOciS+/QbUAVWXVneU5ZxMxxfgCk8Tkh3vBJwld3XHpm6A/YIPi Md/cmetcuYZ/lAYdA/Co+UQXB6bwtBY9FF9aRuBNIczKB9eUw8w4k+tVv5YFm9nXhitK q+MXjfVnk2dr+NEuGQsR7KRCYQv+imlcsD+79MoW/f4iwGxyxYR42zxbTzuXzcZd8v4H muxIVDBevUyLWDohKesAhNLBixld5Hllxniy3MDbvuUDvZUnvGzZG8Ovr0jKIDGWQeYn vshw== X-Gm-Message-State: APf1xPBtm42gHxKNetDy6+PIdMT1XkSh0sS/FKcyWcAUOLPvTNUdCCRh HWub9zZER6Sf0Vq6PWpzmxw= X-Received: by 10.223.190.141 with SMTP id i13mr1874990wrh.211.1518540626080; Tue, 13 Feb 2018 08:50:26 -0800 (PST) Received: from pali ([2a02:2b88:2:1::5cc6:2f]) by smtp.gmail.com with ESMTPSA id d73sm10367993wma.25.2018.02.13.08.50.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2018 08:50:24 -0800 (PST) Date: Tue, 13 Feb 2018 17:50:23 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Andy Shevchenko , Jean Delvare Cc: Wolfram Sang , =?utf-8?B?TWljaGHFgiBLxJlwaWXFhA==?= , Steven Honeyman , Valdis Kletnieks , Jochen Eisinger , Gabriele Mazzotta , Andy Lutomirski , Mario Limonciello , Alex Hung , Takashi Iwai , linux-i2c , Linux Kernel Mailing List , Platform Driver Subject: Re: [PATCH v2] i2c: i801: Register optional lis3lv02d i2c device on Dell machines Message-ID: <20180213165023.xmzovx7fd3gdljxw@pali> References: <20180127133209.28995-1-pali.rohar@gmail.com> <20180128144509.pobnj7cayc4psgrj@pali> <20180131120348.azy25aqvn5wrdkeh@pali> <20180212153012.vffvjmz26ifyxbj5@pali> <20180213150004.5d2v7y7wwuure4io@pali> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sby3f4udqueoitq4" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --sby3f4udqueoitq4 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tuesday 13 February 2018 17:06:19 Andy Shevchenko wrote: > On Tue, Feb 13, 2018 at 5:00 PM, Pali Roh=C3=A1r w= rote: > > On Tuesday 13 February 2018 16:55:00 Andy Shevchenko wrote: > >> On Mon, Feb 12, 2018 at 5:30 PM, Pali Roh=C3=A1r wrote: > >> > On Wednesday 31 January 2018 14:27:51 Andy Shevchenko wrote: > >> >> On Wed, Jan 31, 2018 at 2:03 PM, Pali Roh=C3=A1r wrote: > >> >> > On Sunday 28 January 2018 17:00:35 Andy Shevchenko wrote: > >> >> >> On Sun, Jan 28, 2018 at 4:45 PM, Pali Roh=C3=A1r wrote: > >> >> > >> >> >> > ACPI device name is SMO8800, SMO8810, ... Will that acpi_dev_p= resent > >> >> >> > function match only prefix and not exact string? > >> >> >> > >> >> >> OK, fair enough. > >> >> >> > >> >> >> Do we have more users of such pattern? > >> >> > > >> >> > I have not seen this ACPI pattern yet, so probably not. > >> >> > >> >> I see. So, my one concern is the implicit names of the devices. I > >> >> would like rather to see > >> >> > >> >> ... acpi_device_id ... []=3D { > >> >> {"SMO8800"}, > >> >> {"SMO8810"}, > >> >> ... > >> >> {} > >> >> }; > >> > > >> > Following table already exists in dell-smo8800.c file: > >> > > >> > static const struct acpi_device_id smo8800_ids[] =3D { > >> > { "SMO8800", 0 }, > >> > { "SMO8801", 0 }, > >> > { "SMO8810", 0 }, > >> > { "SMO8811", 0 }, > >> > { "SMO8820", 0 }, > >> > { "SMO8821", 0 }, > >> > { "SMO8830", 0 }, > >> > { "SMO8831", 0 }, > >> > { "", 0 }, > >> > }; > >> > > >> > MODULE_DEVICE_TABLE(acpi, smo8800_ids); > >> > > >> > Can we reuse it? > >> > >> > Maybe moving array smo8800_ids[] into some header file > >> > (which one?) and statically inline it? > >> > >> Bad idea. > >> > >> > Or having it only in > >> > dell-smo8800.c file and exporting its symbol? > >> > >> Even worse. > >> > >> > Or is there better idea? > >> > > >> > For sure I do not want to copy paste this table into another module = and > >> > maintaining two copies of this list. > >> > >> The copy is fine. Can you guarantee that those two lists would be > >> always the same? I'm not. > > > > Me neither. > > > >> And besides that explicitly over implicitly is a really good thing. I > >> would not like to grep for an ID followed by grepping include line and > >> check each files to check if it uses it or not. > > > > So what do you suggest now? >=20 > Copy'n'paste and maintain two lists. > Yes, it's not the ideal, but working solution. >=20 > You may put a comment before each list to explain what the second does > and tell a contributor to look at it and update if needed. I'm not maintainer of i2c-i801.ko, Jean Delvare & Wolfram Sang are. Therefore instructing future contributors would be up to them. Jean, it is OK? > > Having one file where it would be defined is a bad idea for you. >=20 > Not just "one file", but "one *header* file". Or "exporting a symbol" > which is basically not supposed to be exported. > ID tables are part of the actual drivers, neither headers, nor libraries. But this is exactly what is needed. This ACPI ID table contains ACPI names which says if accelerometer is present or not. > > And maintaining copy of same array in two different files in two > > different subsystems is something which I cannot guarantee. > > > > Therefore the current patch is the best approach. >=20 > I don't like it. I'll not take it, sorry. >=20 > > No shared file with > > shared array/table and also no copy of that array in two different > > subsystems. >=20 >=20 --=20 Pali Roh=C3=A1r pali.rohar@gmail.com --sby3f4udqueoitq4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQS4VrIQdKium2krgIWL8Mk9A+RDUgUCWoMXTAAKCRCL8Mk9A+RD Um+FAJwNzfwBpTDvW4yvPauznhYCOibZMQCgxRwsy/4m14+zLcmgLl0D/2ykWNM= =LQC0 -----END PGP SIGNATURE----- --sby3f4udqueoitq4--