From: Frank Mori Hess Date: Mon, 16 Jul 2007 19:26:52 +0000 (+0000) Subject: Got rid of unnecessary casts when initializing comedi_driver.board_name X-Git-Tag: r0_7_74~47 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=693335b834e40f9a5f7454a3c931ee15d50665a3;p=comedi.git Got rid of unnecessary casts when initializing comedi_driver.board_name --- diff --git a/comedi/drivers.c b/comedi/drivers.c index 8dd1c770..be47412d 100644 --- a/comedi/drivers.c +++ b/comedi/drivers.c @@ -321,12 +321,12 @@ static int postconfig(comedi_device *dev) void *comedi_recognize(comedi_driver *driv, const char *name) { unsigned i; - const char **name_ptr = driv->board_name; + const char * const *name_ptr = driv->board_name; for(i = 0; i < driv->num_names; i++) { if(strcmp(*name_ptr, name) == 0) - return name_ptr; - name_ptr = (const char **)((char *)name_ptr + driv->offset); + return (void*)name_ptr; + name_ptr = (const char * const *)((const char *)name_ptr + driv->offset); } return NULL; @@ -335,7 +335,7 @@ void *comedi_recognize(comedi_driver *driv, const char *name) void comedi_report_boards(comedi_driver *driv) { unsigned int i; - const char **name_ptr; + const char * const *name_ptr; printk("comedi: valid board names for %s driver are:\n", driv->driver_name); diff --git a/comedi/drivers/acl7225b.c b/comedi/drivers/acl7225b.c index e550c3eb..3cdb48f0 100644 --- a/comedi/drivers/acl7225b.c +++ b/comedi/drivers/acl7225b.c @@ -25,7 +25,7 @@ static int acl7225b_attach(comedi_device *dev,comedi_devconfig *it); static int acl7225b_detach(comedi_device *dev); typedef struct { - char *name; // driver name + const char *name; // driver name int io_range; // len of I/O space } boardtype; @@ -42,7 +42,7 @@ static comedi_driver driver_acl7225b = { module: THIS_MODULE, attach: acl7225b_attach, detach: acl7225b_detach, - board_name: (const char**)boardtypes, + board_name: &boardtypes[0].name, num_names: n_boardtypes, offset: sizeof(boardtype), }; diff --git a/comedi/drivers/adl_pci7296.c b/comedi/drivers/adl_pci7296.c index 106c4d60..8301c283 100644 --- a/comedi/drivers/adl_pci7296.c +++ b/comedi/drivers/adl_pci7296.c @@ -48,7 +48,7 @@ Configuration Options: typedef struct skel_board_struct{ - char *name; + const char *name; int vendor_id; int device_id; }adl_pci7296_board; @@ -80,7 +80,7 @@ static comedi_driver driver_adl_pci7296={ attach: adl_pci7296_attach, detach: adl_pci7296_detach, - board_name: (const char**)adl_pci7296_boards, + board_name: &adl_pci7296_boards[0].name, offset: sizeof(adl_pci7296_board), num_names: sizeof(adl_pci7296_boards) / sizeof(adl_pci7296_board), }; diff --git a/comedi/drivers/adl_pci7432.c b/comedi/drivers/adl_pci7432.c index 32075728..65291f10 100644 --- a/comedi/drivers/adl_pci7432.c +++ b/comedi/drivers/adl_pci7432.c @@ -40,7 +40,7 @@ Configuration Options: #define PCI_DEVICE_ID_PCI7432 0x7432 typedef struct { - char *name; + const char *name; int vendor_id; int device_id; } adl_pci7432_board; @@ -72,7 +72,7 @@ static comedi_driver driver_adl_pci7432={ attach: adl_pci7432_attach, detach: adl_pci7432_detach, num_names: 1, - board_name: (const char**)adl_pci7432_boards, + board_name: &adl_pci7432_boards[0].name, offset: sizeof(adl_pci7432_board), }; diff --git a/comedi/drivers/adl_pci8164.c b/comedi/drivers/adl_pci8164.c index 863397dc..b0bf682d 100644 --- a/comedi/drivers/adl_pci8164.c +++ b/comedi/drivers/adl_pci8164.c @@ -52,7 +52,7 @@ Configuration Options: #define PCI_DEVICE_ID_PCI8164 0x8164 typedef struct { - char *name; + const char *name; int vendor_id; int device_id; } adl_pci8164_board; @@ -84,7 +84,7 @@ static comedi_driver driver_adl_pci8164={ attach: adl_pci8164_attach, detach: adl_pci8164_detach, num_names: 1, - board_name: (const char**)adl_pci8164_boards, + board_name: &adl_pci8164_boards[0].name, offset: sizeof(adl_pci8164_board), }; diff --git a/comedi/drivers/adl_pci9111.c b/comedi/drivers/adl_pci9111.c index 97695d84..dedc8560 100644 --- a/comedi/drivers/adl_pci9111.c +++ b/comedi/drivers/adl_pci9111.c @@ -294,7 +294,7 @@ MODULE_DEVICE_TABLE(pci, pci9111_pci_table); // typedef struct { - char *name; // driver name + const char *name; // driver name int device_id; int ai_channel_nbr; // num of A/D chans int ao_channel_nbr; // num of D/A chans @@ -335,7 +335,7 @@ static comedi_driver pci9111_driver= attach: pci9111_attach, detach: pci9111_detach, num_names: pci9111_board_nbr, - board_name: (const char**)pci9111_boards, + board_name: &pci9111_boards[0].name, offset: sizeof(pci9111_board_struct), }; COMEDI_INITCLEANUP(pci9111_driver); diff --git a/comedi/drivers/adl_pci9118.c b/comedi/drivers/adl_pci9118.c index ba8b380a..ce277346 100644 --- a/comedi/drivers/adl_pci9118.c +++ b/comedi/drivers/adl_pci9118.c @@ -182,7 +182,7 @@ static int pci9118_attach(comedi_device *dev,comedi_devconfig *it); static int pci9118_detach(comedi_device *dev); typedef struct { - char *name; // driver name + const char *name; // board name int vendor_id; // PCI vendor a device ID of card int device_id; int iorange_amcc; // iorange for own S5933 region @@ -235,7 +235,7 @@ static comedi_driver driver_pci9118={ attach: pci9118_attach, detach: pci9118_detach, num_names: n_boardtypes, - board_name: (const char**)boardtypes, + board_name: &boardtypes[0].name, offset: sizeof(boardtype), }; COMEDI_INITCLEANUP(driver_pci9118); diff --git a/comedi/drivers/adv_pci1710.c b/comedi/drivers/adv_pci1710.c index 731e0490..a46a499a 100644 --- a/comedi/drivers/adv_pci1710.c +++ b/comedi/drivers/adv_pci1710.c @@ -183,7 +183,7 @@ static int pci1710_attach(comedi_device *dev,comedi_devconfig *it); static int pci1710_detach(comedi_device *dev); typedef struct { - char *name; // driver name + const char *name; // board name int device_id; int iorange; // I/O range len char have_irq; // 1=card support IRQ @@ -255,7 +255,7 @@ static comedi_driver driver_pci1710={ attach: pci1710_attach, detach: pci1710_detach, num_names: n_boardtypes, - board_name: (const char**)boardtypes, + board_name: &boardtypes[0].name, offset: sizeof(boardtype), }; diff --git a/comedi/drivers/adv_pci_dio.c b/comedi/drivers/adv_pci_dio.c index 22594b94..9c9f1e49 100644 --- a/comedi/drivers/adv_pci_dio.c +++ b/comedi/drivers/adv_pci_dio.c @@ -185,7 +185,7 @@ typedef struct { } diosubd_data; typedef struct { - char *name; // driver name + const char *name; // board name int vendor_id; // vendor/device PCI ID int device_id; int main_pci_region;// main I/O OCI region @@ -321,7 +321,7 @@ static comedi_driver driver_pci_dio={ attach: pci_dio_attach, detach: pci_dio_detach, num_names: n_boardtypes, - board_name: (const char**)boardtypes, + board_name: &boardtypes[0].name, offset: sizeof(boardtype), }; typedef struct pci_dio_private_st pci_dio_private; diff --git a/comedi/drivers/aio_aio12_8.c b/comedi/drivers/aio_aio12_8.c index a0bffda1..34573c8f 100644 --- a/comedi/drivers/aio_aio12_8.c +++ b/comedi/drivers/aio_aio12_8.c @@ -73,7 +73,7 @@ Notes: typedef struct { - char *name; + const char *name; } board_type; static board_type board_types[] = @@ -230,7 +230,7 @@ static comedi_driver driver_aio_aio12_8 = module: THIS_MODULE, attach: aio_aio12_8_attach, detach: aio_aio12_8_detach, - board_name: (const char**)board_types, + board_name: &board_types[0].name, num_names: 1, offset: sizeof (board_type), }; diff --git a/comedi/drivers/aio_iiro_16.c b/comedi/drivers/aio_iiro_16.c index d2b8de1c..6ea8d210 100644 --- a/comedi/drivers/aio_iiro_16.c +++ b/comedi/drivers/aio_iiro_16.c @@ -45,7 +45,7 @@ Configuration Options: typedef struct aio_iiro_16_board_struct { - char *name; + const char *name; int do_; int di; } aio_iiro_16_board; @@ -81,7 +81,7 @@ static comedi_driver driver_aio_iiro_16 = module: THIS_MODULE, attach: aio_iiro_16_attach, detach: aio_iiro_16_detach, - board_name: (const char**)aio_iiro_16_boards, + board_name: &aio_iiro_16_boards[0].name, offset: sizeof (aio_iiro_16_board), num_names: sizeof (aio_iiro_16_boards) / sizeof (aio_iiro_16_board), diff --git a/comedi/drivers/amplc_dio200.c b/comedi/drivers/amplc_dio200.c index a9a7d917..68c59bab 100644 --- a/comedi/drivers/amplc_dio200.c +++ b/comedi/drivers/amplc_dio200.c @@ -265,7 +265,7 @@ enum dio200_layout { }; typedef struct dio200_board_struct { - char *name; + const char *name; enum dio200_bustype bustype; enum dio200_model model; enum dio200_layout layout; @@ -436,7 +436,7 @@ static comedi_driver driver_amplc_dio200 = { module: THIS_MODULE, attach: dio200_attach, detach: dio200_detach, - board_name: (const char**)dio200_boards, + board_name: &dio200_boards[0].name, offset: sizeof(dio200_board), num_names: sizeof(dio200_boards) / sizeof(dio200_board), }; diff --git a/comedi/drivers/amplc_pc236.c b/comedi/drivers/amplc_pc236.c index 5ba1ee95..d21c010e 100644 --- a/comedi/drivers/amplc_pc236.c +++ b/comedi/drivers/amplc_pc236.c @@ -97,7 +97,7 @@ enum pc236_bustype {isa_bustype, pci_bustype}; enum pc236_model {pc36at_model, pci236_model}; typedef struct pc236_board_struct{ - char *name; + const char *name; char *fancy_name; enum pc236_bustype bustype; enum pc236_model model; @@ -153,7 +153,7 @@ static comedi_driver driver_amplc_pc236={ module: THIS_MODULE, attach: pc236_attach, detach: pc236_detach, - board_name: (const char**)pc236_boards, + board_name: &pc236_boards[0].name, offset: sizeof(pc236_board), num_names: sizeof(pc236_boards) / sizeof(pc236_board), }; diff --git a/comedi/drivers/amplc_pc263.c b/comedi/drivers/amplc_pc263.c index ed523bf5..3f932eb1 100644 --- a/comedi/drivers/amplc_pc263.c +++ b/comedi/drivers/amplc_pc263.c @@ -67,7 +67,7 @@ enum pc263_bustype {isa_bustype, pci_bustype}; enum pc263_model {pc263_model, pci263_model}; typedef struct pc263_board_struct{ - char *name; + const char *name; char *fancy_name; enum pc263_bustype bustype; enum pc263_model model; @@ -121,7 +121,7 @@ static comedi_driver driver_amplc_pc263={ module: THIS_MODULE, attach: pc263_attach, detach: pc263_detach, - board_name: (const char**)pc263_boards, + board_name: &pc263_boards[0].name, offset: sizeof(pc263_board), num_names: sizeof(pc263_boards) / sizeof(pc263_board), }; diff --git a/comedi/drivers/amplc_pci224.c b/comedi/drivers/amplc_pci224.c index 76b68f33..696b7481 100644 --- a/comedi/drivers/amplc_pci224.c +++ b/comedi/drivers/amplc_pci224.c @@ -342,7 +342,7 @@ static unsigned short hwrange_pci234[1] = { enum pci224_model { pci224_model, pci234_model }; typedef struct pci224_board_struct { - char *name; + const char *name; enum pci224_model model; unsigned int ao_chans; unsigned int ao_bits; @@ -419,7 +419,7 @@ static comedi_driver driver_amplc_pci224 = { module: THIS_MODULE, attach: pci224_attach, detach: pci224_detach, - board_name: (const char**)pci224_boards, + board_name: &pci224_boards[0].name, offset: sizeof(pci224_board), num_names: sizeof(pci224_boards) / sizeof(pci224_board), }; diff --git a/comedi/drivers/amplc_pci230.c b/comedi/drivers/amplc_pci230.c index f4c888d1..85b20f1b 100644 --- a/comedi/drivers/amplc_pci230.c +++ b/comedi/drivers/amplc_pci230.c @@ -164,7 +164,7 @@ extra triggered scan functionality, interrupt bug-fix added by Steve Sharples */ typedef struct pci230_board_struct{ - char *name; + const char *name; unsigned short id; int ai_chans; int ai_bits; @@ -268,7 +268,7 @@ static comedi_driver driver_amplc_pci230={ module: THIS_MODULE, attach: pci230_attach, detach: pci230_detach, - board_name: (const char**)pci230_boards, + board_name: &pci230_boards[0].name, offset: sizeof(pci230_boards[0]), num_names: sizeof(pci230_boards) / sizeof(pci230_boards[0]), }; diff --git a/comedi/drivers/comedi_bond.c b/comedi/drivers/comedi_bond.c index d3ff64b9..022b0175 100644 --- a/comedi/drivers/comedi_bond.c +++ b/comedi/drivers/comedi_bond.c @@ -120,7 +120,7 @@ MODULE_DESCRIPTION(MODULE_NAME ": A driver for COMEDI to bond multiple COMEDI de */ struct BondingBoard { - char *name; + const char *name; }; typedef struct BondingBoard BondingBoard; @@ -205,7 +205,7 @@ static comedi_driver driver_bonding = { * the type of board in software. ISA PnP, PCI, and PCMCIA * devices are such boards. */ - board_name: (const char**)bondingBoards, + board_name: &bondingBoards[0].name, offset: sizeof(BondingBoard), num_names: sizeof(bondingBoards) / sizeof(BondingBoard), }; diff --git a/comedi/drivers/comedi_test.c b/comedi/drivers/comedi_test.c index 8fbd0017..d6a9d02e 100644 --- a/comedi/drivers/comedi_test.c +++ b/comedi/drivers/comedi_test.c @@ -59,7 +59,7 @@ zero volts). /* Board descriptions */ typedef struct waveform_board_struct{ - char *name; + const char *name; int ai_chans; int ai_bits; int have_dio; @@ -100,7 +100,7 @@ static comedi_driver driver_waveform={ module: THIS_MODULE, attach: waveform_attach, detach: waveform_detach, - board_name: (const char**)waveform_boards, + board_name: &waveform_boards[0].name, offset: sizeof(waveform_board), num_names: sizeof(waveform_boards) / sizeof(waveform_board), }; diff --git a/comedi/drivers/das08.c b/comedi/drivers/das08.c index 0f2b967c..82d35972 100644 --- a/comedi/drivers/das08.c +++ b/comedi/drivers/das08.c @@ -800,7 +800,7 @@ static comedi_driver driver_das08={ module: THIS_MODULE, attach: das08_attach, detach: das08_common_detach, - board_name: (const char**)(das08_boards), + board_name: &das08_boards[0].name, num_names: sizeof(das08_boards)/sizeof(struct das08_board_struct), offset: sizeof(struct das08_board_struct), }; diff --git a/comedi/drivers/das08_cs.c b/comedi/drivers/das08_cs.c index 10927c3e..0d63dd81 100644 --- a/comedi/drivers/das08_cs.c +++ b/comedi/drivers/das08_cs.c @@ -73,7 +73,7 @@ static comedi_driver driver_das08_cs = module: THIS_MODULE, attach: das08_cs_attach, detach: das08_common_detach, - board_name: das08_cs_boards, + board_name: &das08_cs_boards[0].name, num_names: sizeof(das08_cs_boards) / sizeof(struct das08_board_struct), offset: sizeof(struct das08_board_struct), }; diff --git a/comedi/drivers/das16.c b/comedi/drivers/das16.c index cb870651..f9c007f3 100644 --- a/comedi/drivers/das16.c +++ b/comedi/drivers/das16.c @@ -344,7 +344,7 @@ static unsigned int das16_suggest_transfer_size(comedi_device *dev, comedi_cmd c static void reg_dump(comedi_device *dev); typedef struct das16_board_struct{ - char *name; + const char *name; void *ai; unsigned int ai_nbits; unsigned int ai_speed; // max conversion speed in nanosec @@ -701,7 +701,7 @@ static comedi_driver driver_das16={ module: THIS_MODULE, attach: das16_attach, detach: das16_detach, - board_name: (const char**)das16_boards, + board_name: &das16_boards[0].name, num_names: n_das16_boards, offset: sizeof(das16_boards[0]), }; diff --git a/comedi/drivers/das16m1.c b/comedi/drivers/das16m1.c index 8e957a46..cf339f79 100644 --- a/comedi/drivers/das16m1.c +++ b/comedi/drivers/das16m1.c @@ -149,7 +149,7 @@ static unsigned int das16m1_set_pacer(comedi_device *dev, unsigned int ns, int r static int das16m1_irq_bits(unsigned int irq); typedef struct das16m1_board_struct{ - char *name; + const char *name; unsigned int ai_speed; }das16m1_board; @@ -169,7 +169,7 @@ static comedi_driver driver_das16m1={ module: THIS_MODULE, attach: das16m1_attach, detach: das16m1_detach, - board_name: (const char**)das16m1_boards, + board_name: &das16m1_boards[0].name, num_names: das16m1_num_boards, offset: sizeof(das16m1_boards[0]), }; diff --git a/comedi/drivers/das1800.c b/comedi/drivers/das1800.c index 15162684..aff0b521 100644 --- a/comedi/drivers/das1800.c +++ b/comedi/drivers/das1800.c @@ -231,7 +231,7 @@ static comedi_lrange range_ai_das1802 = { }; typedef struct das1800_board_struct{ - char *name; + const char *name; int ai_speed; /* max conversion period in nanoseconds */ int resolution; /* bits of ai resolution */ int qram_len; /* length of card's channel / gain queue */ @@ -499,7 +499,7 @@ static comedi_driver driver_das1800={ attach: das1800_attach, detach: das1800_detach, num_names: sizeof(das1800_boards) / sizeof(das1800_board), - board_name: (const char**)das1800_boards, + board_name: &das1800_boards[0].name, offset: sizeof(das1800_board), }; diff --git a/comedi/drivers/das800.c b/comedi/drivers/das800.c index 99d9654a..4d5fc16c 100644 --- a/comedi/drivers/das800.c +++ b/comedi/drivers/das800.c @@ -106,7 +106,7 @@ cmd triggers supported: #define DAS800_ID 7 typedef struct das800_board_struct{ - char *name; + const char *name; int ai_speed; comedi_lrange *ai_range; int resolution; @@ -251,7 +251,7 @@ static comedi_driver driver_das800={ attach: das800_attach, detach: das800_detach, num_names: sizeof(das800_boards) / sizeof(das800_board), - board_name: (const char **)das800_boards, + board_name: &das800_boards[0].name, offset: sizeof(das800_board), }; diff --git a/comedi/drivers/dmm32at.c b/comedi/drivers/dmm32at.c index e0034fb6..6f99c5ba 100644 --- a/comedi/drivers/dmm32at.c +++ b/comedi/drivers/dmm32at.c @@ -208,7 +208,7 @@ static comedi_lrange dmm32at_aoranges = * Some drivers use arrays such as this, other do not. */ typedef struct dmm32at_board_struct{ - char *name; + const char *name; int ai_chans; int ai_bits; comedi_lrange *ai_ranges; @@ -293,7 +293,7 @@ static comedi_driver driver_dmm32at={ * the type of board in software. ISA PnP, PCI, and PCMCIA * devices are such boards. */ - board_name: (const char**)dmm32at_boards, + board_name: &dmm32at_boards[0].name, offset: sizeof(dmm32at_board), num_names: sizeof(dmm32at_boards) / sizeof(dmm32at_board), }; diff --git a/comedi/drivers/dt2811.c b/comedi/drivers/dt2811.c index 5f929752..0e17e8c9 100644 --- a/comedi/drivers/dt2811.c +++ b/comedi/drivers/dt2811.c @@ -186,7 +186,7 @@ static comedi_lrange range_dt2811_pgl_ai_5_bipolar = { 4, { #define DT2811_ADMODE 0x03 typedef struct { - char *name; + const char *name; comedi_lrange *bip_5; comedi_lrange *bip_2_5; comedi_lrange *unip_5; @@ -212,7 +212,7 @@ static comedi_driver driver_dt2811={ module: THIS_MODULE, attach: dt2811_attach, detach: dt2811_detach, - board_name: (const char **)boardtypes, + board_name: &boardtypes[0].name, num_names: sizeof(boardtypes)/sizeof(boardtype), offset: sizeof(boardtype), }; diff --git a/comedi/drivers/dt282x.c b/comedi/drivers/dt282x.c index b681d301..fcfc6f80 100644 --- a/comedi/drivers/dt282x.c +++ b/comedi/drivers/dt282x.c @@ -193,7 +193,7 @@ static comedi_lrange range_dt282x_ai_hi_unipolar = { 4, { typedef struct { - char *name; + const char *name; int adbits; int adchan_se; int adchan_di; @@ -397,7 +397,7 @@ static comedi_driver driver_dt282x={ module: THIS_MODULE, attach: dt282x_attach, detach: dt282x_detach, - board_name: (const char**)boardtypes, + board_name: &boardtypes[0].name, num_names: n_boardtypes, offset: sizeof(boardtype_t), }; diff --git a/comedi/drivers/icp_multi.c b/comedi/drivers/icp_multi.c index 38c67525..b4b7b04a 100644 --- a/comedi/drivers/icp_multi.c +++ b/comedi/drivers/icp_multi.c @@ -139,7 +139,7 @@ static int icp_multi_detach(comedi_device *dev); static unsigned short pci_list_builded=0; /*>0 list of card is known */ typedef struct { - char *name; // driver name + const char *name; // driver name int device_id; int iorange; // I/O range len char have_irq; // 1=card support IRQ @@ -185,7 +185,7 @@ static comedi_driver driver_icp_multi={ attach: icp_multi_attach, detach: icp_multi_detach, num_names: n_boardtypes, - board_name: (const char**)boardtypes, + board_name: &boardtypes[0].name, offset: sizeof(boardtype), }; COMEDI_INITCLEANUP(driver_icp_multi); diff --git a/comedi/drivers/me_daq.c b/comedi/drivers/me_daq.c index 799b1b5a..0b86ad58 100644 --- a/comedi/drivers/me_daq.c +++ b/comedi/drivers/me_daq.c @@ -204,7 +204,7 @@ MODULE_DEVICE_TABLE(pci, me_pci_table); typedef struct { - char *name; // driver name + const char *name; // driver name int device_id; int ao_channel_nbr; // DA config int ao_resolution; @@ -256,7 +256,7 @@ static comedi_driver me_driver= attach: me_attach, detach: me_detach, num_names: me_board_nbr, - board_name: (const char**)me_boards, + board_name: &me_boards[0].name, offset: sizeof(me_board_struct), }; COMEDI_INITCLEANUP(me_driver); diff --git a/comedi/drivers/ni_at_ao.c b/comedi/drivers/ni_at_ao.c index 52984926..997b5545 100644 --- a/comedi/drivers/ni_at_ao.c +++ b/comedi/drivers/ni_at_ao.c @@ -153,7 +153,7 @@ Configuration options: * Some drivers use arrays such as this, other do not. */ typedef struct atao_board_struct{ - char *name; + const char *name; int n_ao_chans; }atao_board; static atao_board atao_boards[] = { @@ -185,7 +185,7 @@ static comedi_driver driver_atao={ module: THIS_MODULE, attach: atao_attach, detach: atao_detach, - board_name: (const char**)atao_boards, + board_name: &atao_boards[0].name, offset: sizeof(atao_board), num_names: sizeof(atao_boards) / sizeof(atao_board), }; diff --git a/comedi/drivers/ni_atmio16d.c b/comedi/drivers/ni_atmio16d.c index bc3850bd..dcb72931 100644 --- a/comedi/drivers/ni_atmio16d.c +++ b/comedi/drivers/ni_atmio16d.c @@ -106,7 +106,7 @@ Devices: [National Instruments] AT-MIO-16 (atmio16), AT-MIO-16D (atmio16d) typedef struct{ - char *name; + const char *name; int has_8255; }atmio16_board_t; static atmio16_board_t atmio16_boards[]={ @@ -140,7 +140,7 @@ static comedi_driver driver_atmio16d={ module: THIS_MODULE, attach: atmio16d_attach, detach: atmio16d_detach, - board_name: (const char**)atmio16_boards, + board_name: &atmio16_boards[0].name, num_names: n_atmio16_boards, offset: sizeof(atmio16_board_t), }; diff --git a/comedi/drivers/ni_daq_dio24.c b/comedi/drivers/ni_daq_dio24.c index 1e480983..a3478b38 100644 --- a/comedi/drivers/ni_daq_dio24.c +++ b/comedi/drivers/ni_daq_dio24.c @@ -73,7 +73,7 @@ static int dio24_detach(comedi_device *dev); enum dio24_bustype {pcmcia_bustype}; typedef struct dio24_board_struct{ - char *name; + const char *name; int device_id; // device id for pcmcia board enum dio24_bustype bustype; // PCMCIA int have_dio; // have 8255 chip @@ -116,7 +116,7 @@ static comedi_driver driver_dio24={ attach: dio24_attach, detach: dio24_detach, num_names: sizeof(dio24_boards) / sizeof(dio24_board), - board_name: (char **)dio24_boards, + board_name: &dio24_boards[0].name, offset: sizeof(dio24_board), }; diff --git a/comedi/drivers/ni_labpc.c b/comedi/drivers/ni_labpc.c index c2570a99..e4e11678 100644 --- a/comedi/drivers/ni_labpc.c +++ b/comedi/drivers/ni_labpc.c @@ -446,7 +446,7 @@ static comedi_driver driver_labpc={ attach: labpc_attach, detach: labpc_common_detach, num_names: sizeof(labpc_boards) / sizeof(labpc_board), - board_name: (const char **)labpc_boards, + board_name: &labpc_boards[0].name, offset: sizeof(labpc_board), }; diff --git a/comedi/drivers/ni_labpc.h b/comedi/drivers/ni_labpc.h index e2aa49ef..59a10bda 100644 --- a/comedi/drivers/ni_labpc.h +++ b/comedi/drivers/ni_labpc.h @@ -32,7 +32,7 @@ enum labpc_register_layout {labpc_plus_layout, labpc_1200_layout}; enum transfer_type {fifo_not_empty_transfer, fifo_half_full_transfer, isa_dma_transfer}; typedef struct labpc_board_struct{ - char *name; + const char *name; int device_id; // device id for pci and pcmcia boards int ai_speed; // maximum input speed in nanoseconds enum labpc_bustype bustype; // ISA/PCI/etc. diff --git a/comedi/drivers/ni_labpc_cs.c b/comedi/drivers/ni_labpc_cs.c index 742c0280..3128285f 100644 --- a/comedi/drivers/ni_labpc_cs.c +++ b/comedi/drivers/ni_labpc_cs.c @@ -103,7 +103,7 @@ static comedi_driver driver_labpc_cs = .attach = &labpc_attach, .detach = &labpc_common_detach, .num_names = sizeof(labpc_cs_boards) / sizeof(labpc_board), - .board_name = (char **)labpc_cs_boards, + .board_name = &labpc_cs_boards[0].name, .offset = sizeof(labpc_board), }; diff --git a/comedi/drivers/ni_pcidio.c b/comedi/drivers/ni_pcidio.c index 8f50219b..f7b7de35 100644 --- a/comedi/drivers/ni_pcidio.c +++ b/comedi/drivers/ni_pcidio.c @@ -521,8 +521,6 @@ static irqreturn_t nidio_interrupt(int irq, void *d PT_REGS_ARG) //mite_dump_regs(mite); if(m_status & CHSR_INT){ if(m_status & CHSR_LINKC){ - int retval; - writel(CHOR_CLRLC, mite->mite_io_addr + MITE_CHOR(devpriv->di_mite_chan->channel)); mite_sync_input_dma(devpriv->di_mite_chan, s->async); /* XXX need to byteswap */ diff --git a/comedi/drivers/pcl711.c b/comedi/drivers/pcl711.c index 0bc2971e..53cd0c51 100644 --- a/comedi/drivers/pcl711.c +++ b/comedi/drivers/pcl711.c @@ -132,7 +132,7 @@ static comedi_lrange range_acl8112dg_ai = { 9, { static int i8253_osc_base = 500; /* 2 Mhz */ typedef struct { - char *name; + const char *name; int is_pcl711b; int is_8112; int is_dg; @@ -160,7 +160,7 @@ static comedi_driver driver_pcl711={ module: THIS_MODULE, attach: pcl711_attach, detach: pcl711_detach, - board_name: (const char**)boardtypes, + board_name: &boardtypes[0].name, num_names: n_boardtypes, offset: sizeof(boardtype), }; diff --git a/comedi/drivers/pcl724.c b/comedi/drivers/pcl724.c index ac307e85..c26127a1 100644 --- a/comedi/drivers/pcl724.c +++ b/comedi/drivers/pcl724.c @@ -60,7 +60,7 @@ static int pcl724_attach(comedi_device *dev,comedi_devconfig *it); static int pcl724_detach(comedi_device *dev); typedef struct { - char *name; // driver name + const char *name; // board name int dio; // num of DIO int numofports; // num of 8255 subdevices unsigned int IRQbits; // allowed interrupts @@ -87,7 +87,7 @@ static comedi_driver driver_pcl724={ module: THIS_MODULE, attach: pcl724_attach, detach: pcl724_detach, - board_name: (const char**)boardtypes, + board_name: &boardtypes[0].name, num_names: n_boardtypes, offset: sizeof(boardtype), }; diff --git a/comedi/drivers/pcl726.c b/comedi/drivers/pcl726.c index abc43ca5..d9d6c24f 100644 --- a/comedi/drivers/pcl726.c +++ b/comedi/drivers/pcl726.c @@ -117,7 +117,7 @@ static int pcl726_attach(comedi_device *dev,comedi_devconfig *it); static int pcl726_detach(comedi_device *dev); typedef struct { - char *name; // driver name + const char *name; // driver name int n_aochan; // num of D/A chans int num_of_ranges; // num of ranges unsigned int IRQbits; // allowed interrupts @@ -156,7 +156,7 @@ static comedi_driver driver_pcl726={ module: THIS_MODULE, attach: pcl726_attach, detach: pcl726_detach, - board_name: (const char**)boardtypes, + board_name: &boardtypes[0].name, num_names: n_boardtypes, offset: sizeof(boardtype), }; diff --git a/comedi/drivers/pcl730.c b/comedi/drivers/pcl730.c index 3bdf2c1c..94ca5d60 100644 --- a/comedi/drivers/pcl730.c +++ b/comedi/drivers/pcl730.c @@ -29,7 +29,7 @@ static int pcl730_attach(comedi_device *dev,comedi_devconfig *it); static int pcl730_detach(comedi_device *dev); typedef struct { - char *name; // driver name + const char *name; // board name unsigned int io_range; // len of I/O space } boardtype; @@ -47,7 +47,7 @@ static comedi_driver driver_pcl730 = { module: THIS_MODULE, attach: pcl730_attach, detach: pcl730_detach, - board_name: (const char**)boardtypes, + board_name: &boardtypes[0].name, num_names: n_boardtypes, offset: sizeof(boardtype), }; diff --git a/comedi/drivers/pcl812.c b/comedi/drivers/pcl812.c index e721abaa..0b7b5a91 100644 --- a/comedi/drivers/pcl812.c +++ b/comedi/drivers/pcl812.c @@ -284,7 +284,7 @@ static int pcl812_detach(comedi_device *dev); typedef struct { - char *name; // driver name + const char *name; // board name int board_type; // type of this board int n_aichan; // num of AI chans in S.E. int n_aichan_diff; // DIFF num of chans @@ -368,7 +368,7 @@ static comedi_driver driver_pcl812={ module: THIS_MODULE, attach: pcl812_attach, detach: pcl812_detach, - board_name: (const char**)boardtypes, + board_name: &boardtypes[0].name, num_names: n_boardtypes, offset: sizeof(boardtype), }; diff --git a/comedi/drivers/pcl816.c b/comedi/drivers/pcl816.c index 80e5a04d..2ee3c1a0 100644 --- a/comedi/drivers/pcl816.c +++ b/comedi/drivers/pcl816.c @@ -105,7 +105,7 @@ static comedi_lrange range_pcl816 = { 8, { } }; typedef struct { - char *name; // driver name + const char *name; // board name int n_ranges; // len of range list int n_aichan; // num of A/D chans in diferencial mode unsigned int ai_ns_min; // minimal alllowed delay between samples (in ns) @@ -163,7 +163,7 @@ static comedi_driver driver_pcl816 = { module: THIS_MODULE, attach: pcl816_attach, detach: pcl816_detach, - board_name: (const char**)boardtypes, + board_name: &boardtypes[0].name, num_names: n_boardtypes, offset: sizeof(boardtype), }; diff --git a/comedi/drivers/pcl818.c b/comedi/drivers/pcl818.c index 0ae5596f..5f890161 100644 --- a/comedi/drivers/pcl818.c +++ b/comedi/drivers/pcl818.c @@ -249,7 +249,7 @@ static int RTC_timer_lock = 0; /* RTC int lock */ #endif typedef struct { - char *name; // driver name + const char *name; // driver name int n_ranges; // len of range list int n_aichan_se; // num of A/D chans in single ended mode int n_aichan_diff; // num of A/D chans in diferencial mode @@ -294,7 +294,7 @@ static comedi_driver driver_pcl818={ module: THIS_MODULE, attach: pcl818_attach, detach: pcl818_detach, - board_name: (const char**)boardtypes, + board_name: &boardtypes[0].name, num_names: n_boardtypes, offset: sizeof(boardtype), }; diff --git a/comedi/drivers/pcm3724.c b/comedi/drivers/pcm3724.c index 40ba9bab..ddbdf547 100644 --- a/comedi/drivers/pcm3724.c +++ b/comedi/drivers/pcm3724.c @@ -66,7 +66,7 @@ static int pcm3724_attach(comedi_device *dev,comedi_devconfig *it); static int pcm3724_detach(comedi_device *dev); typedef struct { - char *name; // driver name + const char *name; // driver name int dio; // num of DIO int numofports; // num of 8255 subdevices unsigned int IRQbits; // allowed interrupts @@ -91,7 +91,7 @@ static comedi_driver driver_pcm3724={ module: THIS_MODULE, attach: pcm3724_attach, detach: pcm3724_detach, - board_name: (const char**)boardtypes, + board_name: &boardtypes[0].name, num_names: n_boardtypes, offset: sizeof(boardtype), }; diff --git a/comedi/drivers/pcmad.c b/comedi/drivers/pcmad.c index 17d7fcb7..53bbfc9b 100644 --- a/comedi/drivers/pcmad.c +++ b/comedi/drivers/pcmad.c @@ -55,7 +55,7 @@ Configuration options: #define PCMAD_CONVERT 1 struct pcmad_board_struct{ - char *name; + const char *name; int n_ai_bits; }; static struct pcmad_board_struct pcmad_boards[]={ @@ -84,7 +84,7 @@ static comedi_driver driver_pcmad={ module: THIS_MODULE, attach: pcmad_attach, detach: pcmad_detach, - board_name: (const char**)pcmad_boards, + board_name: &pcmad_boards[0].name, num_names: n_pcmad_boards, offset: sizeof(pcmad_boards[0]), }; diff --git a/comedi/drivers/pcmda12.c b/comedi/drivers/pcmda12.c index 395f7f54..464211e8 100644 --- a/comedi/drivers/pcmda12.c +++ b/comedi/drivers/pcmda12.c @@ -71,7 +71,7 @@ Configuration Options: */ typedef struct pcmda12_board_struct { - char * const name; + const char * const name; } pcmda12_board; /* note these have no effect and are merely here for reference.. @@ -139,7 +139,7 @@ static comedi_driver driver = * the type of board in software. ISA PnP, PCI, and PCMCIA * devices are such boards. */ - board_name: (const char**)pcmda12_boards, + board_name: &pcmda12_boards[0].name, offset: sizeof(pcmda12_board), num_names: sizeof(pcmda12_boards) / sizeof(pcmda12_board), }; diff --git a/comedi/drivers/pcmmio.c b/comedi/drivers/pcmmio.c index d15b5aec..3edce8ba 100644 --- a/comedi/drivers/pcmmio.c +++ b/comedi/drivers/pcmmio.c @@ -153,7 +153,7 @@ static int ao_winsn(comedi_device *, comedi_subdevice *, comedi_insn *, lsampl_t */ typedef struct pcmmio_board_struct { - char * const name; + const char * const name; const int dio_num_asics; const int dio_num_ports; const int total_iosize; @@ -181,16 +181,16 @@ static pcmmio_board pcmmio_boards[] = name: "pcmmio", dio_num_asics: 1, dio_num_ports: 6, - total_iosize: 32, - ai_bits: 16, - ao_bits: 16, - n_ai_chans: 16, - n_ao_chans: 8, - ai_range_table: (comedi_lrange *)&ranges_ai, - ao_range_table: (comedi_lrange *)&ranges_ao, - ai_rinsn: ai_rinsn, - ao_rinsn: ao_rinsn, - ao_winsn: ao_winsn + total_iosize: 32, + ai_bits: 16, + ao_bits: 16, + n_ai_chans: 16, + n_ao_chans: 8, + ai_range_table: (comedi_lrange *)&ranges_ai, + ao_range_table: (comedi_lrange *)&ranges_ao, + ai_rinsn: ai_rinsn, + ao_rinsn: ao_rinsn, + ao_winsn: ao_winsn }, }; @@ -294,7 +294,7 @@ static comedi_driver driver = * the type of board in software. ISA PnP, PCI, and PCMCIA * devices are such boards. */ - board_name: (const char **)pcmmio_boards, + board_name: &pcmmio_boards[0].name, offset: sizeof(pcmmio_board), num_names: sizeof(pcmmio_boards) / sizeof(pcmmio_board), }; diff --git a/comedi/drivers/pcmuio.c b/comedi/drivers/pcmuio.c index 71840663..b63f452c 100644 --- a/comedi/drivers/pcmuio.c +++ b/comedi/drivers/pcmuio.c @@ -149,7 +149,7 @@ Configuration Options: */ typedef struct pcmuio_board_struct { - char * const name; + const char * const name; const int num_asics; const int num_channels_per_port; const int num_ports; @@ -255,7 +255,7 @@ static comedi_driver driver = * the type of board in software. ISA PnP, PCI, and PCMCIA * devices are such boards. */ - board_name: (const char**)pcmuio_boards, + board_name: &pcmuio_boards[0].name, offset: sizeof(pcmuio_board), num_names: sizeof(pcmuio_boards) / sizeof(pcmuio_board), }; diff --git a/comedi/drivers/poc.c b/comedi/drivers/poc.c index a3061982..712e9712 100644 --- a/comedi/drivers/poc.c +++ b/comedi/drivers/poc.c @@ -52,7 +52,7 @@ static int pcl734_insn_bits(comedi_device *dev,comedi_subdevice *s, comedi_insn *insn,lsampl_t *data); struct boarddef_struct{ - char *name; + const char *name; unsigned int iosize; int (*setup)(comedi_device *); int type; @@ -103,7 +103,7 @@ static comedi_driver driver_poc= module: THIS_MODULE, attach: poc_attach, detach: poc_detach, - board_name: (const char**)boards, + board_name: &boards[0].name, num_names: n_boards, offset: sizeof(boards[0]), }; diff --git a/comedi/drivers/rtd520.c b/comedi/drivers/rtd520.c index 2e58b512..03f15b98 100644 --- a/comedi/drivers/rtd520.c +++ b/comedi/drivers/rtd520.c @@ -265,7 +265,7 @@ static comedi_lrange rtd_ao_range = { 4, { Board descriptions */ typedef struct rtdBoard_struct{ - char *name; /* must be first */ + const char *name; /* must be first */ int device_id; int aiChans; int aiBits; @@ -713,7 +713,7 @@ static comedi_driver rtd520Driver={ module: THIS_MODULE, attach: rtd_attach, detach: rtd_detach, - board_name: (const char**)rtd520Boards, + board_name: &rtd520Boards[0].name, offset: sizeof(rtdBoard), num_names: sizeof(rtd520Boards) / sizeof(rtdBoard), }; diff --git a/comedi/drivers/rti800.c b/comedi/drivers/rti800.c index c9b62305..83b13289 100644 --- a/comedi/drivers/rti800.c +++ b/comedi/drivers/rti800.c @@ -117,7 +117,7 @@ static comedi_lrange range_rti800_ai_unipolar = { 4, { }}; typedef struct{ - char *name; + const char *name; int has_ao; }boardtype; static boardtype boardtypes[]={ @@ -134,7 +134,7 @@ static comedi_driver driver_rti800={ attach: rti800_attach, detach: rti800_detach, num_names: sizeof(boardtypes)/sizeof(boardtype), - board_name: (const char**)boardtypes, + board_name: &boardtypes[0].name, offset: sizeof(boardtype), }; COMEDI_INITCLEANUP(driver_rti800); diff --git a/comedi/drivers/s526.c b/comedi/drivers/s526.c index 4f8d1bd2..a6a9c09f 100644 --- a/comedi/drivers/s526.c +++ b/comedi/drivers/s526.c @@ -167,7 +167,7 @@ static unsigned short s526_ai_config = 0; * Some drivers use arrays such as this, other do not. */ typedef struct s526_board_struct{ - char *name; + const char *name; int gpct_chans; int gpct_bits; int ad_chans; @@ -247,7 +247,7 @@ static comedi_driver driver_s526={ * the type of board in software. ISA PnP, PCI, and PCMCIA * devices are such boards. */ - board_name: (const char**)s526_boards, + board_name: &s526_boards[0].name, offset: sizeof(s526_board), num_names: sizeof(s526_boards) / sizeof(s526_board), }; diff --git a/comedi/drivers/skel.c b/comedi/drivers/skel.c index b8f9e402..7de3a0a8 100644 --- a/comedi/drivers/skel.c +++ b/comedi/drivers/skel.c @@ -90,7 +90,7 @@ Configuration Options: * Some drivers use arrays such as this, other do not. */ typedef struct skel_board_struct{ - char *name; + const char *name; int ai_chans; int ai_bits; int have_dio; @@ -176,7 +176,7 @@ static comedi_driver driver_skel={ * the type of board in software. ISA PnP, PCI, and PCMCIA * devices are such boards. */ - board_name: (const char**)skel_boards, + board_name: &skel_boards[0].name, offset: sizeof(skel_board), num_names: sizeof(skel_boards) / sizeof(skel_board), }; diff --git a/comedi/drivers/ssv_dnp.c b/comedi/drivers/ssv_dnp.c index 676b859a..96a1192b 100644 --- a/comedi/drivers/ssv_dnp.c +++ b/comedi/drivers/ssv_dnp.c @@ -55,7 +55,7 @@ Status: unknown /* This data structure holds information about the supported boards -------- */ typedef struct dnp_board_struct{ - char *name; + const char *name; int ai_chans; int ai_bits; int have_dio; @@ -100,7 +100,7 @@ static comedi_driver driver_dnp = { module: THIS_MODULE, attach: dnp_attach, detach: dnp_detach, - board_name: (const char**)dnp_boards, /* only necessary for non-PnP devs */ + board_name: &dnp_boards[0].name, /* only necessary for non-PnP devs */ offset: sizeof(dnp_board), /* like ISA-PnP, PCI or PCMCIA. */ num_names: sizeof(dnp_boards) / sizeof(dnp_board), }; diff --git a/include/linux/comedidev.h b/include/linux/comedidev.h index ea29b5ee..4b7b4177 100644 --- a/include/linux/comedidev.h +++ b/include/linux/comedidev.h @@ -206,7 +206,7 @@ struct comedi_driver_struct{ /* number of elements in board_name and board_id arrays */ unsigned int num_names; - const char **board_name; + const char * const *board_name; /* offset in bytes from one board name pointer to the next */ int offset; };