patch-2.4.20 linux-2.4.20/drivers/sgi/char/shmiq.c

Next file: linux-2.4.20/drivers/sgi/char/streamable.c
Previous file: linux-2.4.20/drivers/sgi/char/sgiserial.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.19/drivers/sgi/char/shmiq.c linux-2.4.20/drivers/sgi/char/shmiq.c
@@ -10,7 +10,7 @@
  * any other number implements /dev/qcntl${minor-1}
  *
  * /dev/shmiq is used by the X server for two things:
- * 
+ *
  *    1. for I_LINK()ing trough ioctl the file handle of a
  *       STREAMS device.
  *
@@ -36,7 +36,7 @@
  * need an strace from an X server that runs on a machine with more
  * than one keyboard.  And this is a problem since the file handles
  * are pushed in /dev/shmiq, while the events should be dispatched to
- * the /dev/qcntlN device. 
+ * the /dev/qcntlN device.
  *
  * Until then, I just allow for 1 qcntl device.
  *
@@ -84,7 +84,7 @@
 	int    tail;		/* our copy of the shmiq->tail */
 	int    events;
 	int    mapped;
-	
+
 	wait_queue_head_t    proc_list;
 	struct fasync_struct *fasync;
 } shmiqs [MAX_SHMI_QUEUES];
@@ -106,12 +106,12 @@
 		return;
 	}
 	tail_next = (s->tail + 1) % (shmiqs [device].events);
-	
+
 	if (tail_next == s->head){
 		s->flags |= SHMIQ_OVERFLOW;
 		return;
 	}
-	
+
 	e->un.time = jiffies;
 	s->events [s->tail] = *e;
 	printk ("KERNEL: dev=%d which=%d type=%d flags=%d\n",
@@ -151,7 +151,7 @@
 
 	if (fdes > MAX_SHMIQ_DEVS)
 		return -EINVAL;
-	
+
 	if (!shmiq_pushed_devices [fdes].used)
 		return -EINVAL;
 
@@ -179,7 +179,7 @@
 
 	case QIOCIISTR: {
 		struct muxioctl *mux = (struct muxioctl *) s->ic_dp;
-		
+
 		printk ("Double indirect ioctl: [%d, %x\n", mux->index, mux->realcmd);
 		return -EINVAL;
 	}
@@ -225,12 +225,12 @@
 	case I_UNLINK:
 		v = shmiq_forget_file (arg);
 		return v;
-		
+
 	case I_STR:
 		v = get_sioc (&sioc, arg);
 		if (v)
 			return v;
-		
+
 		/* FIXME: This forces device = 0 */
 		return shmiq_sioc (0, sioc.ic_cmd, &sioc);
 	}
@@ -249,7 +249,7 @@
 	struct shmiqreq req;
 	struct vm_area_struct *vma;
 	int v;
-	
+
 	switch (cmd) {
 		/*
 		 * The address space is already mapped as a /dev/zero
@@ -259,7 +259,7 @@
 		case QIOCATTACH: {
 			unsigned long vaddr;
 			int s;
-	
+
 			v = verify_area (VERIFY_READ, (void *) arg,
 			                 sizeof (struct shmiqreq));
 			if (v)
@@ -318,7 +318,7 @@
 	int           minor = MINOR (file->f_dentry->d_inode->i_rdev), error;
 	unsigned int  size;
 	unsigned long mem, start;
-	
+
 	/* mmap is only supported on the qcntl devices */
 	if (minor-- == 0)
 		return -EINVAL;
@@ -327,7 +327,7 @@
 		return -EINVAL;
 
 	size  = vma->vm_end - vma->vm_start;
-	start = vma->vm_start; 
+	start = vma->vm_start;
 	lock_kernel();
 	mem = (unsigned long) shmiqs [minor].shmiq_vaddr =  vmalloc_uncached (size);
 	if (!mem) {
@@ -338,7 +338,7 @@
 	/* Prevent the swapper from considering these pages for swap and touching them */
 	vma->vm_flags    |= (VM_SHM  | VM_LOCKED | VM_IO);
 	vma->vm_ops = &qcntl_mmap;
-	
+
 	/* Uncache the pages */
 	vma->vm_page_prot = PAGE_USERIO;
 
@@ -348,7 +348,7 @@
 	/* Init the shared memory input queue */
 	memset (shmiqs [minor].shmiq_vaddr, 0, size);
 	unlock_kernel();
-	
+
 	return error;
 }
 
@@ -374,7 +374,7 @@
 
 	if (!shmiqs [minor].mapped)
 		return 0;
-	
+
 	poll_wait (filp, &shmiqs [minor].proc_list, wait);
 	s = shmiqs [minor].shmiq_vaddr;
 	if (s->head != s->tail)
@@ -421,7 +421,7 @@
 {
 	int minor = MINOR (inode->i_rdev);
 	int j;
-	
+
 	if (minor-- == 0){
 		for (j = 0; j < MAX_SHMIQ_DEVS; j++)
 			shmiq_forget_file (j);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)