From patchwork Wed Jun 1 12:49:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 9147349 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 62D7960777 for ; Wed, 1 Jun 2016 12:51:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53EAB20093 for ; Wed, 1 Jun 2016 12:51:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 476DB2699B; Wed, 1 Jun 2016 12:51:34 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id D15A720093 for ; Wed, 1 Jun 2016 12:51:33 +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 1b85b5-0002Qy-72; Wed, 01 Jun 2016 12:50:07 +0000 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b85b2-0001V2-1i for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2016 12:50:05 +0000 Received: by mail-wm0-x22e.google.com with SMTP id s131so28359225wme.0 for ; Wed, 01 Jun 2016 05:49:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Mdu7c+Yr8gh+7qncL80K70UoOVb8U3kwKwSmtPEZIf4=; b=GAW5Xb8IE2kT6j57wBB5A1vgjVhb45LTzaPFF1MVmh7tuTXx3RTd/JORLbHmUF2rT2 TA3CKuCbQG3sREqJjiY0/x3opsk4IDHpZNIrxw9GRlmrNSCnZC/Qd9nJTiyv6upcUG2z 6eNem63q82aaipHSQHK7Bxg542XXsMvhsf9Yk= 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=Mdu7c+Yr8gh+7qncL80K70UoOVb8U3kwKwSmtPEZIf4=; b=VV2D4eZ6ExjBhgUX7R+NB9xfYpmrf8bh/Scvlv8TbeCzVdkqdbnAaZCspZI+0MNV7H Fp1HiNt8rIJvtP3cY1fWXKi3WE+uBKz7sMpww0lcOMY03CliiF91TsijWuoS0cL7t0v7 MhHanDO2KEQW7IFByzp4g8DpiVpSP8UFrA4sCl48zzPA4QHKrhwLcg567Qpblgps+JCY 1mdnUWM8eHB5HlsFWZK8R/BDriz6CzRp/W4Ow/DJRgKJlOpPiOKyrfzouLdeUr2JcSPp aii0FFWYCx5A6XV7i3zRDpgHsX13ZIoWgIOCwT8KLXlM/bmyPEr5yqcVMSFRK7tQuDMj cGmA== X-Gm-Message-State: ALyK8tL9OwEnxtEDWcYEo/8VcvkHmG90Chai4HPVTYDeY9PiP7PnKKqrC4DOIRRexcxVF3kH X-Received: by 10.194.110.137 with SMTP id ia9mr3451388wjb.107.1464785382184; Wed, 01 Jun 2016 05:49:42 -0700 (PDT) Received: from ermac.urgonet (h-84-45.a175.priv.bahnhof.se. [79.136.84.45]) by smtp.gmail.com with ESMTPSA id lf9sm45456528wjc.44.2016.06.01.05.49.40 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 01 Jun 2016 05:49:41 -0700 (PDT) From: Jens Wiklander To: linux-arm-kernel@lists.infradead.org, Russell King , Lorenzo Pieralisi Subject: [PATCH] include/linux/arm-smccc.h: avoid sign extension problem Date: Wed, 1 Jun 2016 14:49:21 +0200 Message-Id: <1464785361-20038-1-git-send-email-jens.wiklander@linaro.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160601_055004_414834_9E8FD67C X-CRM114-Status: GOOD ( 10.45 ) 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: Jens Wiklander MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Prior to this patch the ARM_SMCCC_FAST_CALL constant was of a signed type causing unwanted sign extension. This patch explicitly selects an unsigned type for the constant. Reported-by: Saksham Jain Signed-off-by: Jens Wiklander Acked-by: Russell King --- include/linux/arm-smccc.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h index b5abfda..699c0d8 100644 --- a/include/linux/arm-smccc.h +++ b/include/linux/arm-smccc.h @@ -23,8 +23,9 @@ * http://infocenter.arm.com/help/topic/com.arm.doc.den0028a/index.html */ -#define ARM_SMCCC_STD_CALL 0 -#define ARM_SMCCC_FAST_CALL 1 +/* This constant is shifted by 31, make sure it's of an unsigned type */ +#define ARM_SMCCC_STD_CALL 0UL +#define ARM_SMCCC_FAST_CALL 1UL #define ARM_SMCCC_TYPE_SHIFT 31 #define ARM_SMCCC_SMC_32 0