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: 69032 Delivered-To: patches@linaro.org Received: by 10.140.92.199 with SMTP id b65csp75563qge; Wed, 1 Jun 2016 05:49:42 -0700 (PDT) X-Received: by 10.194.0.242 with SMTP id 18mr3529014wjh.105.1464785382474; Wed, 01 Jun 2016 05:49:42 -0700 (PDT) Return-Path: Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com. [2a00:1450:400c:c09::230]) by mx.google.com with ESMTPS id wa2si56888936wjc.62.2016.06.01.05.49.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Jun 2016 05:49:42 -0700 (PDT) Received-SPF: pass (google.com: domain of jens.wiklander@linaro.org designates 2a00:1450:400c:c09::230 as permitted sender) client-ip=2a00:1450:400c:c09::230; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of jens.wiklander@linaro.org designates 2a00:1450:400c:c09::230 as permitted sender) smtp.mailfrom=jens.wiklander@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-wm0-x230.google.com with SMTP id z87so28074420wmh.0 for ; Wed, 01 Jun 2016 05:49:42 -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=h0VOPHlkU+bqzpYiMC+CGGq/PIdgDCi04YQ5YsjemSgZ6CRqnl/nfIiaP8lrfCZweF oUrmASfAq9E7Zt2TiCzxbIiKsvO9bmlZpjFMgVSYK5Nec2nrQZ/U22/+KpCDar1xs/g4 UVCs0LfpTIBMBOCqq0Mz+jy1Htl/IYz+NARwpyzKbe64D8DiETr2zisQxEzCUDTlSOSs s86KNYQNJBB+umOtQxl+aIjZF6RXrbUn4fCftmo158VjmCSuejoD2wzuFEyFbzE50kRN 4gUG7UVOcbNc/NPFCfJhXVbHyWeo6tG6h8m/oRMziVYEa9AS5uFiHtz3ynGTDfP4OMis wO6A== X-Gm-Message-State: ALyK8tJXYOWlputh1+KYA4wn/Q7wppwQ12QUiliNb4UW94LW37CJFu1tiatCJSf8wN9r1qxNir0= X-Received: by 10.194.110.137 with SMTP id ia9mr3451388wjb.107.1464785382184; Wed, 01 Jun 2016 05:49:42 -0700 (PDT) Return-Path: 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 Cc: Jens Wiklander 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 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 --- include/linux/arm-smccc.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 1.9.1 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