Commit dcff74ce authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Staging: dt3155: replace u_int and u_long usage



Use u32 and u64 instead, that's the proper thing to do.

Cc: Scott Smedley <ss@aao.gov.au>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 5d392111
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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);
+18 −18
Original line number Diff line number Diff line
@@ -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>
@@ -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;

@@ -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 */
};


@@ -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 */
@@ -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;
+25 −26
Original line number Diff line number Diff line
@@ -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;;


/*
@@ -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++ ) {
@@ -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;
@@ -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
	    {
@@ -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)
    {
@@ -522,11 +522,10 @@ static void dt3155_init_isr(int minor)
 * ioctl()
 *
 *****************************************************/
static int dt3155_ioctl (
			 struct inode	*inode,
static int dt3155_ioctl(struct inode *inode,
			struct file *file,
			 u_int			cmd,
			 u_long			arg)
			unsigned int cmd,
			unsigned long arg)
{
  int minor = MINOR(inode->i_rdev); /* What device are we ioctl()'ing? */

@@ -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;
  }

@@ -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;

@@ -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;

@@ -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;
@@ -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]);

    }
@@ -945,7 +944,7 @@ err:
  return DT_3155_FAILURE;
}

u_long allocatorAddr = 0;
u64 allocatorAddr = 0;

/*****************************************************
 * init_module()
@@ -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);
    }

+1 −1
Original line number Diff line number Diff line
@@ -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;

Loading