From patchwork Thu Aug 28 13:14:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 36203 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5AB232054F for ; Thu, 28 Aug 2014 13:14:56 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id rp18sf7571015iec.0 for ; Thu, 28 Aug 2014 06:14:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=FQK4Hda75maN2rFbhCCCOY0XiKT0ZdaQPb6Rw/yVxvc=; b=YXuE7TzuX5Ndz45kajoi0LKzckvseWZA8aT4xZz1di+xS/A/hutnve+aB/LJITgiey qxjbSv1EQbaylWuRD75i7lfAGyAa8am1RR4sF6FBIPrQvcpDg0SfiRTd6nh0wqYlbapf isLR6C/OWgEtKazzaB9Xn3lssaJXVhdYVDhJ1dlNTQDdQ9VcIH8buQi2/U3kiDqbGQE5 3mbh1L23+vZWVZEj2Fa/qJ8xVzNoruOnR9tz0d6ErYXaQuWahfPCnxkOWuSghWVM8kgX oU4ZMD8hbm+M9MJFTC8tNNZNzn9euxbG55TrJpzt9tkMH2637bx8d+a+A+hQDl4iKZTN K5Kw== X-Gm-Message-State: ALoCoQksWC5YsM4seZtZ0WJHRaXCZWPyC3GgCKQ6nRkmc/D8GkDSY07fJELiQsGKtgk4tyiJta7h X-Received: by 10.182.110.130 with SMTP id ia2mr2144804obb.42.1409231695879; Thu, 28 Aug 2014 06:14:55 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.106.34 with SMTP id d31ls573365qgf.93.gmail; Thu, 28 Aug 2014 06:14:55 -0700 (PDT) X-Received: by 10.221.64.142 with SMTP id xi14mr1529466vcb.31.1409231695735; Thu, 28 Aug 2014 06:14:55 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id dm3si3330475vcb.91.2014.08.28.06.14.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Aug 2014 06:14:55 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id lf12so749266vcb.20 for ; Thu, 28 Aug 2014 06:14:55 -0700 (PDT) X-Received: by 10.221.5.137 with SMTP id og9mr3057112vcb.18.1409231695651; Thu, 28 Aug 2014 06:14:55 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp234698vcb; Thu, 28 Aug 2014 06:14:55 -0700 (PDT) X-Received: by 10.43.94.73 with SMTP id bx9mr4202101icc.19.1409231695134; Thu, 28 Aug 2014 06:14:55 -0700 (PDT) Received: from mail-ie0-f169.google.com (mail-ie0-f169.google.com [209.85.223.169]) by mx.google.com with ESMTPS id z16si4011983icd.90.2014.08.28.06.14.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Aug 2014 06:14:55 -0700 (PDT) Received-SPF: pass (google.com: domain of lee.jones@linaro.org designates 209.85.223.169 as permitted sender) client-ip=209.85.223.169; Received: by mail-ie0-f169.google.com with SMTP id tr6so924541ieb.28 for ; Thu, 28 Aug 2014 06:14:47 -0700 (PDT) X-Received: by 10.50.142.100 with SMTP id rv4mr37827673igb.43.1409231687823; Thu, 28 Aug 2014 06:14:47 -0700 (PDT) Received: from localhost.localdomain (host86-152-0-170.range86-152.btcentralplus.com. [86.152.0.170]) by mx.google.com with ESMTPSA id w8sm16633672igl.13.2014.08.28.06.14.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Aug 2014 06:14:47 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Lee Jones Subject: [PATCH 11/11] mfd: sm501: Avoid implicit sign extension Date: Thu, 28 Aug 2014 14:14:17 +0100 Message-Id: <1409231657-18294-11-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409231657-18294-1-git-send-email-lee.jones@linaro.org> References: <1409231657-18294-1-git-send-email-lee.jones@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Suspicious implicit sign extension where 'reg' (unsigned char) is promoted in reg << clksrc to int, then sign-extended to unsigned long. If reg << clksrc is greater than 0x7FFFFFFF, the upper bits of the result will all be 1. Signed-off-by: Lee Jones --- drivers/mfd/sm501.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c index 81e6d09..1f9233b 100644 --- a/drivers/mfd/sm501.c +++ b/drivers/mfd/sm501.c @@ -514,9 +514,9 @@ unsigned long sm501_set_clock(struct device *dev, unsigned long mode = smc501_readl(sm->regs + SM501_POWER_MODE_CONTROL); unsigned long gate = smc501_readl(sm->regs + SM501_CURRENT_GATE); unsigned long clock = smc501_readl(sm->regs + SM501_CURRENT_CLOCK); - unsigned char reg; unsigned int pll_reg = 0; unsigned long sm501_freq; /* the actual frequency achieved */ + u64 reg; struct sm501_clock to;