From patchwork Mon Feb 29 21:15:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loc Ho X-Patchwork-Id: 8458361 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1F0C29F52D for ; Mon, 29 Feb 2016 21:17:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3B9122021B for ; Mon, 29 Feb 2016 21:17:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 56628201FA for ; Mon, 29 Feb 2016 21:17:52 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aaVAv-0007JB-91; Mon, 29 Feb 2016 21:16:17 +0000 Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aaVAs-0007Es-Gg for linux-arm-kernel@lists.infradead.org; Mon, 29 Feb 2016 21:16:15 +0000 Received: by mail-pa0-x22f.google.com with SMTP id fy10so98232156pac.1 for ; Mon, 29 Feb 2016 13:15:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apm.com; s=apm; h=from:to:cc:subject:date:message-id; bh=Oq7S1DBiYRATa2kAoWGPlWE2XNzVJvHyfeyuM8i4x8Q=; b=sQ8AgVhxjtnJ0lB6UpH828zuJICMkyN/LfXfCa6cCUcd+nENi5n2X910QAlIGnWAiv EJCdVoMVJe3w1AD3jGRpmR8Y3/F38Yp0jEYVqKdVHTLqnwcQ85r+3KI1e2UXn+PtkpZd OCcBG4ofCGkQbJKj2W3wA+H0hHtT+Y1FzVW5I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Oq7S1DBiYRATa2kAoWGPlWE2XNzVJvHyfeyuM8i4x8Q=; b=HOasXoQrBwaj2FOTEg5hy1DHQx8sKNyLQXkSE17ti4e6khz13o39hl3JCH2zupOGkA no2Y/uS+T4ewV+RUxNNCPzZMbvJaAh9zo7aog6DyqaY8e2A9tussM6pBWOfaKktKKXWK cPeBRqiUhbEP6vcdAhHto8+c4S7ZiiH9u8V9rJRG1dvFxkQeukVG7Xk9UEH4cdCKRsoa RoolJ7FbUXYdw2fyAF+I4HOfW+N+ffPBoTZQ4vYnwTeXHp6xXzLeg1U8Wh25iGctUKjB pjpF7W8KmuhiCaAnUihL6GzBeg2WBu+gSMtS0ZFIUQVTsfT+rJ61wJogQ00MgpxFfvz3 PEJQ== X-Gm-Message-State: AD7BkJIUpBuPDX2bx+GWrNmmFYa1dWiocd+hqc3LQbUN1D4+PcCjdBGEEUYHxz/YA7cCjfJf X-Received: by 10.67.4.1 with SMTP id ca1mr24639265pad.7.1456780552439; Mon, 29 Feb 2016 13:15:52 -0800 (PST) Received: from localhost.localdomain ([198.137.200.11]) by smtp.gmail.com with ESMTPSA id g10sm40164353pfd.92.2016.02.29.13.15.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Feb 2016 13:15:50 -0800 (PST) From: Loc Ho To: mturquette@baylibre.com, sboyd@codeaurora.org Subject: [PATCH] clk: xgene: Add missing parenthesis when clearing divider value Date: Mon, 29 Feb 2016 14:15:43 -0700 Message-Id: <1456780543-13770-1-git-send-email-lho@apm.com> X-Mailer: git-send-email 1.7.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160229_131614_650558_9E7F152F X-CRM114-Status: GOOD ( 12.26 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: luis.henriques@canonical.com, kamal@canonical.com, patches@apm.com, Loc Ho , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In the initial fix for non-zero divider shift value, the parenthesis was missing after the negate operation. This patch adds the required parenthesis. Otherwise, lower bits may be cleared unintentionally. Signed-off-by: Loc Ho Acked-by: Toan Le --- drivers/clk/clk-xgene.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk-xgene.c b/drivers/clk/clk-xgene.c index bd7156b..d73450b 100644 --- a/drivers/clk/clk-xgene.c +++ b/drivers/clk/clk-xgene.c @@ -376,8 +376,8 @@ static int xgene_clk_set_rate(struct clk_hw *hw, unsigned long rate, /* Set new divider */ data = xgene_clk_read(pclk->param.divider_reg + pclk->param.reg_divider_offset); - data &= ~((1 << pclk->param.reg_divider_width) - 1) - << pclk->param.reg_divider_shift; + data &= ~(((1 << pclk->param.reg_divider_width) - 1) + << pclk->param.reg_divider_shift); data |= divider; xgene_clk_write(data, pclk->param.divider_reg + pclk->param.reg_divider_offset);