Commit 0f7a6be6 authored by Richard Henderson's avatar Richard Henderson

[ALPHA] Fix some compiler warnings from gcc 4.

parent 116ab81c
...@@ -91,7 +91,7 @@ osf_set_program_attributes(unsigned long text_start, unsigned long text_len, ...@@ -91,7 +91,7 @@ osf_set_program_attributes(unsigned long text_start, unsigned long text_len,
* braindamage (it can't really handle filesystems where the directory * braindamage (it can't really handle filesystems where the directory
* offset differences aren't the same as "d_reclen"). * offset differences aren't the same as "d_reclen").
*/ */
#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de))) #define NAME_OFFSET offsetof (struct osf_dirent, d_name)
#define ROUND_UP(x) (((x)+3) & ~3) #define ROUND_UP(x) (((x)+3) & ~3)
struct osf_dirent { struct osf_dirent {
...@@ -114,7 +114,7 @@ osf_filldir(void *__buf, const char *name, int namlen, loff_t offset, ...@@ -114,7 +114,7 @@ osf_filldir(void *__buf, const char *name, int namlen, loff_t offset,
{ {
struct osf_dirent __user *dirent; struct osf_dirent __user *dirent;
struct osf_dirent_callback *buf = (struct osf_dirent_callback *) __buf; struct osf_dirent_callback *buf = (struct osf_dirent_callback *) __buf;
unsigned int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1); unsigned int reclen = ROUND_UP(NAME_OFFSET + namlen + 1);
buf->error = -EINVAL; /* only used if we fail */ buf->error = -EINVAL; /* only used if we fail */
if (reclen > buf->count) if (reclen > buf->count)
...@@ -989,7 +989,7 @@ osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp, ...@@ -989,7 +989,7 @@ osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
fd_set_bits fds; fd_set_bits fds;
char *bits; char *bits;
size_t size; size_t size;
unsigned long timeout; long timeout;
int ret; int ret;
timeout = MAX_SCHEDULE_TIMEOUT; timeout = MAX_SCHEDULE_TIMEOUT;
......
...@@ -91,15 +91,15 @@ static int regoff[] = { ...@@ -91,15 +91,15 @@ static int regoff[] = {
PT_REG( pc) PT_REG( pc)
}; };
static long zero; static unsigned long zero;
/* /*
* Get address of register REGNO in task TASK. * Get address of register REGNO in task TASK.
*/ */
static long * static unsigned long *
get_reg_addr(struct task_struct * task, unsigned long regno) get_reg_addr(struct task_struct * task, unsigned long regno)
{ {
long *addr; unsigned long *addr;
if (regno == 30) { if (regno == 30) {
addr = &task->thread_info->pcb.usp; addr = &task->thread_info->pcb.usp;
...@@ -109,7 +109,7 @@ get_reg_addr(struct task_struct * task, unsigned long regno) ...@@ -109,7 +109,7 @@ get_reg_addr(struct task_struct * task, unsigned long regno)
zero = 0; zero = 0;
addr = &zero; addr = &zero;
} else { } else {
addr = (long *)((long)task->thread_info + regoff[regno]); addr = (void *)task->thread_info + regoff[regno];
} }
return addr; return addr;
} }
...@@ -117,7 +117,7 @@ get_reg_addr(struct task_struct * task, unsigned long regno) ...@@ -117,7 +117,7 @@ get_reg_addr(struct task_struct * task, unsigned long regno)
/* /*
* Get contents of register REGNO in task TASK. * Get contents of register REGNO in task TASK.
*/ */
static long static unsigned long
get_reg(struct task_struct * task, unsigned long regno) get_reg(struct task_struct * task, unsigned long regno)
{ {
/* Special hack for fpcr -- combine hardware and software bits. */ /* Special hack for fpcr -- combine hardware and software bits. */
...@@ -135,7 +135,7 @@ get_reg(struct task_struct * task, unsigned long regno) ...@@ -135,7 +135,7 @@ get_reg(struct task_struct * task, unsigned long regno)
* Write contents of register REGNO in task TASK. * Write contents of register REGNO in task TASK.
*/ */
static int static int
put_reg(struct task_struct *task, unsigned long regno, long data) put_reg(struct task_struct *task, unsigned long regno, unsigned long data)
{ {
if (regno == 63) { if (regno == 63) {
task->thread_info->ieee_state task->thread_info->ieee_state
...@@ -168,11 +168,11 @@ int ...@@ -168,11 +168,11 @@ int
ptrace_set_bpt(struct task_struct * child) ptrace_set_bpt(struct task_struct * child)
{ {
int displ, i, res, reg_b, nsaved = 0; int displ, i, res, reg_b, nsaved = 0;
u32 insn, op_code; unsigned int insn, op_code;
unsigned long pc; unsigned long pc;
pc = get_reg(child, REG_PC); pc = get_reg(child, REG_PC);
res = read_int(child, pc, &insn); res = read_int(child, pc, (int *) &insn);
if (res < 0) if (res < 0)
return res; return res;
...@@ -203,7 +203,8 @@ ptrace_set_bpt(struct task_struct * child) ...@@ -203,7 +203,8 @@ ptrace_set_bpt(struct task_struct * child)
/* install breakpoints: */ /* install breakpoints: */
for (i = 0; i < nsaved; ++i) { for (i = 0; i < nsaved; ++i) {
res = read_int(child, child->thread_info->bpt_addr[i], &insn); res = read_int(child, child->thread_info->bpt_addr[i],
(int *) &insn);
if (res < 0) if (res < 0)
return res; return res;
child->thread_info->bpt_insn[i] = insn; child->thread_info->bpt_insn[i] = insn;
......
...@@ -91,15 +91,15 @@ srmcons_receive_chars(unsigned long data) ...@@ -91,15 +91,15 @@ srmcons_receive_chars(unsigned long data)
/* called with callback_lock held */ /* called with callback_lock held */
static int static int
srmcons_do_write(struct tty_struct *tty, const unsigned char *buf, int count) srmcons_do_write(struct tty_struct *tty, const char *buf, int count)
{ {
unsigned char *str_cr = "\r"; static char str_cr[1] = "\r";
long c, remaining = count; long c, remaining = count;
srmcons_result result; srmcons_result result;
unsigned char *cur; char *cur;
int need_cr; int need_cr;
for (cur = (unsigned char *)buf; remaining > 0; ) { for (cur = (char *)buf; remaining > 0; ) {
need_cr = 0; need_cr = 0;
/* /*
* Break it up into reasonable size chunks to allow a chance * Break it up into reasonable size chunks to allow a chance
...@@ -138,7 +138,7 @@ srmcons_write(struct tty_struct *tty, int from_user, ...@@ -138,7 +138,7 @@ srmcons_write(struct tty_struct *tty, int from_user,
unsigned long flags; unsigned long flags;
if (from_user) { if (from_user) {
unsigned char tmp[512]; char tmp[512];
int ret = 0; int ret = 0;
size_t c; size_t c;
...@@ -167,7 +167,7 @@ srmcons_write(struct tty_struct *tty, int from_user, ...@@ -167,7 +167,7 @@ srmcons_write(struct tty_struct *tty, int from_user,
} }
spin_lock_irqsave(&srmcons_callback_lock, flags); spin_lock_irqsave(&srmcons_callback_lock, flags);
srmcons_do_write(tty, buf, count); srmcons_do_write(tty, (const char *) buf, count);
spin_unlock_irqrestore(&srmcons_callback_lock, flags); spin_unlock_irqrestore(&srmcons_callback_lock, flags);
return count; return count;
......
...@@ -86,7 +86,7 @@ flush_tlb(void) ...@@ -86,7 +86,7 @@ flush_tlb(void)
static inline void static inline void
flush_tlb_other(struct mm_struct *mm) flush_tlb_other(struct mm_struct *mm)
{ {
long *mmc = &mm->context[smp_processor_id()]; unsigned long *mmc = &mm->context[smp_processor_id()];
/* Check it's not zero first to avoid cacheline ping pong /* Check it's not zero first to avoid cacheline ping pong
when possible. */ when possible. */
if (*mmc) *mmc = 0; if (*mmc) *mmc = 0;
......
...@@ -618,7 +618,7 @@ static inline long read(int fd, char * buf, size_t nr) ...@@ -618,7 +618,7 @@ static inline long read(int fd, char * buf, size_t nr)
return sys_read(fd, buf, nr); return sys_read(fd, buf, nr);
} }
extern long execve(char *, char **, char **); extern int execve(char *, char **, char **);
static inline long setsid(void) static inline long setsid(void)
{ {
......
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