Received: by 10.223.185.116 with SMTP id b49csp3734610wrg; Tue, 13 Feb 2018 07:01:08 -0800 (PST) X-Google-Smtp-Source: AH8x227x2CeZoyMD8kgcs02kuh+rUxkHfSfja58De+zyiOqxr2TJAPqdlOXrk72vjjmBrMhIkJNz X-Received: by 2002:a17:902:be0f:: with SMTP id r15-v6mr1401568pls.1.1518534067989; Tue, 13 Feb 2018 07:01:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518534067; cv=none; d=google.com; s=arc-20160816; b=gRJGAaQj9iN2AV6zuOzYhlN7L4ah1k7yd3FbFivW6GCkZkyJVAVe4LW9BsGKSnRT8h Qll3y/+3WpYd87lNSGPz6WjUmy24zob5egaeIM/Yuq7+xI/XC9nQe2q/JMX6qirpxWuM MHj4g0Og2qHVZ3qFNbepLT7H0m1DC6f2NKFBH1j18qMZZj8aORcT2LsGJRmqC+zvzIxY S3Ft8QICBXzSySW2bmZvvDt/QR1iXok/7/h+0ROzfD3jS2HtDuF1f6RfBNaKR9FP98Ak UW28iPObV7NX5XXlODdPOps26gAq5UdQOpKdupZG2jnxzl7nGERToZF3wm543JQdfS0/ 51Bw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=/VovNhLCXSDue5qPI+bWYLSOByyzCARYm4PhiOt/BrA=; b=V+Uwf5kZFrZaZ6xPZ6jZN8tleBZWaS4GLGHc7O+P8KIiKrLHmo0uAHNq7vkzQQme4X WnliQ2SJAqzpwERsgR0H22lHD7dlZSxQHH5kYV0m+8vZDjUjVawc+3z2cCjBWxVezCuh xlVvneVe73XlvRsGW7rN8OGxEsKQpNkG8uiF3+W9u504g2yuqtG5i1+iI/QuA21/FbSa sl3U7vjuOm7hhiokuqoDw1OvKn1rZN1n8sfUB6xCxlKBDOcrJj4JFPsQFX/t8gYiY1p3 R4+PVaQyN08ZkUfI0Do0zExVUvjMKbKyDmE+BmYGx+XhObWV7ZbDWl9iAUll1rqrvfGa FdVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WeJdXFxm; 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 81si1413374pfh.38.2018.02.13.07.00.51; Tue, 13 Feb 2018 07:01: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=WeJdXFxm; 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 S965188AbeBMPAL (ORCPT + 99 others); Tue, 13 Feb 2018 10:00:11 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:37731 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965146AbeBMPAH (ORCPT ); Tue, 13 Feb 2018 10:00:07 -0500 Received: by mail-wm0-f66.google.com with SMTP id v71so16575981wmv.2; Tue, 13 Feb 2018 07:00:06 -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:content-transfer-encoding:in-reply-to :user-agent; bh=/VovNhLCXSDue5qPI+bWYLSOByyzCARYm4PhiOt/BrA=; b=WeJdXFxmRArBiWVy5WnUdYXofDcjcZS/J4KFMgrCUWs8Lq7jiSbJP+Gll+Y3NtveHT 7WFFWXq9RBybuzKqvBpdPacmR1kbWxnxBMB81QROnXOvu3d/N8TqkEwReb5H23HJ6A/S vpznXhpWM94Yg0DjXvg1gX/M/4lyW6ArDkPYGH3+54TOaBlVuCdJiJWXmSef+lb7L6w4 ARqwctFb7f4M5f8ukRSPndnqWjrKVyOKjAsvEcLTRwcLxIg3XmpetAd1GRICIfi6XxYF ZHusVtdqFqjT24NyCOaPAb0CflXSFk3euHMutGZBsdy94U/4RICZH0xfTKAjD1gOHtPk hm3g== 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:content-transfer-encoding :in-reply-to:user-agent; bh=/VovNhLCXSDue5qPI+bWYLSOByyzCARYm4PhiOt/BrA=; b=G0y0cfebxt0l3aqnbEjEMes2/onCGibaH5OBZvwcwdJ7+XNzvPZIEUmeJjFeKiLJHZ wdK/KKKDE3Qhy+ct3mevL/0YIm9w8cOgcnCNN4hj/iAUgSlhdlGCImapDJfVbmsbzl0A e7qA3cTZ50gTD4ikkdhCdzYUlIGN9r6s2sazRqvRT5hQsdBMPoJMRc8Ly2sLHgU3YuQv BY2XPfOCk56S7NQJ6TQcS1xxt243u041/NgpTRmD+LJWmpK5CFMbM+Z95k+RKtUdHlyc O22T3z0SsREE6sZ/FSDnoeTEsPKvX2e0PVlAQqNvzxIBvTqr7evjijOvKlfDUlVTxP/E SD7A== X-Gm-Message-State: APf1xPAalZyaysG/uhMw9sLyKLqjJZNGwNUAvDAlwgh8RZoKkilQB9l1 xyq424PYCVxQbKQUFxiUZ9U= X-Received: by 10.28.203.142 with SMTP id b136mr1679650wmg.127.1518534006100; Tue, 13 Feb 2018 07:00:06 -0800 (PST) Received: from pali ([2a02:2b88:2:1::5cc6:2f]) by smtp.gmail.com with ESMTPSA id d5sm11872889wra.72.2018.02.13.07.00.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2018 07:00:05 -0800 (PST) Date: Tue, 13 Feb 2018 16:00:04 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Andy Shevchenko Cc: Jean Delvare , 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: <20180213150004.5d2v7y7wwuure4io@pali> References: <20180127133209.28995-1-pali.rohar@gmail.com> <20180128144509.pobnj7cayc4psgrj@pali> <20180131120348.azy25aqvn5wrdkeh@pali> <20180212153012.vffvjmz26ifyxbj5@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 On Tuesday 13 February 2018 16:55:00 Andy Shevchenko wrote: > On Mon, Feb 12, 2018 at 5:30 PM, Pali Rohár wrote: > > On Wednesday 31 January 2018 14:27:51 Andy Shevchenko wrote: > >> On Wed, Jan 31, 2018 at 2:03 PM, Pali Rohár wrote: > >> > On Sunday 28 January 2018 17:00:35 Andy Shevchenko wrote: > >> >> On Sun, Jan 28, 2018 at 4:45 PM, Pali Rohár wrote: > >> > >> >> > ACPI device name is SMO8800, SMO8810, ... Will that acpi_dev_present > >> >> > 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 ... []= { > >> {"SMO8800"}, > >> {"SMO8810"}, > >> ... > >> {} > >> }; > > > > Following table already exists in dell-smo8800.c file: > > > > static const struct acpi_device_id smo8800_ids[] = { > > { "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? Having one file where it would be defined is a bad idea for you. 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. No shared file with shared array/table and also no copy of that array in two different subsystems. -- Pali Rohár pali.rohar@gmail.com