Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1423451ybp; Fri, 4 Oct 2019 14:44:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqyj2clSKTIuc4+14t6/BzIa8Gph1wAc5SRrxmt3UOCOx5QRAnAx0NVJdUq2Iyu9pHtfs+yt X-Received: by 2002:a05:6402:782:: with SMTP id d2mr17476629edy.296.1570225468198; Fri, 04 Oct 2019 14:44:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570225468; cv=none; d=google.com; s=arc-20160816; b=L+KHXUhKnApBgadp3KkB8QhEjNsDYzXpi165jBSYEdnHkg6NN8mfqM1DNzcsKiPESK 2Fe1xJd1PThje71tC6IPm2N278FFu7HA2GVzmAaiRwBxGspelWjRcAU3keY61l/QJVpA Q9sQ4BIdUaWjHys+DXI+9XzDXLEe2QgFjmIMp5Rflb+QD1/CdQh8Rvvc1C7U1Exe6k0e 4V1dKrgdB7VnCoINvJ2jynWZRkDAmdwyvDVRK75D2MNgW5SHBYOBRWs4lIvDjWZnoGVh sgRYeWlZyznO5cXp7JNGE1eIDhOtaEskywr4eaWop+K1n/nz6XHgPfMV19j1Xoso+RFu Qxkg== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=U687kcs42BoDsE/q/6DCWOZs4StRfj7ND2JiKRPjwLU=; b=nOBtf2RPkWxsl+GkEuTo/aQFQQ5wpx7lFpQlEiE8GoDgCc6aoun01lNsBs/slSCoj0 4nTqLrMl+WI6h+wkJ9FD5+Wj4/0GYqd9o+5kzMFaY4XdumOX3p0YRWyJuoJWAQWK3u+e reFllqFCBvYuxAlpeVKorN3EWEb5TEcPPSgW4oQ/KF2m2VMOtZMtlfRcwPWENHHHyFG7 hoE8LLSDtt9GjH9YC++8LPtPKhvjF+uPehJzJzzAdGCrem5A4vCtx/Kss2lpOI7rJM3o JOGElanCilD2fFtC/Rke7Xv0VikdRv4yJ2A7M0z1TSuncQcd/E25LQ/LUFPu+bKlBbs2 yBLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="cWdi/ApP"; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k39si4185082edb.52.2019.10.04.14.44.05; Fri, 04 Oct 2019 14:44:28 -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=@chromium.org header.s=google header.b="cWdi/ApP"; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728809AbfJDVnr (ORCPT + 99 others); Fri, 4 Oct 2019 17:43:47 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:46255 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731333AbfJDVnq (ORCPT ); Fri, 4 Oct 2019 17:43:46 -0400 Received: by mail-pg1-f193.google.com with SMTP id a3so4444738pgm.13 for ; Fri, 04 Oct 2019 14:43:46 -0700 (PDT) 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=U687kcs42BoDsE/q/6DCWOZs4StRfj7ND2JiKRPjwLU=; b=cWdi/ApPfxI7Bo65buQpCZ4N3rNLjP83vRSk0AWnM/jnreA8jzFvvW9MLqK0XY2pPa 0cy8ye3wi1DxCULqrnaJ/8zVot2CmrvzDewSixLDwg6+ip/B/Z7Pvk+RKPQZ9Lkp9O2s FBDrGVIk5nbcHdEoCwkPjuLc+/9mx2tZ/ujLg= 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=U687kcs42BoDsE/q/6DCWOZs4StRfj7ND2JiKRPjwLU=; b=eurc78MMv3wi1NIr7V58gLOYT6CfrwqMukBy7Wd4vacsvjMZEPUuSJ5P3RUN0z5Tu1 GeIWDAPZLgjLxHnTFnQbttCSnB0mUM4a1AS7DxXv6v+9FShtVMvYTYsa2CqSapOJxelT DD/G4HdJd+3FGKnf7fTyy+u7u4Nc9vaZqtal0ttyUOuDY44vMM9IJor/3uNF4mbEueQA 6uCgZ6/cm72/NjwQBNcOvB+6Apsbx2YYgdfIbasQkXIlDPmqLzFsjM7aUIKJ+7b1wvpG eEMhYl+CXeE3/s2yIoDEzn0rDDmfgft8QchCZ2YaIZp2QMVDOVP5odYK/TbxsxfxM02O /IAQ== X-Gm-Message-State: APjAAAUlxAl8kdPDjotOmmZ6h2gg49T+uEixkTaZruF24hIQqD/lFrUQ HUYcuIbOQQDBe8RMXrA/etWNXjgvh1o= X-Received: by 2002:a63:ea16:: with SMTP id c22mr12828948pgi.162.1570225425617; Fri, 04 Oct 2019 14:43:45 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id a11sm10446799pfg.94.2019.10.04.14.43.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2019 14:43:45 -0700 (PDT) From: Stephen Boyd To: linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Geert Uytterhoeven , Rob Herring , Frank Rowand Subject: [PATCH 10/10] of/device: Don't NULLify match table in of_match_device() with CONFIG_OF=n Date: Fri, 4 Oct 2019 14:43:34 -0700 Message-Id: <20191004214334.149976-11-swboyd@chromium.org> X-Mailer: git-send-email 2.23.0.581.g78d2f28ef7-goog In-Reply-To: <20191004214334.149976-1-swboyd@chromium.org> References: <20191004214334.149976-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org 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. 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) { -- Sent by a computer through tubes