From patchwork Thu Jun 30 13:51:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 9207681 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E9DA160752 for ; Thu, 30 Jun 2016 13:51:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBFDB285BA for ; Thu, 30 Jun 2016 13:51:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0A8328673; Thu, 30 Jun 2016 13:51:50 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 8723B285BA for ; Thu, 30 Jun 2016 13:51:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752085AbcF3NvU (ORCPT ); Thu, 30 Jun 2016 09:51:20 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:41401 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932120AbcF3NvR (ORCPT ); Thu, 30 Jun 2016 09:51:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=References:In-Reply-To:Message-Id:Date:Subject: Cc:To:From; bh=lCc4mV2vvvBEINhGACk9XcbPOxFgUTpmrd1JFnh8ci4=; b=RXtvTcPbs4TIxk 8XKxVqwZrIHsAs17tk1sioftjTrlG+M8i1HPF/Ec20Mrdt2quaeDEoPyAtAEe0GI7IPyD/4MXZ4x0 7W88lSQDhBYow3GB+Hjz3TZRg3DfNcVgg4+2WTYy5ssGu3Vv6sL9H+dWmBwB/5t9RPdvoatfI8W99 0yB0tHn5iQAEp1uyqLnStoPt82QyoXpy+IkW2qWpBE5P3/sAS/sxgbeWIwFW79jbi5dqSVaZvuJBx D9p3OSLes8LfkuD02eD0UBpkOY76rMD8HnfhheMO5HcHlFYlZVZAXW4uv5x6UHzvTX2L2wrxSDXB8 5AgNhI7WB7TT4JNE52Mw==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:56876 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1bIcN3-002zqa-Gf; Thu, 30 Jun 2016 13:51:09 +0000 From: Guenter Roeck To: Jean Delvare Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck Subject: [PATCH 5/6] hwmon: (lm90) Use bool for valid flag Date: Thu, 30 Jun 2016 06:51:00 -0700 Message-Id: <1467294661-23879-5-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1467294661-23879-1-git-send-email-linux@roeck-us.net> References: <1467294661-23879-1-git-send-email-linux@roeck-us.net> X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: 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 Use bool for valid flag and leave it up to the compiler to find an optimal representation. Signed-off-by: Guenter Roeck --- drivers/hwmon/lm90.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index 322a73d3d135..c38d6e4e95b5 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c @@ -367,7 +367,7 @@ struct lm90_data { struct i2c_client *client; const struct attribute_group *groups[6]; struct mutex update_lock; - char valid; /* zero until following fields are valid */ + bool valid; /* true if register values are valid */ unsigned long last_updated; /* in jiffies */ int kind; u32 flags; @@ -624,7 +624,7 @@ static struct lm90_data *lm90_update_device(struct device *dev) if (time_after(jiffies, next_update) || !data->valid) { dev_dbg(&client->dev, "Updating lm90 data.\n"); - data->valid = 0; + data->valid = false; val = lm90_read_reg(client, LM90_REG_R_LOCAL_LOW); if (val < 0) @@ -697,7 +697,7 @@ static struct lm90_data *lm90_update_device(struct device *dev) } data->last_updated = jiffies; - data->valid = 1; + data->valid = true; } error: