From patchwork Mon Oct 10 11:12:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101713 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp1149734qge; Mon, 10 Oct 2016 04:14:21 -0700 (PDT) X-Received: by 10.157.56.179 with SMTP id p48mr17003180otc.22.1476098061633; Mon, 10 Oct 2016 04:14:21 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j31si9102481ote.55.2016.10.10.04.14.21; Mon, 10 Oct 2016 04:14:21 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751640AbcJJLOL (ORCPT + 27 others); Mon, 10 Oct 2016 07:14:11 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:62468 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751423AbcJJLOJ (ORCPT ); Mon, 10 Oct 2016 07:14:09 -0400 Received: from wuerfel.lan. ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue001) with ESMTPA (Nemesis) id 0MNyjT-1bm7Te0Fad-007RqS; Mon, 10 Oct 2016 13:13:37 +0200 From: Arnd Bergmann To: Darren Hart Cc: Greg Kroah-Hartman , Andy Shevchenko , Rajneesh Bhardwaj , Darren Hart , Nicolai Stange , Arnd Bergmann , Vishwanath Somayaji , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] intel_pmc_core: avoid boot time warning for !CONFIG_DEBUGFS_FS Date: Mon, 10 Oct 2016 13:12:58 +0200 Message-Id: <20161010111313.119658-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161010111313.119658-1-arnd@arndb.de> References: <20161010111313.119658-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K0:Opb8FXeH1o4bQc95vYomiGHMAX7v89aYNzAe421kXKsLykbNyl/ oBMczH4BysoEZk+LRCykcjgl4I7YyfhZebjE0D+daNdHDV7ZsaQGZNBHmNOMalLStP/Hvia XAxvaUJ88Z4iZP0QNjG11Q3KAZsz47Q7QOczM6LjfL/c/as+7/wI2k3IBSDnPMqJ4td9dq1 2ePjj1E9X6ARGTUdOu7gA== X-UI-Out-Filterresults: notjunk:1; V01:K0:vtiGckOYNDQ=:ag5wL3aguHn5dk8oKjlARx cDasNH7kjrCDdEUMBLDJTMSjvbS7ZHLAphPSg7BCd8pDGKcoPAbcyMMjnnWfis+uMUERZPpSr mtANXOst2uqWirMAev06bSasGfX3bcxZVHAwuf1nEF5GczTrvcAE/GbTKFAO0dfy7pF2qNGUF xJ3U1+V6iEkUZWOv5OzxsTzDBr9my7hpq8VPcBLjY7yaLClPJmyD97tooK6cDE3wehWUVOsX7 kRBrd/KPWdE4i1j4QkX4Q1nQsllZB6kkjmTZLNtLtUKK7Rzagmlv4VgWInnytZ76riZozEUOG sE3RO4NafYsm6G1quWao7XBFblDClXz8qSBTmBbnxCu0k8ItVwm6NRDABbPy82nIqb2lq5Peq VFZbRyHQ7Mn8tvMD+TEFX+jA5zHUL0g9aQUhm8kZqGRhY3fB5O8HR3VpinZexvmcWqM892B/y 4mCPdBytyZOCO1d1DOptPTtCMUvn4C+k97AqybPXEJs63aZRfOmOW1BYLqMq8nqiNGhcW9fav J3W7PQ3iTMO9FGYoA9tq6DUe7/FBfjYvgrTLr+WmzddK1d5WiVf+7TAbGMAWtEZOu5HndRtJl dc4X52ZH/cPQB/8GXkZQNrtr3upq+IG2k3d0/K92t0TCTv0lIGNb+oVBY1yLmOirC4NxRzx0K +YWDcUgNSzRZSObVHNdp4g+QNOEZTGuHhkBq+Jdew/e9lwFDTGfYRrFEpV7sIzUNfHlHDX4Et FFG3rSi1k6JxGMDF Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While looking at a patch that introduced a compile-time warning "‘pmc_core_dev_state_get’ defined but not used" (I sent a patch for debugfs to fix it), I noticed that the same patch caused it in intel_pmc_core also introduced a bogus run-time warning: "PMC Core: debugfs register failed". The problem is the IS_ERR_OR_NULL() check that as usual gets things wrong: when CONFIG_DEBUGFS_FS is disabled, debugfs_create_dir() fails with an error code, and we don't need to warn about it, unlike the case in which it returns NULL. This reverts the driver to the previous state of not warning about CONFIG_DEBUGFS_FS being disabled. I chose not to restore the driver to making a runtime error in debugfs fatal in pmc_core_probe(). Fixes: df2294fb6428 ("intel_pmc_core: Convert to DEFINE_DEBUGFS_ATTRIBUTE") Signed-off-by: Arnd Bergmann --- drivers/platform/x86/intel_pmc_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/drivers/platform/x86/intel_pmc_core.c b/drivers/platform/x86/intel_pmc_core.c index 520b58a04daa..e8b1b836ca2d 100644 --- a/drivers/platform/x86/intel_pmc_core.c +++ b/drivers/platform/x86/intel_pmc_core.c @@ -100,7 +100,7 @@ static int pmc_core_dbgfs_register(struct pmc_dev *pmcdev) struct dentry *dir, *file; dir = debugfs_create_dir("pmc_core", NULL); - if (IS_ERR_OR_NULL(dir)) + if (!dir) return -ENOMEM; pmcdev->dbgfs_dir = dir;