All of lore.kernel.org
 help / color / mirror / Atom feed
From: vladimir.murzin@arm.com (Vladimir Murzin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/4] ARM: fix cpu feature extracting helper
Date: Tue, 26 Jan 2016 09:23:41 +0000	[thread overview]
Message-ID: <1453800223-18590-3-git-send-email-vladimir.murzin@arm.com> (raw)
In-Reply-To: <1453800223-18590-1-git-send-email-vladimir.murzin@arm.com>

Commit b8c9592 "ARM: 8318/1: treat CPU feature register fields as signed
quantities" introduced helper to extract signed quantities of 4-bit
blocks. However, with a current code feature with value 0b1000 isn't
rejected as negative. So fix the "if" condition.

Reported-by: Jonathan Brawn <Jon.Brawn@arm.com>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/include/asm/cputype.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/cputype.h b/arch/arm/include/asm/cputype.h
index b23c6c8..1ee94c7 100644
--- a/arch/arm/include/asm/cputype.h
+++ b/arch/arm/include/asm/cputype.h
@@ -276,7 +276,7 @@ static inline int __attribute_const__ cpuid_feature_extract_field(u32 features,
 	int feature = (features >> field) & 15;
 
 	/* feature registers are signed values */
-	if (feature > 8)
+	if (feature > 7)
 		feature -= 16;
 
 	return feature;
-- 
1.7.9.5

  parent reply	other threads:[~2016-01-26  9:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26  9:23 [PATCH 0/4] Update cpu feature extraction Vladimir Murzin
2016-01-26  9:23 ` [PATCH 1/4] ARM: fix demoting HWCAP_SWP Vladimir Murzin
2016-01-27  9:34   ` Ard Biesheuvel
2016-01-26  9:23 ` Vladimir Murzin [this message]
2016-01-27  9:35   ` [PATCH 2/4] ARM: fix cpu feature extracting helper Ard Biesheuvel
2016-01-26  9:23 ` [PATCH 3/4] ARM: introduce cpu feature helper for unsigned values Vladimir Murzin
2016-01-26  9:23 ` [PATCH 4/4] ARM: use proper helper while extracting cpu features Vladimir Murzin
2016-01-27  9:44   ` Ard Biesheuvel
2016-01-28 11:13 ` [PATCH 0/4] Update cpu feature extraction Vladimir Murzin
2016-01-28 17:01   ` Russell King - ARM Linux
2016-01-28 17:14     ` Ard Biesheuvel
2016-01-29 10:36     ` Vladimir Murzin
2016-04-19 11:39       ` Vladimir Murzin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1453800223-18590-3-git-send-email-vladimir.murzin@arm.com \
    --to=vladimir.murzin@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.