Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1528942pxb; Fri, 22 Jan 2021 19:51:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxpo6zgHVDZryaulPEZs7Ifw6KFEfRy3RRPaS22J5rkVz6vgDLGinRzrtVk+uahOWjrh+gC X-Received: by 2002:a17:906:4893:: with SMTP id v19mr415217ejq.454.1611373884032; Fri, 22 Jan 2021 19:51:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611373884; cv=none; d=google.com; s=arc-20160816; b=UeeIx+fdthJEuSXX2Z7wFIM0k3G6rDOL/bPnEHo+E34SsSK/WhBr2w7wFKdoUWRXl/ kaIfnbQayH+hQNZpbPV/A8Kx9C7A2ZoIfiw/gPK9/fWo8z+DT2i9yZJF2zAToSZEHDgv 4IU3RCWwLHS59BxGDUHyZDqxqCft/lk1WB/tcolngi9OoYWPK4eXlr/FHncNE2IeXelz mFaKUY9JltHVw2Uq0WWLoKIjfQD5DKTVbwfLABx0hS5Xxrr483Akj5Wr1YjmIOVdiDeS uNZaTOEz37jbgrI+nFAzVufFdGkqGpegK+2gREZLEZq2R9DRZ0HIh+xI5nSV75qfz2ue USwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qzVpWEoynH6taGK1dmEKcfhSuX1O4pYnplDljz5JhnI=; b=f/e/TV6aXmMLfky94tIMn0B1xy/tot1QstXPCEHaoHUmxos2jDbr5nqIReqld7aVA5 wH8kon3a+SKi7zjagmh5LZRsFbYhTl9j5iwZvYvl2mHtRoBC56DPh11p5MheM3qfx1io gLwdzniKDyMpy+dZMEZROknjY38BQA5K+7T4JUdSez4m2FVMTLv9D7kIrvgEzKjWl6L6 pUQ1ytRIWlgTJP1KhXUBbNmaQjKv7WzBaFVlXXxRfr/+GmDF0e0fTNyI1l2bIwwFmULi 8AwUChkyrBTZF9Wn0lDaK4KnBMkTBDOkIXN6Vh37mPXtyUfnyqknJGZ4Boo+TjEL+U06 p/FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZDnQTJDK; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bz4si3610691ejc.132.2021.01.22.19.51.00; Fri, 22 Jan 2021 19:51:24 -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; dkim=pass header.i=@chromium.org header.s=google header.b=ZDnQTJDK; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726961AbhAWDrI (ORCPT + 99 others); Fri, 22 Jan 2021 22:47:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726893AbhAWDqj (ORCPT ); Fri, 22 Jan 2021 22:46:39 -0500 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 274B6C061226 for ; Fri, 22 Jan 2021 19:44:41 -0800 (PST) Received: by mail-pl1-x630.google.com with SMTP id e9so4402814plh.3 for ; Fri, 22 Jan 2021 19:44:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qzVpWEoynH6taGK1dmEKcfhSuX1O4pYnplDljz5JhnI=; b=ZDnQTJDKNyO1AQ1cRjQ8PqkniCuIk/RpUwCJ6AHBruosIDFTH0frYO+JZrs4uL9C6S HkMKzgBAA92GE1iFaM7x6HOWIzqr3cb9Qe2kLqnc4QzX5aKrrSZpUhaaNMSHRl3I9x8Q 6A5o05k28QJYoGYkL4msES1sKDXAfW9YklUY4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qzVpWEoynH6taGK1dmEKcfhSuX1O4pYnplDljz5JhnI=; b=DTITDjDBuBiN5xTFHYBAUJbBvWUzGyehtzelaTUx6Bhko5orF1ZSqEacSozuGdf2Pb zxUvv5VtxEZzK8nJZGtDMBOu0vDTbPf2TfrsfZjHHsrFo6N0yGcNj/r0uHJ1Ut3VeEUH qcQWwkvBD34KPOKMPOENiiwTxPGGRHeYR8VjaXQS5wAN0QVJx06/iEjXjwF7CRZqUMCT YizDqXHEroj3VDc+NQj5YNu94NJ7liKK1zBXhTiAvh3206RsdDhy//Z+q36ZOIz7MnkW UGJtSdW30yZs9rfReNaVw+M0QASLoFfErtkhKl/JqGzZmKY+EHQDOcxdta5Uhi90RTba UNQQ== X-Gm-Message-State: AOAM53219yEPx99Cs3tCCe1D/s8WzC+hgD7NH3yvLtL4u6jL5X5mK4tL wFbGfY6mEcO8yOHIQT9wC9qxVw== X-Received: by 2002:a17:90a:1c09:: with SMTP id s9mr9066942pjs.83.1611373480787; Fri, 22 Jan 2021 19:44:40 -0800 (PST) Received: from smtp.gmail.com ([2620:15c:202:201:3e52:82ff:fe6c:83ab]) by smtp.gmail.com with ESMTPSA id gf23sm10480343pjb.42.2021.01.22.19.44.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jan 2021 19:44:40 -0800 (PST) From: Stephen Boyd To: Rob Herring Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Frank Rowand , Arnd Bergmann , Geert Uytterhoeven , Rob Herring Subject: [PATCH v2 6/6] of/device: Don't NULLify match table in of_match_device() with CONFIG_OF=n Date: Fri, 22 Jan 2021 19:44:28 -0800 Message-Id: <20210123034428.2841052-7-swboyd@chromium.org> X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog In-Reply-To: <20210123034428.2841052-1-swboyd@chromium.org> References: <20210123034428.2841052-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Stephen Boyd Acked-by: Frank Rowand Cc: Arnd Bergmann Cc: Geert Uytterhoeven Cc: Rob Herring Cc: Frank Rowand --- Please ack so Rob can apply. 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 07ca187fc5e4..937f32f6aecb 100644 --- a/include/linux/of_device.h +++ b/include/linux/of_device.h @@ -99,13 +99,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) { -- https://chromeos.dev