Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1282101ybg; Fri, 18 Oct 2019 15:10:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqyyH4/CgPa/Dq8G/lKUCskV0ce346ViwVvvguIVUo1KYGxna3zQ+D8QvyymIdLtoIV/DLat X-Received: by 2002:a17:906:d964:: with SMTP id rp4mr10702420ejb.147.1571436615065; Fri, 18 Oct 2019 15:10:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571436615; cv=none; d=google.com; s=arc-20160816; b=szTlHl1j0Fr7CUXGNLEeVll15kGYP3UgzdnxqGMENkCgu8klkbkc3pqfazCxTs0Zrq 2/Yea1n2B7Hm7chbwXg13KtU7bvASFBdH4FExw5/KXFJnFqfzhVPJwcgaaQpliqUITwZ BcN40W5ALGDg/IkrseKzoD84HkK4HLF5TUrncH544d8PmSrMboPWagG9JAE6opDQBbfN 8ODxmeiBFXk/Q9XgGNVBuHscboq5nokLQW50OKMNVTG0hqdo2SmgZwunX9KgsXy/vTYK WMxZ7BZ9UTaU9+TEsP2vtfdlzRvUVmGVVDUh/1KCokybwzUQ9ujPHjtRCkg3X2jGPJyS yO+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=kEBrFsENgcN61lOs9AAz0c8wQaRYi7TYeszZxNnhUsM=; b=Z645UHyVrs6IY3HKgoUuBczEaXgvNFxXaLVY7y+ay9AFcGndpsqBsWKWjIqFnOtLOs ThSjmJnOZD73EOG2bepEOVnbfREB+03QPt+S0JyqNkCLvKtyTRn9HrOnhRLnEqYAlxBz MsKLlpNifu0hJJ1f2m0oXEI8mxYjof+qy7/yGdvjF+ccKIF8uoWTLs0Bp5uXf1Q2rdiY 6TKVE1P/3Z333tc+6d7sUEfpxUbQb5JDxODH4DjC+o+Z4KYZlSByrY8NeeOIMyuAfUWg J0cqNJ/uUcGFtNkwUo21vZpa2IhhV42Hu6LavHKKp8ZJJDbMUGadDfCjMPJ4cKGkDE07 cAXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lrnfU3QJ; 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 h23si4972974edh.248.2019.10.18.15.09.52; Fri, 18 Oct 2019 15:10:15 -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=@gmail.com header.s=20161025 header.b=lrnfU3QJ; 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 S2394489AbfJQRsJ (ORCPT + 99 others); Thu, 17 Oct 2019 13:48:09 -0400 Received: from mail-yw1-f68.google.com ([209.85.161.68]:39465 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726754AbfJQRsI (ORCPT ); Thu, 17 Oct 2019 13:48:08 -0400 Received: by mail-yw1-f68.google.com with SMTP id k127so4282ywc.6 for ; Thu, 17 Oct 2019 10:48:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=kEBrFsENgcN61lOs9AAz0c8wQaRYi7TYeszZxNnhUsM=; b=lrnfU3QJ7otQlwWjO4pAUFcP9Ivd0EezGXjOZGgwJsaUn3vMWY0n0vZdhD/O8rwgnW UApMMVA3HxJRbEEWHpuHh0/uNk44uWdYySDwUcdqQQvfvhD5wofSacQxnzvwhxseGzIf a4XbOkOQ44NlrlXWhg65xSFMWVtxejYcxnrU3B5KpA1urKff0jXY2NkxGjGM/2PQscBn /xDJLf4bHORqiVwmDhacdSuBFM4z1p1qGu+MVuNYslsFVPbD9obU6vBFXiJRtwfaEhe4 jtdBv+evbrAlruOhvrNIwg7Ycla4ED8hMIZT7SbpueT6yf8HOE6ihSj7UyZxAZ7dhndt u2Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=kEBrFsENgcN61lOs9AAz0c8wQaRYi7TYeszZxNnhUsM=; b=Df2kqM1P/tR13t+0PR2meP3uBsoLwWExESwHX/ONsKnl9oZrN68VizA1nixDJivNbq jmT/nYC8emVld8iKfHU/kXNfhUlaWvU+lQSbDLy1KsppJJ3vDwjTb6dql3+rWAoMPH8T ZNb4VkptfJrZ4R8MOa1pSqzVr7Deq4oqE2q0nZDqz1tmBpzmgn/tWE0IHh41nieWe04G hu35kcj/38MdJSWgE/weBH7HGTW1v6mxWK87uucnDQsyNEzIDGslm/wM7l3FNzXTMcR9 g/zMrJ0js6Uf7cMEvzhVj4sc5F5sBBL+u+FeohdFhIM0nzifpXYkmnt+9hcSUrNJatHV kj/w== X-Gm-Message-State: APjAAAVFyJDLv6m2CZjXpOqvEPvqGSzo1BvfST0RKMpRVpqQ01C1XK1Q fdW32k1vTNYooP/Xmr+sjIA= X-Received: by 2002:a81:6d57:: with SMTP id i84mr3762089ywc.417.1571334487239; Thu, 17 Oct 2019 10:48:07 -0700 (PDT) Received: from [192.168.1.62] (c-73-88-245-53.hsd1.tn.comcast.net. [73.88.245.53]) by smtp.gmail.com with ESMTPSA id p10sm660977ywc.19.2019.10.17.10.48.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Oct 2019 10:48:06 -0700 (PDT) Subject: Re: [PATCH 10/10] of/device: Don't NULLify match table in of_match_device() with CONFIG_OF=n To: Stephen Boyd , linux-kernel@vger.kernel.org, Rob Herring Cc: Arnd Bergmann , Geert Uytterhoeven References: <20191004214334.149976-1-swboyd@chromium.org> <20191004214334.149976-11-swboyd@chromium.org> From: Frank Rowand Message-ID: <6ce47827-55e4-dd15-6a05-f25a2f8a8bb7@gmail.com> Date: Thu, 17 Oct 2019 12:47:59 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20191004214334.149976-11-swboyd@chromium.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > 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