[PATCH] hvcs build warning fixes

Ryan Arnold rsa at us.ibm.com
Wed May 5 06:32:28 EST 2004


This is the second of three patches broken out of an originally proposed
single hvcs.diff patch as suggested when I posted it last.

The first patch was the hvconsole.c arch specific changes and which were
checked into the Ameslab tree early last week by paulus.  This patch
adds fixes to appease the build warnings related to hvcs.c.

Please review this patch.  Olaf, this is basically the same patch you
added to your CVS tree.  I can either check this into Ameslab tree
myself or someone else can do it when its quality is acceptable.

The third (forthcoming) patch will fix some documentation, printk's, and
minor execution issues proposed in my original patch.  Hopefully I'll
get that out tomorrow (Wednesday).

Ryan S. Arnold
IBM Linux Technology Center


-------------- next part --------------
--- linux-2.5/drivers/char/hvcs.c	2004-05-03 14:18:31.000000000 -0500
+++ hvcs_warn_linux-2.5/drivers/char/hvcs.c	2004-05-03 15:23:23.000000000 -0500
@@ -110,9 +110,9 @@
 static int hvcs_parm_num_devs = -1;
 module_param(hvcs_parm_num_devs, int, 0);
 
-static const char hvcs_driver_name[] = "hvcs";
-static const char hvcs_device_node[] = "hvcs";
-static const char hvcs_driver_string[]
+char hvcs_driver_name[] = "hvcs";
+char hvcs_device_node[] = "hvcs";
+char hvcs_driver_string[]
 	= "IBM hvcs (Hypervisor Virtual Console Server) Driver";
 
 /* Status of partner info rescan triggered via sysfs. */
@@ -154,7 +154,7 @@
 
 static struct list_head hvcs_structs = LIST_HEAD_INIT(hvcs_structs);
 
-static void hvcs_read_task(unsigned long data);
+static void hvcs_read_task(void * data);
 static void hvcs_unthrottle(struct tty_struct *tty);
 static void hvcs_throttle(struct tty_struct *tty);
 static irqreturn_t hvcs_handle_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
@@ -185,7 +185,7 @@
 static void hvcs_remove_driver_attrs(void);
 
 static int __devinit hvcs_probe(struct vio_dev *dev, const struct vio_device_id *id);
-static void __devexit hvcs_remove(struct vio_dev *dev);
+static int __devexit hvcs_remove(struct vio_dev *dev);
 static int __init hvcs_module_init(void);
 static void __exit hvcs_module_exit(void);
 
@@ -195,7 +195,7 @@
  * throttle and we want to be able to reschedule ourselves to run AFTER a
  * push is scheduled so that we know when the tty is properly throttled.
  */
-static void hvcs_read_task(unsigned long data)
+static void hvcs_read_task(void * data)
 {
 	struct hvcs_struct *hvcsd = (struct hvcs_struct *)data;
 	unsigned int unit_address = hvcsd->vdev->unit_address;
@@ -295,7 +295,7 @@
 
 	if (!dev || !id) {
 		printk(KERN_ERR "HVCS: driver probed with invalid parm.\n");
-		return;
+		return -EPERM;
 	}
 
 	printk(KERN_INFO "HVCS: Added vty-server@%X.\n", dev->unit_address);
@@ -319,7 +319,7 @@
 
 	hvcsd->index = ++hvcs_struct_count;
 
-	INIT_WORK(&hvcsd->read_work, hvcs_read_task, (unsigned long)hvcsd);
+	INIT_WORK(&hvcsd->read_work, hvcs_read_task, hvcsd);
 
 	hvcsd->enabled = 0;
 
@@ -345,12 +345,12 @@
 	return 0;
 }
 
-static void __devexit hvcs_remove(struct vio_dev *dev)
+static int __devexit hvcs_remove(struct vio_dev *dev)
 {
 	struct hvcs_struct *hvcsd = (struct hvcs_struct *)dev->driver_data;
 
 	if (!hvcsd)
-		return;
+		return -ENODEV;
 
 	printk(KERN_INFO "HVCS: Removing vty-server@%X.\n", dev->unit_address);
 
@@ -379,13 +379,14 @@
 	 * which would probably be tty_hangup.
 	 */
 	kobject_put (&hvcsd->kobj);
+	return 0;
 };
 
 static struct vio_driver hvcs_vio_driver = {
-	.name		= &hvcs_driver_name,
+	.name		= hvcs_driver_name,
 	.id_table	= hvcs_driver_table,
 	.probe		= hvcs_probe,
-	.remove		= __devexit_p(hvcs_remove),
+	.remove		= hvcs_remove,
 };
 
 /* Only called from hvcs_get_pi please */


More information about the Linuxppc64-dev mailing list