From patchwork Thu Jun 1 21:31:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102197 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp627643vqr; Thu, 1 Jun 2023 14:38:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ggwAlVRaq7aYa294VH367Aew/1yhk3pCgFxPv1+hp+saQG8e9Bxc7sed9BNmlQeNPsHfJ X-Received: by 2002:a05:6a20:e185:b0:109:38b4:a210 with SMTP id ks5-20020a056a20e18500b0010938b4a210mr9407974pzb.29.1685655499646; Thu, 01 Jun 2023 14:38:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685655499; cv=none; d=google.com; s=arc-20160816; b=FLoq9HKuqB4fY+PkNOZnhY/ppgdFJfC0zFvAEs6XjxbaaGn9JrWAjbPgTVYZ50vY5C PR3JWuh4sxpSrsbLmlNNdKzb4nXhzTDqma/UUHW21ZAnU0oQAqV4hT+Mh9iuAqEZfrbh Ev5ROWlvPA/TF1nb1G6AGxlvNbJR7q0uU1ywv0UgVS4T+f9ypIP8AuQOIOU3m+gRM05a ZExqN2E4hmvt61bJegNMoIuzLHaa6i8s9gu9JVe0hY4HLkgPD/4UTYjuhdrMKzhWa5Lz vtSsfkmjC+YQUkK/RHZxlirR0gBuNhfovZ5GzQZFoixhnNXCnQFALXojcH09axEnUnqz 5jLw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=O/ndY7OADSx/OYZNFoPhaY69KG4UTmbnkoaJcUqNFdQ=; b=khJaRVlQG/p0CbSmI2lQ8ZHgmkX6EwMQJnN6SPbTCq+PYioyF5h5cvNZFhp3KLQE4U ABl4KlYvGFtvKumMaARJhVS7jzIFojJ54U7NophXxMDNKf2TSzdh35Sd5RKVYJlk3B/8 KEwiZ7zMjMJKpNkLwMNleK8Pfl2nrqc4/qOLNRgMbysdV4L7j4SGQG+8PaTFgF+Lmrjj uiruAp6vwgEjfWa2rNUCLHN3uS6snfnFSOA/fYCLp9yvPsRYfbY92D0nMHB9h45g4a6I AH3DmpNwFa6+8q4HutmDUSsH+s3bhFmP82AGyI8f80F3Wx/VDGnIQFzZOZH8Fb1K1OZH Dsdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dHow6iXj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k127-20020a628485000000b0064d41566266si5696053pfd.247.2023.06.01.14.38.03; Thu, 01 Jun 2023 14:38:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dHow6iXj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232484AbjFAVcY (ORCPT + 99 others); Thu, 1 Jun 2023 17:32:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229610AbjFAVcX (ORCPT ); Thu, 1 Jun 2023 17:32:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B00A195; Thu, 1 Jun 2023 14:32:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D490E649ED; Thu, 1 Jun 2023 21:32:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA003C433D2; Thu, 1 Jun 2023 21:32:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685655141; bh=ZayG3JtKeRHBP3Of0x1sbbjcfUFrfkdCXWyh5YaG/eA=; h=From:To:Cc:Subject:Date:From; b=dHow6iXjWYevbjQ3KEQ4bE5SmRC4qESv9PCCRjo3MZazJoiwBgDufOlI8fwXvn4Z4 HnEaxdRrvyT0N6smSTH5kxL5aL/LGmFLFe1o+h5Lf/e2G2ODOGil3HVkd1D7E8nKAQ /ssQPVfNTow/IiKVw2Mf7WGvL+AfPDov641uyqeMp4wtldDMjyjyKd9guZMJnWx2P4 jnL/lxvF5fn6Vz+1q5CxgX5+fJR+RHmfZkDRn43jY6+oTX+I3Cz323F6j9ynG3RAwq i2OSIkJdTkGYrKgTGWzaAzOcr+ztFZTiZmBeJ2cKh+6karepdZqx9jpzAfCkwgWXIe sz9CnHZ8g6Z7Q== From: Arnd Bergmann To: James Seo , Jean Delvare , Guenter Roeck Cc: Arnd Bergmann , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] hwmon: hp-wmi-sensors: fix debugfs check Date: Thu, 1 Jun 2023 23:31:54 +0200 Message-Id: <20230601213216.3220550-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767537900897793163?= X-GMAIL-MSGID: =?utf-8?q?1767537900897793163?= From: Arnd Bergmann Checking for Kconfig symbols with #if is wrong: drivers/hwmon/hp-wmi-sensors.c:1141:5: error: "CONFIG_DEBUG_FS" is not defined, evaluates to 0 [-Werror=undef] This could be an #ifdef, but an IS_ENABLED() check is even better to give the best compile coverage. Fixes: 602bef0fa281f ("hwmon: add HP WMI Sensors driver") Signed-off-by: Arnd Bergmann Acked-by: James Seo --- drivers/hwmon/hp-wmi-sensors.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/hwmon/hp-wmi-sensors.c b/drivers/hwmon/hp-wmi-sensors.c index 7218945bd03fc..ebe2fb5134805 100644 --- a/drivers/hwmon/hp-wmi-sensors.c +++ b/drivers/hwmon/hp-wmi-sensors.c @@ -1138,8 +1138,6 @@ static int hp_wmi_update_info(struct hp_wmi_sensors *state, return ret; } -#if CONFIG_DEBUG_FS - static int basic_string_show(struct seq_file *seqf, void *ignored) { const char *str = seqf->private; @@ -1341,16 +1339,6 @@ static void hp_wmi_debugfs_init(struct device *dev, struct hp_wmi_info *info, } } -#else - -static void hp_wmi_debugfs_init(struct device *dev, struct hp_wmi_info *info, - struct hp_wmi_platform_events *pevents, - u8 icount, u8 pcount, bool is_new) -{ -} - -#endif - static umode_t hp_wmi_hwmon_is_visible(const void *drvdata, enum hwmon_sensor_types type, u32 attr, int channel) @@ -1959,7 +1947,8 @@ static int hp_wmi_sensors_init(struct hp_wmi_sensors *state) if (err) return err; - hp_wmi_debugfs_init(dev, info, pevents, icount, pcount, is_new); + if (IS_ENABLED(CONFIG_DEBUG_FS)) + hp_wmi_debugfs_init(dev, info, pevents, icount, pcount, is_new); if (!count) return 0; /* No connected sensors; debugfs only. */