Skip to content

Commit

Permalink
Staging: dt3155: replace u_int and u_long usage
Browse files Browse the repository at this point in the history
Use u32 and u64 instead, that's the proper thing to do.

Cc: Scott Smedley <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
gregkh committed Mar 4, 2010
1 parent 5d39211 commit dcff74c
Show file tree
Hide file tree
Showing 9 changed files with 169 additions and 170 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/dt3155/allocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
-------------------------------------------------------------------
02-Aug-2002 NJC allocator now steps in 1MB increments, rather
than doubling its size each time.
Also, allocator_init(u_int *) now returns
Also, allocator_init(u32 *) now returns
(in the first arg) the size of the free
space. This is no longer consistent with
using the allocator as a module, and some changes
Expand Down Expand Up @@ -195,7 +195,7 @@ int allocator_free_dma(unsigned long address)
* On cleanup everything is released. If the list is not empty, that a
* problem of our clients
*/
int allocator_init(u_long *allocator_max)
int allocator_init(u64 *allocator_max)
{
/* check how much free memory is there */
void *remapped;
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/dt3155/allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@

void allocator_free_dma(unsigned long address);
unsigned long allocator_allocate_dma(unsigned long kilobytes, int priority);
int allocator_init(u_long *);
int allocator_init(u64 *);
void allocator_cleanup(void);
36 changes: 18 additions & 18 deletions drivers/staging/dt3155/dt3155.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ MA 02111-1307 USA
#define _DT3155_INC

#ifdef __KERNEL__
#include <linux/types.h> /* u_int etc. */
#include <linux/types.h>
#include <linux/time.h> /* struct timeval */
#else
#include <sys/ioctl.h>
Expand Down Expand Up @@ -71,16 +71,16 @@ MA 02111-1307 USA

/* Configuration structure */
struct dt3155_config_s {
u_int acq_mode;
u_int cols, rows;
u_int continuous;
u32 acq_mode;
u32 cols, rows;
u32 continuous;
};


/* hold data for each frame */
typedef struct {
u_long addr; /* address of the buffer with the frame */
u_long tag; /* unique number for the frame */
u64 addr; /* address of the buffer with the frame */
u64 tag; /* unique number for the frame */
struct timeval time; /* time that capture took place */
} frame_info_t;

Expand All @@ -101,14 +101,14 @@ struct dt3155_fbuffer_s {
int locked_buf; /* Buffers used by user */

int ready_que[BOARD_MAX_BUFFS];
u_long ready_head; /* The most recent buffer located here */
u_long ready_len; /* The number of ready buffers */
u64 ready_head; /* The most recent buffer located here */
u64 ready_len; /* The number of ready buffers */

int even_happened;
int even_stopped;

int stop_acquire; /* Flag to stop interrupts */
u_long frame_count; /* Counter for frames acquired by this card */
u64 frame_count; /* Counter for frames acquired by this card */
};


Expand All @@ -122,14 +122,14 @@ struct dt3155_fbuffer_s {
/* There is one status structure for each card. */
typedef struct dt3155_status_s {
int fixed_mode; /* if 1, we are in fixed frame mode */
u_long reg_addr; /* Register address for a single card */
u_long mem_addr; /* Buffer start addr for this card */
u_long mem_size; /* This is the amount of mem available */
u_int irq; /* this card's irq */
u64 reg_addr; /* Register address for a single card */
u64 mem_addr; /* Buffer start addr for this card */
u64 mem_size; /* This is the amount of mem available */
u32 irq; /* this card's irq */
struct dt3155_config_s config; /* configuration struct */
struct dt3155_fbuffer_s fbuffer; /* frame buffer state struct */
u_long state; /* this card's state */
u_int device_installed; /* Flag if installed. 1=installed */
u64 state; /* this card's state */
u32 device_installed; /* Flag if installed. 1=installed */
} dt3155_status_t;

/* Reference to global status structure */
Expand Down Expand Up @@ -161,9 +161,9 @@ extern struct dt3155_status_s dt3155_status[MAXBOARDS];

/* User code will probably want to declare one of these for each card */
typedef struct dt3155_read_s {
u_long offset;
u_long frame_seq;
u_long state;
u64 offset;
u64 frame_seq;
u64 state;

frame_info_t frame_info;
} dt3155_read_t;
Expand Down
51 changes: 25 additions & 26 deletions drivers/staging/dt3155/dt3155_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,14 @@ u8 *dt3155_lbase[ MAXBOARDS ] = { NULL
/* DT3155 registers */
u8 *dt3155_bbase = NULL; /* kernel logical address of the *
* buffer region */
u_int dt3155_dev_open[ MAXBOARDS ] = {0
u32 dt3155_dev_open[ MAXBOARDS ] = {0
#if MAXBOARDS == 2
, 0
#endif
};

u_int ndevices = 0;
u_long unique_tag = 0;;
u32 ndevices = 0;
u64 unique_tag = 0;;


/*
Expand Down Expand Up @@ -180,7 +180,7 @@ static inline void dt3155_isr( int irq, void *dev_id, struct pt_regs *regs )
int minor = -1;
int index;
unsigned long flags;
u_long buffer_addr;
u64 buffer_addr;

/* find out who issued the interrupt */
for ( index = 0; index < ndevices; index++ ) {
Expand Down Expand Up @@ -249,7 +249,7 @@ static inline void dt3155_isr( int irq, void *dev_id, struct pt_regs *regs )
{
/* GCS (Aug 2, 2002) -- In field mode, dma the odd field
into the lower half of the buffer */
const u_long stride = dt3155_status[ minor ].config.cols;
const u64 stride = dt3155_status[ minor ].config.cols;
buffer_addr = dt3155_fbuffer[ minor ]->
frame_info[ dt3155_fbuffer[ minor ]->active_buf ].addr
+ (DT3155_MAX_ROWS / 2) * stride;
Expand Down Expand Up @@ -311,8 +311,8 @@ static inline void dt3155_isr( int irq, void *dev_id, struct pt_regs *regs )
dt3155_fbuffer[ minor ]->stop_acquire = 0;
dt3155_fbuffer[ minor ]->even_stopped = 0;

printk(KERN_DEBUG "dt3155: state is now %lx\n",
dt3155_status[minor].state);
printk(KERN_DEBUG "dt3155: state is now %x\n",
(u32)dt3155_status[minor].state);
}
else
{
Expand Down Expand Up @@ -428,7 +428,7 @@ static inline void dt3155_isr( int irq, void *dev_id, struct pt_regs *regs )
*****************************************************/
static void dt3155_init_isr(int minor)
{
const u_long stride = dt3155_status[ minor ].config.cols;
const u64 stride = dt3155_status[ minor ].config.cols;

switch (dt3155_status[ minor ].state & DT3155_STATE_MODE)
{
Expand Down Expand Up @@ -522,11 +522,10 @@ static void dt3155_init_isr(int minor)
* ioctl()
*
*****************************************************/
static int dt3155_ioctl (
struct inode *inode,
struct file *file,
u_int cmd,
u_long arg)
static int dt3155_ioctl(struct inode *inode,
struct file *file,
unsigned int cmd,
unsigned long arg)
{
int minor = MINOR(inode->i_rdev); /* What device are we ioctl()'ing? */

Expand Down Expand Up @@ -706,8 +705,8 @@ static int dt3155_open( struct inode* inode, struct file* filep)
}

if (dt3155_status[ minor ].state != DT3155_STATE_IDLE) {
printk ("DT3155: Not in idle state (state = %lx)\n",
dt3155_status[ minor ].state);
printk ("DT3155: Not in idle state (state = %x)\n",
(u32)dt3155_status[ minor ].state);
return -EBUSY;
}

Expand Down Expand Up @@ -763,7 +762,7 @@ static ssize_t dt3155_read(struct file *filep, char __user *buf,
{
/* which device are we reading from? */
int minor = MINOR(filep->f_dentry->d_inode->i_rdev);
u_long offset;
u64 offset;
int frame_index;
frame_info_t *frame_info_p;

Expand Down Expand Up @@ -821,11 +820,11 @@ static ssize_t dt3155_read(struct file *filep, char __user *buf,
offset = frame_info_p->addr - dt3155_status[minor].mem_addr;

put_user(offset, (unsigned int *) buf);
buf += sizeof(u_long);
buf += sizeof(u64);
put_user( dt3155_status[minor].fbuffer.frame_count, (unsigned int *) buf);
buf += sizeof(u_long);
buf += sizeof(u64);
put_user(dt3155_status[minor].state, (unsigned int *) buf);
buf += sizeof(u_long);
buf += sizeof(u64);
if (copy_to_user(buf, frame_info_p, sizeof(frame_info_t)))
return -EFAULT;

Expand Down Expand Up @@ -899,7 +898,7 @@ static int find_PCI (void)
/* Now, just go out and make sure that this/these device(s) is/are
actually mapped into the kernel address space */
if ((error = pci_read_config_dword( pci_dev, PCI_BASE_ADDRESS_0,
(u_int *) &base)))
(u32 *) &base)))
{
printk("DT3155: Was not able to find device \n");
goto err;
Expand Down Expand Up @@ -932,7 +931,7 @@ static int find_PCI (void)
dt3155_status[ pci_index-1 ].device_installed = 1;
printk("DT3155: Installing device %d w/irq %d and address %p\n",
pci_index,
(u_int)dt3155_status[pci_index-1].irq,
(u32)dt3155_status[pci_index-1].irq,
dt3155_lbase[pci_index-1]);

}
Expand All @@ -945,7 +944,7 @@ static int find_PCI (void)
return DT_3155_FAILURE;
}

u_long allocatorAddr = 0;
u64 allocatorAddr = 0;

/*****************************************************
* init_module()
Expand Down Expand Up @@ -1024,10 +1023,10 @@ int init_module(void)
dt3155_status[ index ].config.cols,
dt3155_status[ index ].config.rows);
printk("DT3155: m_addr = 0x%x; m_size = %ld; "
"state = %ld; device_installed = %d\n",
(u_int)dt3155_status[ index ].mem_addr,
dt3155_status[ index ].mem_size,
dt3155_status[ index ].state,
"state = %d; device_installed = %d\n",
(u32)dt3155_status[ index ].mem_addr,
(long int)dt3155_status[ index ].mem_size,
(u32)dt3155_status[ index ].state,
dt3155_status[ index ].device_installed);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/dt3155/dt3155_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extern wait_queue_head_t dt3155_read_wait_queue[MAXBOARDS];
#endif

/* number of devices */
extern u_int ndevices;
extern u32 ndevices;

extern int dt3155_errno;

Expand Down
16 changes: 8 additions & 8 deletions drivers/staging/dt3155/dt3155_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,21 @@ MA 02111-1307 USA


/****** local copies of board's 32 bit registers ******/
u_long even_dma_start_r; /* bit 0 should always be 0 */
u_long odd_dma_start_r; /* .. */
u_long even_dma_stride_r; /* bits 0&1 should always be 0 */
u_long odd_dma_stride_r; /* .. */
u_long even_pixel_fmt_r;
u_long odd_pixel_fmt_r;
u64 even_dma_start_r; /* bit 0 should always be 0 */
u64 odd_dma_start_r; /* .. */
u64 even_dma_stride_r; /* bits 0&1 should always be 0 */
u64 odd_dma_stride_r; /* .. */
u64 even_pixel_fmt_r;
u64 odd_pixel_fmt_r;

FIFO_TRIGGER_R fifo_trigger_r;
XFER_MODE_R xfer_mode_r;
CSR1_R csr1_r;
RETRY_WAIT_CNT_R retry_wait_cnt_r;
INT_CSR_R int_csr_r;

u_long even_fld_mask_r;
u_long odd_fld_mask_r;
u64 even_fld_mask_r;
u64 odd_fld_mask_r;

MASK_LENGTH_R mask_length_r;
FIFO_FLAG_CNT_R fifo_flag_cnt_r;
Expand Down
Loading

0 comments on commit dcff74c

Please sign in to comment.