Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp812701ybv; Sat, 22 Feb 2020 15:57:02 -0800 (PST) X-Google-Smtp-Source: APXvYqzPC1vA3mQQ0RpoHEjL1BVslJqIMhz+D65ujwSj71W2GpTKZLTtrgvGoXcj5FaHCsfXVPaZ X-Received: by 2002:aca:c415:: with SMTP id u21mr7727073oif.49.1582415822233; Sat, 22 Feb 2020 15:57:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582415822; cv=none; d=google.com; s=arc-20160816; b=Vkkfeug7S394jZlRYb+NIgqyFwwHDZhhb79MqCpjp8yu5zvlUfTDAua+IfdpbRWeQr evdUGs5NgdbyaD39vrWozwfeT4JiVGvk+GO6F0Zt0vu5Di2S7BjILfDQds/gGw9Uyy5G RMfBUsk/45ilkcttCgkNjH6F80uXrW8uYEJwFAzMyzxQZrGqOcUgbNoT8YzsShmG816r +uhQybDOCzmzX/YCZi+NPoYPpzSY5VkvE4tjagOpsp6ERk3yogHZr6ltXqOXpNi6PE5z RXT78MONFtgp3xqZPv9Rijl5kcagO+p5xPhkU45GIh+iA8xwr1K9aK7guIeWUlxAXypb ocpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=4z+LL2/0CYlqeLC+nZHaKqyuy1CPJ8K3VkL+Wmzwbp8=; b=p3s2x82nI78NMJJlZzszl0hTzXxQJUwIzSJZqx4rPKcdvA8x/xeirvz7fK7QSUJLTt 0JCS4xd/Ta7fLHVuyAxHrYEuwKpp3fW+qEkLgbdeijDdT/TvOAtyCjiuIvlQTblxHX9E UQl4PjVpm56vbM7EGYwKw7Kd68hRe9hjpDmy2cZ3tw0GLJqPkaNtnWy0pSiH52Lt+YWn RogRRqfjQfIuJygkMuBaawEA+C7G6sRcwCh8uaKXL0BbkABxQj0Mmo8mojU/W7kT5FtK ATxQrFEGIXlhMeSywQa+Hje/7LlapMrWSXcWnuj2nZ/HHRVP73AgSRz4WIpepYGeUp8T BJ5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=g2zvgk8I; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h139si2792286oib.85.2020.02.22.15.56.49; Sat, 22 Feb 2020 15:57:02 -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; dkim=pass header.i=@megous.com header.s=mail header.b=g2zvgk8I; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726934AbgBVX4j (ORCPT + 99 others); Sat, 22 Feb 2020 18:56:39 -0500 Received: from vps.xff.cz ([195.181.215.36]:34472 "EHLO vps.xff.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726865AbgBVX4j (ORCPT ); Sat, 22 Feb 2020 18:56:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1582415797; bh=Z0fPjO8jsO2oUugd17bHa+NgwK2dmd50V02phNLazzM=; h=From:To:Cc:Subject:Date:From; b=g2zvgk8I4Vpz/PChFCmCGcei6LrRslRB6G1IKUciqWxbzc3Wq/EYI5/7RNWXiViYt vYid2e+SGO0W3js/ypWYe/bmIe8uPIDW/DGUcHgYnPg0sbwk3Y+GdEBeFWT1jYT8A6 YDL7PP1DJMUeiHDnkehwc9EMlDnNWOmfUdKLYIwo= From: Ondrej Jirman To: linux-sunxi@googlegroups.com Cc: Ondrej Jirman , Liam Girdwood , Mark Brown , Chen-Yu Tsai , linux-kernel@vger.kernel.org (open list:VOLTAGE AND CURRENT REGULATOR FRAMEWORK) Subject: [PATCH] regulator: axp20x: Fix misleading use of negation Date: Sun, 23 Feb 2020 00:56:34 +0100 Message-Id: <20200222235634.243805-1-megous@megous.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It works incidentally, because AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN is non-zero, but the false branch value really should be just 0. Signed-off-by: Ondrej Jirman --- drivers/regulator/axp20x-regulator.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c index 16f0c85700360..1e6eb5b1f8d85 100644 --- a/drivers/regulator/axp20x-regulator.c +++ b/drivers/regulator/axp20x-regulator.c @@ -381,8 +381,7 @@ static int axp20x_set_ramp_delay(struct regulator_dev *rdev, int ramp) mask = AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_RATE_MASK | AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN_MASK; enable = (ramp > 0) ? - AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN : - !AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN; + AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN : 0; break; } @@ -393,8 +392,7 @@ static int axp20x_set_ramp_delay(struct regulator_dev *rdev, int ramp) mask = AXP20X_DCDC2_LDO3_V_RAMP_LDO3_RATE_MASK | AXP20X_DCDC2_LDO3_V_RAMP_LDO3_EN_MASK; enable = (ramp > 0) ? - AXP20X_DCDC2_LDO3_V_RAMP_LDO3_EN : - !AXP20X_DCDC2_LDO3_V_RAMP_LDO3_EN; + AXP20X_DCDC2_LDO3_V_RAMP_LDO3_EN : 0; break; } -- 2.25.1