From: Frank Mori Hess Date: Thu, 9 Nov 2006 18:12:35 +0000 (+0000) Subject: Fixed oops caused by my giving comedi_driver.board_name a well-defined X-Git-Tag: r0_7_74~158 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e224639b2c17d8ddc5ed33aeec7be16fa9be4b01;p=comedi.git Fixed oops caused by my giving comedi_driver.board_name a well-defined type. Fix and bug report was from from sinkin . --- diff --git a/comedi/drivers.c b/comedi/drivers.c index 680f7db6..05a286a8 100644 --- a/comedi/drivers.c +++ b/comedi/drivers.c @@ -21,6 +21,7 @@ */ +#define _GNU_SOURCE #define __NO_VERSION__ #include @@ -103,8 +104,8 @@ int comedi_device_detach(comedi_device *dev) cleanup_device_allocations(dev); dev->driver = 0; - dev->board_name = 0; - dev->board_ptr = 0; + dev->board_name = NULL; + dev->board_ptr = NULL; dev->iobase = 0; dev->irq = 0; dev->read_subdev = NULL; @@ -315,7 +316,9 @@ void *comedi_recognize(comedi_driver *driv, const char *name) { if(strcmp(*name_ptr, name) == 0) return name_ptr; - name_ptr += driv->offset; + unsigned long address = (unsigned long)name_ptr; + address += driv->offset; + name_ptr = (const char**)address; } return NULL; @@ -332,7 +335,9 @@ void comedi_report_boards(comedi_driver *driv) for(i = 0; i < driv->num_names; i++) { printk(" %s\n", *name_ptr); - name_ptr += driv->offset; + unsigned long address = (unsigned long)name_ptr; + address += driv->offset; + name_ptr = (const char**)address; } if(driv->num_names == 0)