Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1403693pxb; Fri, 20 Nov 2020 08:40:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJzCJ4fP6P+CxKJuPi7IzzecJg4guXNRVfw/SzWlRNEEbaKtqDBhWy44l6v+lESVaXWgpN82 X-Received: by 2002:a50:8a8e:: with SMTP id j14mr24981698edj.87.1605890415421; Fri, 20 Nov 2020 08:40:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605890415; cv=none; d=google.com; s=arc-20160816; b=bJ7u29mdMqPd6b7OO77VJwmlXob1c3nUfRWAlQhn83WsMtHfvm+6VScLBRbLwWhKq3 UImHEWOooQHr/lQXFndUn0p1C2RmXcC0RlJPtEJO0IKTGgnp9JZxOcTsmtLHa42+0+zv ROAIpsyhpiF5RvagHs0MgJW1B/fjkiBBY67zl5zzGUAfeW6qCBVz4GZA4uj5DeakZSpU ilnv4ZB3glDasMWQiMTXjBi+qkkby1wJebh6/rLtaPWtxKy24IW2wpddoBnzQ+WTQlW9 znbWLnBK4ZzVSMflDkS1WauCJP61HMYnAxvYOO/Berkq0ck1uY9gEN0qoCRj4m/xlgex 0xfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=fKVI9e1KS1P4Z+y6jdOA/ZyyROPkdouHhBSn7kF4a5Y=; b=VrzqIJCqUzrFf53+pQGFiIfkcr7kPx5Mp3lErJAN/eUFhcQwBcp3jbcKFdZlXyy+Pa pb3qxlEfdJPXXnAaDG+Yp+JR/trrrXca/tSQoVUKUnsYjcREa8E6NaKDy8B9Fxj7AW7Q pQ3+dJgzdCxbdPVFCTHNTRjlx5jma+bLnnO8/lN9xLcv2AWsCMqbxWvj3f9rscmGh9ik g8ymirZ7UajXMsx1XeFDozc5eGjb/i1iDa8FWYbPv5Oi7RVxi4zFSbQQO8ShqeaB+5e8 dnXIQrq4Xov1JZjtTvstQzLv8nY+WRW0eruTBY4fAOTJpAjRv2qVPG9OrQ5R9/9ZupxI adew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e16si564947eja.462.2020.11.20.08.39.51; Fri, 20 Nov 2020 08:40:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729679AbgKTQhA convert rfc822-to-8bit (ORCPT + 99 others); Fri, 20 Nov 2020 11:37:00 -0500 Received: from mail-ej1-f68.google.com ([209.85.218.68]:45968 "EHLO mail-ej1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728652AbgKTQhA (ORCPT ); Fri, 20 Nov 2020 11:37:00 -0500 Received: by mail-ej1-f68.google.com with SMTP id lv15so7874043ejb.12 for ; Fri, 20 Nov 2020 08:36:58 -0800 (PST) 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; bh=S1+8z3yNNlDYJv6/l1QyHGY+01X4guwfwj1g0QgjnEc=; b=c0AuT1QqUxAcnj2by3vQPEN3ZPT6J++AhxPj0HyOCe21jGVlfkJdTmv2Wxcpaxoc6s LUA94R4v2uD2KdlUGY1lGCpKlWiq+fqWelnO7TO9/dh/ClurE2Hj+b2Ks5jmjwwrKbYH MNNcXKiqlDJ9Uwt7DqIpT2hAN+tip9Hdng3vizq3KBHCbnnIvbPxjdx0h6rdmDmh44GI C0ReH7e9RMcJ5Ld21REFNGOJFpc2TUU5o6KVk5d2tDReixVhZfKtouyZ2bAA1rp4vY1y LOUC28wOWFBi4DqvYfyDYSgTtch8Xcmyc/I+VZAsTcuVpipRocuS9EenxyqMNROusKiw s0Dg== X-Gm-Message-State: AOAM532O+PDfDCWRfiTe2kRWEykg9h6Dx9WWo8OMva9tirgKtM2MSaoB Y9Wmf4MOC6E8IZgrmKxKof4= X-Received: by 2002:a17:906:71d3:: with SMTP id i19mr6287685ejk.187.1605890218153; Fri, 20 Nov 2020 08:36:58 -0800 (PST) Received: from kozik-lap (adsl-84-226-167-205.adslplus.ch. [84.226.167.205]) by smtp.googlemail.com with ESMTPSA id p20sm1318352ejd.78.2020.11.20.08.36.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Nov 2020 08:36:57 -0800 (PST) Date: Fri, 20 Nov 2020 17:36:55 +0100 From: Krzysztof Kozlowski To: Dan Murphy Cc: linux-kernel@vger.kernel.org, Liam Girdwood , Mark Brown , alsa-devel@alsa-project.org, Jaroslav Kysela , Takashi Iwai , Kuninori Morimoto , Jonghwan Choi Subject: Re: [PATCH 29/38] ASoC: tas2562: skip of_device_id table when !CONFIG_OF Message-ID: <20201120163655.GA519670@kozik-lap> References: <20201120161653.445521-1-krzk@kernel.org> <20201120161653.445521-29-krzk@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 20, 2020 at 10:21:56AM -0600, Dan Murphy wrote: > Hello > > On 11/20/20 10:16 AM, Krzysztof Kozlowski wrote: > > The driver can match by multiple methods. Its of_device_id table is > > referenced via of_match_ptr() so it will be unused for !CONFIG_OF > > builds: > > > > sound/soc/codecs/tas2562.c:805:34: warning: ‘tas2562_of_match’ defined but not used [-Wunused-const-variable=] > > > > Signed-off-by: Krzysztof Kozlowski > > --- > > sound/soc/codecs/tas2562.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/sound/soc/codecs/tas2562.c b/sound/soc/codecs/tas2562.c > > index f1ff204e3ad0..19965fabe949 100644 > > --- a/sound/soc/codecs/tas2562.c > > +++ b/sound/soc/codecs/tas2562.c > > @@ -802,6 +802,7 @@ static const struct i2c_device_id tas2562_id[] = { > > }; > > MODULE_DEVICE_TABLE(i2c, tas2562_id); > > +#ifdef CONFIG_OF > > Should we use #if IS_ENABLED(CONFIG_OF) ? I think it does not matter: 1. OF is only bool, 2. This is the existing pattern in many driver (for OF and ACPI), see also: Documentation/firmware-guide/acpi/enumeration.rst 3. ifdef should be faster for preprocessor (less macros to unwind), It would matter if OF became a module option. In such case anyway a lot of existing ifdef CONFIG_OF would have to be corrected. Best regards, Krzysztof