Commit ade1af77 authored by Jan Engelhardt's avatar Jan Engelhardt Committed by Ingo Molnar

x86: remove unneded casts

x86: remove unneeded casts
Signed-off-by: default avatarJan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent d729ab35
...@@ -285,7 +285,7 @@ static void putstr(const char *s) ...@@ -285,7 +285,7 @@ static void putstr(const char *s)
static void* memset(void* s, int c, unsigned n) static void* memset(void* s, int c, unsigned n)
{ {
int i; int i;
char *ss = (char*)s; char *ss = s;
for (i=0;i<n;i++) ss[i] = c; for (i=0;i<n;i++) ss[i] = c;
return s; return s;
...@@ -294,7 +294,8 @@ static void* memset(void* s, int c, unsigned n) ...@@ -294,7 +294,8 @@ static void* memset(void* s, int c, unsigned n)
static void* memcpy(void* dest, const void* src, unsigned n) static void* memcpy(void* dest, const void* src, unsigned n)
{ {
int i; int i;
char *d = (char *)dest, *s = (char *)src; const char *s = src;
char *d = dest;
for (i=0;i<n;i++) d[i] = s[i]; for (i=0;i<n;i++) d[i] = s[i];
return dest; return dest;
......
...@@ -284,7 +284,7 @@ static void putstr(const char *s) ...@@ -284,7 +284,7 @@ static void putstr(const char *s)
static void* memset(void* s, int c, unsigned n) static void* memset(void* s, int c, unsigned n)
{ {
int i; int i;
char *ss = (char*)s; char *ss = s;
for (i=0;i<n;i++) ss[i] = c; for (i=0;i<n;i++) ss[i] = c;
return s; return s;
...@@ -293,7 +293,8 @@ static void* memset(void* s, int c, unsigned n) ...@@ -293,7 +293,8 @@ static void* memset(void* s, int c, unsigned n)
static void* memcpy(void* dest, const void* src, unsigned n) static void* memcpy(void* dest, const void* src, unsigned n)
{ {
int i; int i;
char *d = (char *)dest, *s = (char *)src; const char *s = src;
char *d = dest;
for (i=0;i<n;i++) d[i] = s[i]; for (i=0;i<n;i++) d[i] = s[i];
return dest; return dest;
......
...@@ -472,7 +472,7 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka, ...@@ -472,7 +472,7 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka,
restorer = VDSO32_SYMBOL(current->mm->context.vdso, restorer = VDSO32_SYMBOL(current->mm->context.vdso,
sigreturn); sigreturn);
else else
restorer = (void *)&frame->retcode; restorer = &frame->retcode;
} }
err |= __put_user(ptr_to_compat(restorer), &frame->pretcode); err |= __put_user(ptr_to_compat(restorer), &frame->pretcode);
......
...@@ -694,7 +694,7 @@ static acpi_status longhaul_walk_callback(acpi_handle obj_handle, ...@@ -694,7 +694,7 @@ static acpi_status longhaul_walk_callback(acpi_handle obj_handle,
if ( acpi_bus_get_device(obj_handle, &d) ) { if ( acpi_bus_get_device(obj_handle, &d) ) {
return 0; return 0;
} }
*return_value = (void *)acpi_driver_data(d); *return_value = acpi_driver_data(d);
return 1; return 1;
} }
......
...@@ -50,7 +50,7 @@ struct cpuid_command { ...@@ -50,7 +50,7 @@ struct cpuid_command {
static void cpuid_smp_cpuid(void *cmd_block) static void cpuid_smp_cpuid(void *cmd_block)
{ {
struct cpuid_command *cmd = (struct cpuid_command *)cmd_block; struct cpuid_command *cmd = cmd_block;
cpuid(cmd->reg, &cmd->data[0], &cmd->data[1], &cmd->data[2], cpuid(cmd->reg, &cmd->data[0], &cmd->data[1], &cmd->data[2],
&cmd->data[3]); &cmd->data[3]);
......
...@@ -953,7 +953,7 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) ...@@ -953,7 +953,7 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
int __kprobes kprobe_exceptions_notify(struct notifier_block *self, int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
unsigned long val, void *data) unsigned long val, void *data)
{ {
struct die_args *args = (struct die_args *)data; struct die_args *args = data;
int ret = NOTIFY_DONE; int ret = NOTIFY_DONE;
if (args->regs && user_mode_vm(args->regs)) if (args->regs && user_mode_vm(args->regs))
......
...@@ -244,8 +244,8 @@ static int microcode_sanity_check(void *mc) ...@@ -244,8 +244,8 @@ static int microcode_sanity_check(void *mc)
return 0; return 0;
/* check extended signature checksum */ /* check extended signature checksum */
for (i = 0; i < ext_sigcount; i++) { for (i = 0; i < ext_sigcount; i++) {
ext_sig = (struct extended_signature *)((void *)ext_header ext_sig = (void *)ext_header + EXT_HEADER_SIZE +
+ EXT_HEADER_SIZE + EXT_SIGNATURE_SIZE * i); EXT_SIGNATURE_SIZE * i;
sum = orig_sum sum = orig_sum
- (mc_header->sig + mc_header->pf + mc_header->cksum) - (mc_header->sig + mc_header->pf + mc_header->cksum)
+ (ext_sig->sig + ext_sig->pf + ext_sig->cksum); + (ext_sig->sig + ext_sig->pf + ext_sig->cksum);
...@@ -279,11 +279,9 @@ static int get_maching_microcode(void *mc, int cpu) ...@@ -279,11 +279,9 @@ static int get_maching_microcode(void *mc, int cpu)
if (total_size <= get_datasize(mc_header) + MC_HEADER_SIZE) if (total_size <= get_datasize(mc_header) + MC_HEADER_SIZE)
return 0; return 0;
ext_header = (struct extended_sigtable *)(mc + ext_header = mc + get_datasize(mc_header) + MC_HEADER_SIZE;
get_datasize(mc_header) + MC_HEADER_SIZE);
ext_sigcount = ext_header->count; ext_sigcount = ext_header->count;
ext_sig = (struct extended_signature *)((void *)ext_header ext_sig = (void *)ext_header + EXT_HEADER_SIZE;
+ EXT_HEADER_SIZE);
for (i = 0; i < ext_sigcount; i++) { for (i = 0; i < ext_sigcount; i++) {
if (microcode_update_match(cpu, mc_header, if (microcode_update_match(cpu, mc_header,
ext_sig->sig, ext_sig->pf)) ext_sig->sig, ext_sig->pf))
...@@ -539,7 +537,7 @@ static int cpu_request_microcode(int cpu) ...@@ -539,7 +537,7 @@ static int cpu_request_microcode(int cpu)
pr_debug("ucode data file %s load failed\n", name); pr_debug("ucode data file %s load failed\n", name);
return error; return error;
} }
buf = (void *)firmware->data; buf = firmware->data;
size = firmware->size; size = firmware->size;
while ((offset = get_next_ucode_from_buffer(&mc, buf, size, offset)) while ((offset = get_next_ucode_from_buffer(&mc, buf, size, offset))
> 0) { > 0) {
......
...@@ -470,7 +470,7 @@ static inline void set_32bit_tls(struct task_struct *t, int tls, u32 addr) ...@@ -470,7 +470,7 @@ static inline void set_32bit_tls(struct task_struct *t, int tls, u32 addr)
.limit_in_pages = 1, .limit_in_pages = 1,
.useable = 1, .useable = 1,
}; };
struct desc_struct *desc = (void *)t->thread.tls_array; struct desc_struct *desc = t->thread.tls_array;
desc += tls; desc += tls;
fill_ldt(desc, &ud); fill_ldt(desc, &ud);
} }
......
...@@ -368,7 +368,7 @@ static int setup_frame(int sig, struct k_sigaction *ka, ...@@ -368,7 +368,7 @@ static int setup_frame(int sig, struct k_sigaction *ka,
if (current->binfmt->hasvdso) if (current->binfmt->hasvdso)
restorer = VDSO32_SYMBOL(current->mm->context.vdso, sigreturn); restorer = VDSO32_SYMBOL(current->mm->context.vdso, sigreturn);
else else
restorer = (void *)&frame->retcode; restorer = &frame->retcode;
if (ka->sa.sa_flags & SA_RESTORER) if (ka->sa.sa_flags & SA_RESTORER)
restorer = ka->sa.sa_restorer; restorer = ka->sa.sa_restorer;
......
...@@ -132,7 +132,7 @@ static unsigned long __cpuinit setup_trampoline(void) ...@@ -132,7 +132,7 @@ static unsigned long __cpuinit setup_trampoline(void)
*/ */
void __init smp_alloc_memory(void) void __init smp_alloc_memory(void)
{ {
trampoline_base = (void *) alloc_bootmem_low_pages(PAGE_SIZE); trampoline_base = alloc_bootmem_low_pages(PAGE_SIZE);
/* /*
* Has to be in very low memory so we can execute * Has to be in very low memory so we can execute
* real-mode AP code. * real-mode AP code.
......
...@@ -24,7 +24,7 @@ static int save_stack_stack(void *data, char *name) ...@@ -24,7 +24,7 @@ static int save_stack_stack(void *data, char *name)
static void save_stack_address(void *data, unsigned long addr, int reliable) static void save_stack_address(void *data, unsigned long addr, int reliable)
{ {
struct stack_trace *trace = (struct stack_trace *)data; struct stack_trace *trace = data;
if (trace->skip > 0) { if (trace->skip > 0) {
trace->skip--; trace->skip--;
return; return;
......
...@@ -217,7 +217,7 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack, ...@@ -217,7 +217,7 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
static inline int valid_stack_ptr(struct thread_info *tinfo, static inline int valid_stack_ptr(struct thread_info *tinfo,
void *p, unsigned int size, void *end) void *p, unsigned int size, void *end)
{ {
void *t = (void *)tinfo; void *t = tinfo;
if (end) { if (end) {
if (p < end && p >= (end-THREAD_SIZE)) if (p < end && p >= (end-THREAD_SIZE))
return 1; return 1;
......
...@@ -34,8 +34,8 @@ void *memmove(void *dest, const void *src, size_t n) ...@@ -34,8 +34,8 @@ void *memmove(void *dest, const void *src, size_t n)
"cld" "cld"
: "=&c" (d0), "=&S" (d1), "=&D" (d2) : "=&c" (d0), "=&S" (d1), "=&D" (d2)
:"0" (n), :"0" (n),
"1" (n-1+(const char *)src), "1" (n-1+src),
"2" (n-1+(char *)dest) "2" (n-1+dest)
:"memory"); :"memory");
} }
return dest; return dest;
......
...@@ -11,8 +11,8 @@ void *memmove(void * dest,const void *src,size_t count) ...@@ -11,8 +11,8 @@ void *memmove(void * dest,const void *src,size_t count)
if (dest < src) { if (dest < src) {
return memcpy(dest,src,count); return memcpy(dest,src,count);
} else { } else {
char *p = (char *) dest + count; char *p = dest + count;
char *s = (char *) src + count; const char *s = src + count;
while (count--) while (count--)
*--p = *--s; *--p = *--s;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment