Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3876388imu; Mon, 28 Jan 2019 12:28:54 -0800 (PST) X-Google-Smtp-Source: ALg8bN7YvdM+Ye047P2BT8fBAXR3kTG+smjZHh60fwSLPgMabFPA9pwjlG8XVoZ8oomj1juEJ+ra X-Received: by 2002:a17:902:714c:: with SMTP id u12mr22946620plm.234.1548707334809; Mon, 28 Jan 2019 12:28:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548707334; cv=none; d=google.com; s=arc-20160816; b=Ga23c6lQTBgTHkcrV8LLxEhdTomrhpzi+UtPyrCl2AEcz/MRFSosibVuNthwTV5Ump Oo3z1PIGJrBnJn0xaiDl+7hQw4tiWdjGSz+dyLE6Omd05hMvUJ/gAUcCOQNzc6qDu4a1 3VAagA+wIuasFkSIZpO58WEn4J7i1Y53IhGw33U3wv3B8R/LuqTGAC8NY2LCQLh/IOF+ bDv5FjGCAYnG7x4h6JrQ29LbSKpZY+EHLYCdGOoPhuyxBT+qkSErcmC7WjD64+AncYCW khnEjvtzmi6r/VckwG3K8UFknrN6XydKLf8csOd2qYIrj5ne9XxElLz9GTziKw4iHyBU WbZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date; bh=E38TSMvLCLiqLo8VP+YDP6HewZO6QU2+7865AesuK1M=; b=P1X50/FkXn4eYIpi7uFH5Bs9vyF5qjsPHNg7e++8xg3iV91/ytYbMu+VWYK5d0w6t/ /Ae2Iwj3C+333Lqec7sN8ieaK+tt8pTfkkG2iSyZHb1oAmGRGZskwfOQ1QesIRYQRkCA O28N2dkx6cImCT86+1oLB4Ukxd1IaNTEtRKGfan7rAvU1jFe3kfgvmlrW2CNyWfoGMwv Q3Ni5sjlvcsfU3z7v1KLE9Ts0egZ+O6im4Z98D1YHK4vhdmiYUWf3d54jPkYsSETOUZ8 T02a19dmSNQq4QIALsUOBXA3GUf/jCD4h3YEwuUXgv4jFoYY3jGzvt8G1fHytxjNqYp1 qaJA== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v10si5596086pgt.343.2019.01.28.12.28.38; Mon, 28 Jan 2019 12:28:54 -0800 (PST) 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 S1727593AbfA1U1u (ORCPT + 99 others); Mon, 28 Jan 2019 15:27:50 -0500 Received: from mx0b-002e3701.pphosted.com ([148.163.143.35]:44542 "EHLO mx0b-002e3701.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726719AbfA1U1u (ORCPT ); Mon, 28 Jan 2019 15:27:50 -0500 Received: from pps.filterd (m0134423.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x0SKQbXw014900; Mon, 28 Jan 2019 20:27:01 GMT Received: from g4t3427.houston.hpe.com (g4t3427.houston.hpe.com [15.241.140.73]) by mx0b-002e3701.pphosted.com with ESMTP id 2qa7xcrcpp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Jan 2019 20:27:00 +0000 Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g4t3427.houston.hpe.com (Postfix) with ESMTP id 5DC405C; Mon, 28 Jan 2019 20:26:59 +0000 (UTC) Received: from anatevka (anatevka.americas.hpqcorp.net [10.34.81.61]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id 90D224A; Mon, 28 Jan 2019 20:26:56 +0000 (UTC) Date: Mon, 28 Jan 2019 13:26:56 -0700 From: Jerry Hoemann To: Guenter Roeck Cc: Matti Vaittinen , mazziesaccount@gmail.com, heikki.haikola@fi.rohmeurope.com, mikko.mutanen@fi.rohmeurope.com, lee.jones@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, broonie@kernel.org, gregkh@linuxfoundation.org, rafael@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, linus.walleij@linaro.org, bgolaszewski@baylibre.com, sre@kernel.org, lgirdwood@gmail.com, a.zummo@towertech.it, alexandre.belloni@bootlin.com, wim@linux-watchdog.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, linux-watchdog@vger.kernel.org Subject: Re: [RFC PATCH v2 08/10] rtc: bd70528: Initial support for ROHM bd70528 RTC Message-ID: <20190128202656.GA17466@anatevka> Reply-To: Jerry.Hoemann@hpe.com References: <20190125110536.GA29321@localhost.localdomain> <35bbc5b9-5f8c-ec80-3eaa-bb2c0e2812c9@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <35bbc5b9-5f8c-ec80-3eaa-bb2c0e2812c9@roeck-us.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-28_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=771 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901280152 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 26, 2019 at 08:30:24AM -0800, Guenter Roeck wrote: > On 1/25/19 3:05 AM, Matti Vaittinen wrote: > > +static int bd70528_set_wake(struct bd70528 *bd70528, > > + int enable, int *old_state) > > +{ > > + int ret; > > + unsigned int ctrl_reg; > > + > > + ret = regmap_read(bd70528->chip.regmap, BD70528_REG_WAKE_EN, &ctrl_reg); > > + if (ret) > > + return ret; > > + > > + if (old_state) { > > + if (ctrl_reg & BD70528_MASK_WAKE_EN) > > + *old_state |= BD70528_WAKE_STATE_BIT; > > + else > > + *old_state &= ~BD70528_WAKE_STATE_BIT; > > + > > + if ((!enable) == (!(*old_state & BD70528_WAKE_STATE_BIT))) > > + return 0; > > I think > if (enable == !!(*old_state & BD70528_WAKE_STATE_BIT)) > would be much better readable. Even if not, there are way too many () > in the above conditional. > The substitution is not equivalent to original. I think you mean: if (!!enable == !!(*old_state & BD70528_WAKE_STATE_BIT)) -- ----------------------------------------------------------------------------- Jerry Hoemann Software Engineer Hewlett Packard Enterprise -----------------------------------------------------------------------------