From patchwork Tue Nov 20 23:16:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 10691231 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F088C1923 for ; Tue, 20 Nov 2018 21:21:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DEFDE2A9AC for ; Tue, 20 Nov 2018 21:21:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D32F32A9AF; Tue, 20 Nov 2018 21:21:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B2932A9AC for ; Tue, 20 Nov 2018 21:21:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726554AbeKUHwp (ORCPT ); Wed, 21 Nov 2018 02:52:45 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:47858 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725828AbeKUHwp (ORCPT ); Wed, 21 Nov 2018 02:52:45 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from vadimp@mellanox.com) with ESMTPS (AES256-SHA encrypted); 20 Nov 2018 23:27:15 +0200 Received: from r-mgtswh-226.mtr.labs.mlnx. (r-mgtswh-226.mtr.labs.mlnx [10.209.1.51]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id wAKLLWaW001078; Tue, 20 Nov 2018 23:21:32 +0200 From: Vadim Pasternak To: linux@roeck-us.net Cc: linux-hwmon@vger.kernel.org, michaelsh@mellanox.com, Vadim Pasternak Subject: [PATCH hwmon-next v1 1/1] hwmon: (mlxreg-fan) Modify macros for tachometer fault status reading Date: Tue, 20 Nov 2018 23:16:36 +0000 Message-Id: <1542755796-70329-1-git-send-email-vadimp@mellanox.com> X-Mailer: git-send-email 2.1.4 Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Modify macros for tachometer fault status reading for making it more simple and clear. Signed-off-by: Vadim Pasternak --- drivers/hwmon/mlxreg-fan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/mlxreg-fan.c b/drivers/hwmon/mlxreg-fan.c index d8fa4be..db8c6de 100644 --- a/drivers/hwmon/mlxreg-fan.c +++ b/drivers/hwmon/mlxreg-fan.c @@ -51,7 +51,7 @@ */ #define MLXREG_FAN_GET_RPM(rval, d, s) (DIV_ROUND_CLOSEST(15000000 * 100, \ ((rval) + (s)) * (d))) -#define MLXREG_FAN_GET_FAULT(val, mask) (!((val) ^ (mask))) +#define MLXREG_FAN_GET_FAULT(val, mask) ((val) == (mask)) #define MLXREG_FAN_PWM_DUTY2STATE(duty) (DIV_ROUND_CLOSEST((duty) * \ MLXREG_FAN_MAX_STATE, \ MLXREG_FAN_MAX_DUTY))