Commit 9b7bcd01 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] m68k sparse inline

M68k: Define inline functions before use (found by sparse)
Affected drivers:
  - Atari floppy
  - Amiga A2232 serial
  - Amiga Fastlane SCSI
  - Mac/PowerMac Valkyrie frame buffer
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5d42a079
...@@ -342,8 +342,6 @@ static void fd_select_drive( int drive ); ...@@ -342,8 +342,6 @@ static void fd_select_drive( int drive );
static void fd_deselect( void ); static void fd_deselect( void );
static void fd_motor_off_timer( unsigned long dummy ); static void fd_motor_off_timer( unsigned long dummy );
static void check_change( unsigned long dummy ); static void check_change( unsigned long dummy );
static __inline__ void set_head_settle_flag( void );
static __inline__ int get_head_settle_flag( void );
static irqreturn_t floppy_irq (int irq, void *dummy, struct pt_regs *fp); static irqreturn_t floppy_irq (int irq, void *dummy, struct pt_regs *fp);
static void fd_error( void ); static void fd_error( void );
static int do_format(int drive, int type, struct atari_format_descr *desc); static int do_format(int drive, int type, struct atari_format_descr *desc);
...@@ -361,7 +359,6 @@ static void fd_writetrack_done( int status ); ...@@ -361,7 +359,6 @@ static void fd_writetrack_done( int status );
static void fd_times_out( unsigned long dummy ); static void fd_times_out( unsigned long dummy );
static void finish_fdc( void ); static void finish_fdc( void );
static void finish_fdc_done( int dummy ); static void finish_fdc_done( int dummy );
static __inline__ void copy_buffer( void *from, void *to);
static void setup_req_params( int drive ); static void setup_req_params( int drive );
static void redo_fd_request( void); static void redo_fd_request( void);
static int fd_ioctl( struct inode *inode, struct file *filp, unsigned int static int fd_ioctl( struct inode *inode, struct file *filp, unsigned int
...@@ -385,27 +382,23 @@ static struct timer_list timeout_timer = ...@@ -385,27 +382,23 @@ static struct timer_list timeout_timer =
static struct timer_list fd_timer = static struct timer_list fd_timer =
TIMER_INITIALIZER(check_change, 0, 0); TIMER_INITIALIZER(check_change, 0, 0);
static inline void static inline void start_motor_off_timer(void)
start_motor_off_timer(void)
{ {
mod_timer(&motor_off_timer, jiffies + FD_MOTOR_OFF_DELAY); mod_timer(&motor_off_timer, jiffies + FD_MOTOR_OFF_DELAY);
MotorOffTrys = 0; MotorOffTrys = 0;
} }
static inline void static inline void start_check_change_timer( void )
start_check_change_timer( void )
{ {
mod_timer(&fd_timer, jiffies + CHECK_CHANGE_DELAY); mod_timer(&fd_timer, jiffies + CHECK_CHANGE_DELAY);
} }
static inline void static inline void start_timeout(void)
start_timeout(void)
{ {
mod_timer(&timeout_timer, jiffies + FLOPPY_TIMEOUT); mod_timer(&timeout_timer, jiffies + FLOPPY_TIMEOUT);
} }
static inline void static inline void stop_timeout(void)
stop_timeout(void)
{ {
del_timer(&timeout_timer); del_timer(&timeout_timer);
} }
...@@ -558,18 +551,27 @@ static void check_change( unsigned long dummy ) ...@@ -558,18 +551,27 @@ static void check_change( unsigned long dummy )
* seek operation, because we don't use seeks with verify. * seek operation, because we don't use seeks with verify.
*/ */
static __inline__ void set_head_settle_flag( void ) static inline void set_head_settle_flag(void)
{ {
HeadSettleFlag = FDCCMDADD_E; HeadSettleFlag = FDCCMDADD_E;
} }
static __inline__ int get_head_settle_flag( void ) static inline int get_head_settle_flag(void)
{ {
int tmp = HeadSettleFlag; int tmp = HeadSettleFlag;
HeadSettleFlag = 0; HeadSettleFlag = 0;
return( tmp ); return( tmp );
} }
static inline void copy_buffer(void *from, void *to)
{
ulong *p1 = (ulong *)from, *p2 = (ulong *)to;
int cnt;
for (cnt = 512/4; cnt; cnt--)
*p2++ = *p1++;
}
...@@ -1372,15 +1374,6 @@ static int floppy_revalidate(struct gendisk *disk) ...@@ -1372,15 +1374,6 @@ static int floppy_revalidate(struct gendisk *disk)
return 0; return 0;
} }
static __inline__ void copy_buffer(void *from, void *to)
{
ulong *p1 = (ulong *)from, *p2 = (ulong *)to;
int cnt;
for( cnt = 512/4; cnt; cnt-- )
*p2++ = *p1++;
}
/* This sets up the global variables describing the current request. */ /* This sets up the global variables describing the current request. */
......
...@@ -109,12 +109,6 @@ ...@@ -109,12 +109,6 @@
/************************* End of Includes **************************/ /************************* End of Includes **************************/
/***************************** Prototypes ***************************/ /***************************** Prototypes ***************************/
/* Helper functions */
static __inline__ volatile struct a2232status *a2232stat(unsigned int board,
unsigned int portonboard);
static __inline__ volatile struct a2232memory *a2232mem (unsigned int board);
static __inline__ void a2232_receive_char( struct a2232_port *port,
int ch, int err );
/* The interrupt service routine */ /* The interrupt service routine */
static irqreturn_t a2232_vbl_inter(int irq, void *data, struct pt_regs *fp); static irqreturn_t a2232_vbl_inter(int irq, void *data, struct pt_regs *fp);
/* Initialize the port structures */ /* Initialize the port structures */
...@@ -178,6 +172,51 @@ static int nr_a2232; ...@@ -178,6 +172,51 @@ static int nr_a2232;
static struct zorro_dev *zd_a2232[MAX_A2232_BOARDS]; static struct zorro_dev *zd_a2232[MAX_A2232_BOARDS];
/***************************** End of Global variables **************/ /***************************** End of Global variables **************/
/* Helper functions */
static inline volatile struct a2232memory *a2232mem(unsigned int board)
{
return (volatile struct a2232memory *)ZTWO_VADDR(zd_a2232[board]->resource.start);
}
static inline volatile struct a2232status *a2232stat(unsigned int board,
unsigned int portonboard)
{
volatile struct a2232memory *mem = a2232mem(board);
return &(mem->Status[portonboard]);
}
static inline void a2232_receive_char(struct a2232_port *port, int ch, int err)
{
/* Mostly stolen from other drivers.
Maybe one could implement a more efficient version by not only
transferring one character at a time.
*/
struct tty_struct *tty = port->gs.tty;
if (tty->flip.count >= TTY_FLIPBUF_SIZE)
return;
tty->flip.count++;
#if 0
switch(err) {
case TTY_BREAK:
break;
case TTY_PARITY:
break;
case TTY_OVERRUN:
break;
case TTY_FRAME:
break;
}
#endif
*tty->flip.flag_buf_ptr++ = err;
*tty->flip.char_buf_ptr++ = ch;
tty_flip_buffer_push(tty);
}
/***************************** Functions ****************************/ /***************************** Functions ****************************/
/*** BEGIN OF REAL_DRIVER FUNCTIONS ***/ /*** BEGIN OF REAL_DRIVER FUNCTIONS ***/
...@@ -470,49 +509,6 @@ static int a2232_open(struct tty_struct * tty, struct file * filp) ...@@ -470,49 +509,6 @@ static int a2232_open(struct tty_struct * tty, struct file * filp)
} }
/*** END OF FUNCTIONS EXPECTED BY TTY DRIVER STRUCTS ***/ /*** END OF FUNCTIONS EXPECTED BY TTY DRIVER STRUCTS ***/
static __inline__ volatile struct a2232status *a2232stat(unsigned int board, unsigned int portonboard)
{
volatile struct a2232memory *mem = a2232mem(board);
return &(mem->Status[portonboard]);
}
static __inline__ volatile struct a2232memory *a2232mem (unsigned int board)
{
return (volatile struct a2232memory *) ZTWO_VADDR( zd_a2232[board]->resource.start );
}
static __inline__ void a2232_receive_char( struct a2232_port *port,
int ch, int err )
{
/* Mostly stolen from other drivers.
Maybe one could implement a more efficient version by not only
transferring one character at a time.
*/
struct tty_struct *tty = port->gs.tty;
if (tty->flip.count >= TTY_FLIPBUF_SIZE)
return;
tty->flip.count++;
#if 0
switch(err) {
case TTY_BREAK:
break;
case TTY_PARITY:
break;
case TTY_OVERRUN:
break;
case TTY_FRAME:
break;
}
#endif
*tty->flip.flag_buf_ptr++ = err;
*tty->flip.char_buf_ptr++ = ch;
tty_flip_buffer_push(tty);
}
static irqreturn_t a2232_vbl_inter(int irq, void *data, struct pt_regs *fp) static irqreturn_t a2232_vbl_inter(int irq, void *data, struct pt_regs *fp)
{ {
#if A2232_IOBUFLEN != 256 #if A2232_IOBUFLEN != 256
......
...@@ -85,7 +85,6 @@ struct fastlane_dma_registers { ...@@ -85,7 +85,6 @@ struct fastlane_dma_registers {
static int dma_bytes_sent(struct NCR_ESP *esp, int fifo_count); static int dma_bytes_sent(struct NCR_ESP *esp, int fifo_count);
static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp); static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp);
static inline void dma_clear(struct NCR_ESP *esp);
static void dma_dump_state(struct NCR_ESP *esp); static void dma_dump_state(struct NCR_ESP *esp);
static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length); static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length);
static void dma_init_write(struct NCR_ESP *esp, __u32 vaddr, int length); static void dma_init_write(struct NCR_ESP *esp, __u32 vaddr, int length);
...@@ -110,6 +109,21 @@ static volatile unsigned char cmd_buffer[16]; ...@@ -110,6 +109,21 @@ static volatile unsigned char cmd_buffer[16];
* via PIO. * via PIO.
*/ */
static inline void dma_clear(struct NCR_ESP *esp)
{
struct fastlane_dma_registers *dregs =
(struct fastlane_dma_registers *) (esp->dregs);
unsigned long *t;
ctrl_data = (ctrl_data & FASTLANE_DMA_MASK);
dregs->ctrl_reg = ctrl_data;
t = (unsigned long *)(esp->edev);
dregs->clear_strobe = 0;
*t = 0 ;
}
/***************************************************************** Detection */ /***************************************************************** Detection */
int __init fastlane_esp_detect(Scsi_Host_Template *tpnt) int __init fastlane_esp_detect(Scsi_Host_Template *tpnt)
{ {
...@@ -297,21 +311,6 @@ static void dma_init_write(struct NCR_ESP *esp, __u32 addr, int length) ...@@ -297,21 +311,6 @@ static void dma_init_write(struct NCR_ESP *esp, __u32 addr, int length)
dregs->ctrl_reg = ctrl_data; dregs->ctrl_reg = ctrl_data;
} }
static inline void dma_clear(struct NCR_ESP *esp)
{
struct fastlane_dma_registers *dregs =
(struct fastlane_dma_registers *) (esp->dregs);
unsigned long *t;
ctrl_data = (ctrl_data & FASTLANE_DMA_MASK);
dregs->ctrl_reg = ctrl_data;
t = (unsigned long *)(esp->edev);
dregs->clear_strobe = 0;
*t = 0 ;
}
static void dma_ints_off(struct NCR_ESP *esp) static void dma_ints_off(struct NCR_ESP *esp)
{ {
......
...@@ -118,9 +118,7 @@ static int valkyriefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, ...@@ -118,9 +118,7 @@ static int valkyriefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
static int valkyriefb_blank(int blank_mode, struct fb_info *info); static int valkyriefb_blank(int blank_mode, struct fb_info *info);
static int read_valkyrie_sense(struct fb_info_valkyrie *p); static int read_valkyrie_sense(struct fb_info_valkyrie *p);
static inline int valkyrie_vram_reqd(int video_mode, int color_mode);
static void set_valkyrie_clock(unsigned char *params); static void set_valkyrie_clock(unsigned char *params);
static inline int valkyrie_par_to_var(struct fb_par_valkyrie *par, struct fb_var_screeninfo *var);
static int valkyrie_var_to_par(struct fb_var_screeninfo *var, static int valkyrie_var_to_par(struct fb_var_screeninfo *var,
struct fb_par_valkyrie *par, const struct fb_info *fb_info); struct fb_par_valkyrie *par, const struct fb_info *fb_info);
...@@ -171,6 +169,12 @@ static int valkyriefb_set_par(struct fb_info *info) ...@@ -171,6 +169,12 @@ static int valkyriefb_set_par(struct fb_info *info)
return 0; return 0;
} }
static inline int valkyrie_par_to_var(struct fb_par_valkyrie *par,
struct fb_var_screeninfo *var)
{
return mac_vmode_to_var(par->vmode, par->cmode, var);
}
static int static int
valkyriefb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) valkyriefb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
{ {
...@@ -252,7 +256,7 @@ static int valkyriefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, ...@@ -252,7 +256,7 @@ static int valkyriefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
return 0; return 0;
} }
static int valkyrie_vram_reqd(int video_mode, int color_mode) static inline int valkyrie_vram_reqd(int video_mode, int color_mode)
{ {
int pitch; int pitch;
struct valkyrie_regvals *init = valkyrie_reg_init[video_mode-1]; struct valkyrie_regvals *init = valkyrie_reg_init[video_mode-1];
...@@ -504,11 +508,6 @@ static int valkyrie_var_to_par(struct fb_var_screeninfo *var, ...@@ -504,11 +508,6 @@ static int valkyrie_var_to_par(struct fb_var_screeninfo *var,
return 0; return 0;
} }
static int valkyrie_par_to_var(struct fb_par_valkyrie *par, struct fb_var_screeninfo *var)
{
return mac_vmode_to_var(par->vmode, par->cmode, var);
}
static void valkyrie_init_fix(struct fb_fix_screeninfo *fix, struct fb_info_valkyrie *p) static void valkyrie_init_fix(struct fb_fix_screeninfo *fix, struct fb_info_valkyrie *p)
{ {
memset(fix, 0, sizeof(*fix)); memset(fix, 0, sizeof(*fix));
......
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