Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1290859ybg; Fri, 18 Oct 2019 15:18:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5wXfKjOIg5iVKW4cNXAN8UENRE4P3+uPE1J8X6Jev8TiWYxr1l+x5DWmansd4v56/ZRiq X-Received: by 2002:a50:8f65:: with SMTP id 92mr12723430edy.9.1571437125059; Fri, 18 Oct 2019 15:18:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571437125; cv=none; d=google.com; s=arc-20160816; b=UFUqWGJgpQ2n4jq5XiXJ8SCpd/1hvhu66kKY32m7ka5e40ueJeNGSKXwfJKbinrsKe adxn5fsBag+9DfLwo3Db4XJIsvbUk7nrhq6BsO7zkkpji3gAjYtQQW+mAk9Nykw8Yljf i5OpyQBrt2iqMfpXqk/r3QvZhvihp8tHGtbmp351arwhqH67AhGTXcHCPmmcz8l3Racb wM9RhkL/oJCzl6PpZdzFQqDm4C3kqUKY3MXZgqWKl7wE8Iw2f4EWwhvhDN9ZFEoeLYw4 4eeeGcd+m+7ZhCNeHvXuxgYEEjFadoU2ASufCw3DNrVYYnhRDO5xVhHlj1cfxfJIJNik dXeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=hLH6ZQG29JzHNUvV5OPT/hW5toMkkjJaYpS7fLFsYDY=; b=y1JTUH3DNJJlLTg/5KrQBkd7TNRyKPexnWP9lLxLWecBABnls0GWO4z9pj5Z4bdqJ1 MG1HF23eAZB7isjT+FjrjK6BW5NT6c+jTS33wT0yDu0mKiY0Sf38E16VhE7JY6sUQJ1X GFbi008O2CKELkPO7COGZ511FelEhWBDjG+liTfqmoIFUpyjEnvgT80g3uXb+uZIS1uf pplDApsNfs/o844u47qudNPdDGRJbRiNmnh6AGQ5yx4MXLko1OMv7Zdw9OA4PRLGFjrL 3UI8NQILF4//h/1gocj9eIhIXJOpm3D+La2V8CD/i0qGCvSY0FmgLk3S3qUdHxP1JpX5 1Oaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=p0p74HCb; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j6si4277697ejj.37.2019.10.18.15.18.21; Fri, 18 Oct 2019 15:18:45 -0700 (PDT) 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=@kernel.org header.s=default header.b=p0p74HCb; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394708AbfJQUYh (ORCPT + 99 others); Thu, 17 Oct 2019 16:24:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:53644 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731007AbfJQUYh (ORCPT ); Thu, 17 Oct 2019 16:24:37 -0400 Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1289C21A4C for ; Thu, 17 Oct 2019 20:24:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571343876; bh=dEhlN1U9q8+rO6EnwLvvcaOV2HkWaFaoPFGlTDAzBkU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=p0p74HCbcYgT+5BHELgLVVDLse9PuVLzUI7RhtxUlznok7FoWM8BTCUDW6OfRAsWJ sKCG8evw/FdP5rx4S5WFuknm58Ye9ZzkQV2ZeMMpth1T9QJt97kKtpOECpLzg8m/38 iM9+osJSRegBD9vDvVv32TixDV2qnpAXHEMuE2Jk= Received: by mail-qk1-f178.google.com with SMTP id 4so3153448qki.6 for ; Thu, 17 Oct 2019 13:24:36 -0700 (PDT) X-Gm-Message-State: APjAAAV7ZC/BTfKmE76dSdTJVS9fbEqfUcM2qdU1HTjp7JRpTvKTeU4W D3zq3AichtWEYiJFqn45Y78Fzi35PytWwsp2lA== X-Received: by 2002:a37:9847:: with SMTP id a68mr5331285qke.223.1571343875161; Thu, 17 Oct 2019 13:24:35 -0700 (PDT) MIME-Version: 1.0 References: <20191004214334.149976-1-swboyd@chromium.org> <20191004214334.149976-11-swboyd@chromium.org> <6ce47827-55e4-dd15-6a05-f25a2f8a8bb7@gmail.com> In-Reply-To: <6ce47827-55e4-dd15-6a05-f25a2f8a8bb7@gmail.com> From: Rob Herring Date: Thu, 17 Oct 2019 15:24:23 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 10/10] of/device: Don't NULLify match table in of_match_device() with CONFIG_OF=n To: Stephen Boyd Cc: "linux-kernel@vger.kernel.org" , Arnd Bergmann , Geert Uytterhoeven , Frank Rowand Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 17, 2019 at 12:48 PM Frank Rowand wrote: > > On 10/04/2019 16:43, Stephen Boyd wrote: > > This effectively reverts 1db73ae39a97 ("of/device: Nullify match table > > in of_match_device() for CONFIG_OF=n") because that commit makes it more > > surprising to users of this API that the arguments may never be > > referenced by any code. This is because the pre-processor will replace > > the argument with NULL and then the match table will be left unreferenced > > by any code but the compiler optimizer doesn't know to drop it. This can > > lead to compilers warning that match tables are unused, when we really > > want to pass the match table to the API but have the compiler see that > > it's all inlined and not used and then drop the match table while > > silencing the warning. We're being too smart here and not giving the > > compiler the chance to do dead code elimination. > > > > Cc: Arnd Bergmann > > Cc: Geert Uytterhoeven > > Cc: Rob Herring > > Cc: Frank Rowand > > Signed-off-by: Stephen Boyd > > --- > > > > Please ack or pick for immediate merge so the last patch can be merged. As this one is the last patch, I guess you don't want it picked up by itself. It seems everyone has acked rather than applying. Do you want me to take the series? Rob > > > > include/linux/of_device.h | 4 +--- > > 1 file changed, 1 insertion(+), 3 deletions(-) > > > > diff --git a/include/linux/of_device.h b/include/linux/of_device.h > > index 8d31e39dd564..3f8ca55bc693 100644 > > --- a/include/linux/of_device.h > > +++ b/include/linux/of_device.h > > @@ -93,13 +93,11 @@ static inline int of_device_uevent_modalias(struct device *dev, > > > > static inline void of_device_node_put(struct device *dev) { } > > > > -static inline const struct of_device_id *__of_match_device( > > +static inline const struct of_device_id *of_match_device( > > const struct of_device_id *matches, const struct device *dev) > > { > > return NULL; > > } > > -#define of_match_device(matches, dev) \ > > - __of_match_device(of_match_ptr(matches), (dev)) > > > > static inline struct device_node *of_cpu_device_node_get(int cpu) > > { > > > > > Acked-by: Frank Rowand