]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
x86: remove unneded casts
authorJan Engelhardt <jengelh@computergmbh.de>
Wed, 30 Jan 2008 12:33:23 +0000 (13:33 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 30 Jan 2008 12:33:23 +0000 (13:33 +0100)
x86: remove unneeded casts

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
14 files changed:
arch/x86/boot/compressed/misc_32.c
arch/x86/boot/compressed/misc_64.c
arch/x86/ia32/ia32_signal.c
arch/x86/kernel/cpu/cpufreq/longhaul.c
arch/x86/kernel/cpuid.c
arch/x86/kernel/kprobes.c
arch/x86/kernel/microcode.c
arch/x86/kernel/process_64.c
arch/x86/kernel/signal_32.c
arch/x86/kernel/smpboot_32.c
arch/x86/kernel/stacktrace.c
arch/x86/kernel/traps_64.c
arch/x86/lib/memcpy_32.c
arch/x86/lib/memmove_64.c

index 9103652058c4f47fa76018a68f6561daea29d493..5a0281c81edf491ea391667bb2e8df6566c05380 100644 (file)
@@ -285,7 +285,7 @@ static void putstr(const char *s)
 static void* memset(void* s, int c, unsigned n)
 {
        int i;
-       char *ss = (char*)s;
+       char *ss = s;
 
        for (i=0;i<n;i++) ss[i] = c;
        return s;
@@ -294,7 +294,8 @@ static void* memset(void* s, int c, unsigned n)
 static void* memcpy(void* dest, const void* src, unsigned n)
 {
        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];
        return dest;
index 8494f0dcff21c08e01cec62945ec0744634ec179..8c1573b5d6c7a0121e51ff8fa5f9bf427b517b47 100644 (file)
@@ -284,7 +284,7 @@ static void putstr(const char *s)
 static void* memset(void* s, int c, unsigned n)
 {
        int i;
-       char *ss = (char*)s;
+       char *ss = s;
 
        for (i=0;i<n;i++) ss[i] = c;
        return s;
@@ -293,7 +293,8 @@ static void* memset(void* s, int c, unsigned n)
 static void* memcpy(void* dest, const void* src, unsigned n)
 {
        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];
        return dest;
index 0a34c24f19e5fb099d7f3ae100266dec4d434faa..1c0503bdfb1a1dbd33080620ec67715644fcf054 100644 (file)
@@ -472,7 +472,7 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka,
                        restorer = VDSO32_SYMBOL(current->mm->context.vdso,
                                                 sigreturn);
                else
-                       restorer = (void *)&frame->retcode;
+                       restorer = &frame->retcode;
        }
        err |= __put_user(ptr_to_compat(restorer), &frame->pretcode);
 
index 749d00cb2ebdde52ae67719ecc4514191b6c20fe..06fcce516d51d44a97349f9140507f82b6d20ef2 100644 (file)
@@ -694,7 +694,7 @@ static acpi_status longhaul_walk_callback(acpi_handle obj_handle,
        if ( acpi_bus_get_device(obj_handle, &d) ) {
                return 0;
        }
-       *return_value = (void *)acpi_driver_data(d);
+       *return_value = acpi_driver_data(d);
        return 1;
 }
 
index d387c770c518e179413f4d2f891cbb86403ce45b..dec66e4528100c72ee384f7c5aa9400339eb26ab 100644 (file)
@@ -50,7 +50,7 @@ struct cpuid_command {
 
 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],
                      &cmd->data[3]);
index f7ddbb8c3fe82617f36d1814a42638cd22600177..a99e764fd66a8a1875dad2e70893f0e7128f987e 100644 (file)
@@ -953,7 +953,7 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
 int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
                                       unsigned long val, void *data)
 {
-       struct die_args *args = (struct die_args *)data;
+       struct die_args *args = data;
        int ret = NOTIFY_DONE;
 
        if (args->regs && user_mode_vm(args->regs))
index 40cfd5488719b96fd6ccd8d3a890e54761d0c6c0..6ff447f9fda702398aaaaef9aa8f93143c56a12d 100644 (file)
@@ -244,8 +244,8 @@ static int microcode_sanity_check(void *mc)
                return 0;
        /* check extended signature checksum */
        for (i = 0; i < ext_sigcount; i++) {
-               ext_sig = (struct extended_signature *)((void *)ext_header
-                       + EXT_HEADER_SIZE + EXT_SIGNATURE_SIZE * i);
+               ext_sig = (void *)ext_header + EXT_HEADER_SIZE +
+                         EXT_SIGNATURE_SIZE * i;
                sum = orig_sum
                        - (mc_header->sig + mc_header->pf + mc_header->cksum)
                        + (ext_sig->sig + ext_sig->pf + ext_sig->cksum);
@@ -279,11 +279,9 @@ static int get_maching_microcode(void *mc, int cpu)
        if (total_size <= get_datasize(mc_header) + MC_HEADER_SIZE)
                return 0;
 
-       ext_header = (struct extended_sigtable *)(mc +
-                       get_datasize(mc_header) + MC_HEADER_SIZE);
+       ext_header = mc + get_datasize(mc_header) + MC_HEADER_SIZE;
        ext_sigcount = ext_header->count;
-       ext_sig = (struct extended_signature *)((void *)ext_header
-                       + EXT_HEADER_SIZE);
+       ext_sig = (void *)ext_header + EXT_HEADER_SIZE;
        for (i = 0; i < ext_sigcount; i++) {
                if (microcode_update_match(cpu, mc_header,
                                ext_sig->sig, ext_sig->pf))
@@ -539,7 +537,7 @@ static int cpu_request_microcode(int cpu)
                pr_debug("ucode data file %s load failed\n", name);
                return error;
        }
-       buf = (void *)firmware->data;
+       buf = firmware->data;
        size = firmware->size;
        while ((offset = get_next_ucode_from_buffer(&mc, buf, size, offset))
                        > 0) {
index 95313532b2e0f24a89b4841b9c0abb4e50e438aa..b4c470658a8af59695695ef8327c518580d09a6a 100644 (file)
@@ -470,7 +470,7 @@ static inline void set_32bit_tls(struct task_struct *t, int tls, u32 addr)
                .limit_in_pages = 1,
                .useable = 1,
        };
-       struct desc_struct *desc = (void *)t->thread.tls_array;
+       struct desc_struct *desc = t->thread.tls_array;
        desc += tls;
        fill_ldt(desc, &ud);
 }
index 89a690edf999b783f8fb1e6588954002f2024524..caee1f002fed39476d54e61b3aa6762b28e92c31 100644 (file)
@@ -368,7 +368,7 @@ static int setup_frame(int sig, struct k_sigaction *ka,
        if (current->binfmt->hasvdso)
                restorer = VDSO32_SYMBOL(current->mm->context.vdso, sigreturn);
        else
-               restorer = (void *)&frame->retcode;
+               restorer = &frame->retcode;
        if (ka->sa.sa_flags & SA_RESTORER)
                restorer = ka->sa.sa_restorer;
 
index 915ec626732678c790068333c1586f1852a87945..7a62dced61ca102356c5b22a1a2ab4d9ae99b93a 100644 (file)
@@ -132,7 +132,7 @@ static unsigned long __cpuinit setup_trampoline(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
         * real-mode AP code.
index 4f4021b5bfb5dd5cf61f44092aaefcf8db4f966a..02f0f61f5b1131a511851546393ef06665787507 100644 (file)
@@ -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)
 {
-       struct stack_trace *trace = (struct stack_trace *)data;
+       struct stack_trace *trace = data;
        if (trace->skip > 0) {
                trace->skip--;
                return;
index 911ed28afff86d7ba4936871f2536868e3e3ba2b..4aa4520f9499e7720c29b76ae0a1b8e4ba1663c3 100644 (file)
@@ -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,
                        void *p, unsigned int size, void *end)
 {
-       void *t = (void *)tinfo;
+       void *t = tinfo;
        if (end) {
                if (p < end && p >= (end-THREAD_SIZE))
                        return 1;
index 8ac51b82a632ca61a4e112a66301816cb0daf2d5..37756b6fb32992c5d703b5ccacf9fd02661213a1 100644 (file)
@@ -34,8 +34,8 @@ void *memmove(void *dest, const void *src, size_t n)
                        "cld"
                        : "=&c" (d0), "=&S" (d1), "=&D" (d2)
                        :"0" (n),
-                        "1" (n-1+(const char *)src),
-                        "2" (n-1+(char *)dest)
+                        "1" (n-1+src),
+                        "2" (n-1+dest)
                        :"memory");
        }
        return dest;
index 751ebae8ec4251bf74211bbfd937bd8c5a2b09df..80175e47b1902e4a3b5015599a5cc102e3922008 100644 (file)
@@ -11,8 +11,8 @@ void *memmove(void * dest,const void *src,size_t count)
        if (dest < src) { 
                return memcpy(dest,src,count);
        } else {
-               char *p = (char *) dest + count;
-               char *s = (char *) src + count;
+               char *p = dest + count;
+               const char *s = src + count;
                while (count--)
                        *--p = *--s;
        }