From: Simon Arlott <simon@fire.lp0.eu>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
trivial@kernel.org, Ingo Molnar <mingo@elte.hu>
Subject: [PATCH] x86: fix sparse warnings in ptrace.c
Date: Fri, 14 Nov 2008 21:28:00 +0000 [thread overview]
Message-ID: <491DED60.1060509@simon.arlott.org.uk> (raw)
arch/x86/kernel/ptrace.c:634:32: error: incompatible types for operation (*)
arch/x86/kernel/ptrace.c:634:32: left side has type unsigned char static [unsigned] [toplevel] sizeof_field
arch/x86/kernel/ptrace.c:634:32: right side has type bad type enum bts_field field
arch/x86/kernel/ptrace.c:634:7: error: invalid assignment
arch/x86/kernel/ptrace.c:640:32: error: incompatible types for operation (*)
arch/x86/kernel/ptrace.c:640:32: left side has type unsigned char static [unsigned] [toplevel] sizeof_field
arch/x86/kernel/ptrace.c:640:32: right side has type bad type enum bts_field field
arch/x86/kernel/ptrace.c:640:7: error: invalid assignment
Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
---
arch/x86/kernel/ptrace.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index 0a6d8c1..662a400 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -631,13 +631,13 @@ enum bts_field {
static inline unsigned long bts_get(const char *base, enum bts_field field)
{
- base += (bts_cfg.sizeof_field * field);
+ base += (bts_cfg.sizeof_field * (unsigned char)field);
return *(unsigned long *)base;
}
static inline void bts_set(char *base, enum bts_field field, unsigned long val)
{
- base += (bts_cfg.sizeof_field * field);;
+ base += (bts_cfg.sizeof_field * (unsigned char)field);
(*(unsigned long *)base) = val;
}
--
1.6.0.3
--
Simon Arlott
reply other threads:[~2008-11-14 21:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=491DED60.1060509@simon.arlott.org.uk \
--to=simon@fire.lp0.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=trivial@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox