Re: [PATCH 0/2] staging: comedi: introduce, and use, comedi_alloc_devpriv()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[Originally posted 2013-06-25.  Reposting to new driverdev-devel list.]

On 2013-06-25 00:54, H Hartley Sweeten wrote:
The comedi core automatically kfree()'s the device private data during
the (*detach) of the drivers. The kzalloc() in the drivers produces a
smatch warning due to the missing kfree() in the error paths.

Introduce a helper function to handle the device private data allocation
and to automatically set the dev->private pointer for the drivers. This
should quite the smatch warnings. It also removes the <linux/slab.h>
dependency from most of the drivers.

H Hartley Sweeten (2):
   staging: comedi: drivers: introduce comedi_alloc_devpriv()
   staging: comedi: use comedi_alloc_devpriv()

  drivers/staging/comedi/comedidev.h                     |  2 +-
  drivers/staging/comedi/drivers.c                       | 12 ++++++++++++
  drivers/staging/comedi/drivers/8255_pci.c              |  3 +--
  drivers/staging/comedi/drivers/addi-data/addi_common.c |  3 +--
  drivers/staging/comedi/drivers/addi_apci_1032.c        |  3 +--
  drivers/staging/comedi/drivers/addi_apci_1516.c        |  3 +--
  drivers/staging/comedi/drivers/addi_apci_1710.c        |  3 +--
  drivers/staging/comedi/drivers/addi_apci_3120.c        |  3 +--
  drivers/staging/comedi/drivers/addi_apci_3501.c        |  3 +--
  drivers/staging/comedi/drivers/addi_apci_3xxx.c        |  3 +--
  drivers/staging/comedi/drivers/adl_pci6208.c           |  3 +--
  drivers/staging/comedi/drivers/adl_pci9111.c           |  3 +--
  drivers/staging/comedi/drivers/adl_pci9118.c           |  6 ++----
  drivers/staging/comedi/drivers/adq12b.c                |  3 +--
  drivers/staging/comedi/drivers/adv_pci1710.c           |  3 +--
  drivers/staging/comedi/drivers/adv_pci1723.c           |  3 +--
  drivers/staging/comedi/drivers/adv_pci1724.c           |  3 +--
  drivers/staging/comedi/drivers/adv_pci_dio.c           |  3 +--
  drivers/staging/comedi/drivers/aio_aio12_8.c           |  3 +--
  drivers/staging/comedi/drivers/amplc_dio200.c          |  5 +----
  drivers/staging/comedi/drivers/amplc_dio200_common.c   |  1 -
  drivers/staging/comedi/drivers/amplc_dio200_pci.c      |  4 +---
  drivers/staging/comedi/drivers/amplc_pc236.c           |  6 ++----
  drivers/staging/comedi/drivers/amplc_pci224.c          |  7 ++-----
  drivers/staging/comedi/drivers/amplc_pci230.c          |  3 +--
  drivers/staging/comedi/drivers/cb_das16_cs.c           |  4 +---
  drivers/staging/comedi/drivers/cb_pcidas.c             |  3 +--
  drivers/staging/comedi/drivers/cb_pcidas64.c           |  3 +--
  drivers/staging/comedi/drivers/cb_pcidda.c             |  3 +--
  drivers/staging/comedi/drivers/cb_pcimdas.c            |  3 +--
  drivers/staging/comedi/drivers/cb_pcimdda.c            |  3 +--
  drivers/staging/comedi/drivers/comedi_bond.c           |  3 +--
  drivers/staging/comedi/drivers/comedi_parport.c        |  3 +--
  drivers/staging/comedi/drivers/comedi_test.c           |  3 +--
  drivers/staging/comedi/drivers/daqboard2000.c          |  3 +--
  drivers/staging/comedi/drivers/das08_cs.c              |  4 +---
  drivers/staging/comedi/drivers/das08_isa.c             |  3 +--
  drivers/staging/comedi/drivers/das08_pci.c             |  3 +--
  drivers/staging/comedi/drivers/das16.c                 |  4 +---
  drivers/staging/comedi/drivers/das16m1.c               |  3 +--
  drivers/staging/comedi/drivers/das1800.c               |  3 +--
  drivers/staging/comedi/drivers/das6402.c               |  3 +--
  drivers/staging/comedi/drivers/das800.c                |  3 +--
  drivers/staging/comedi/drivers/dmm32at.c               |  3 +--
  drivers/staging/comedi/drivers/dt2801.c                |  3 +--
  drivers/staging/comedi/drivers/dt2811.c                |  3 +--
  drivers/staging/comedi/drivers/dt2814.c                |  3 +--
  drivers/staging/comedi/drivers/dt2815.c                |  3 +--
  drivers/staging/comedi/drivers/dt282x.c                |  3 +--
  drivers/staging/comedi/drivers/dt3000.c                |  3 +--
  drivers/staging/comedi/drivers/dt9812.c                |  4 +---
  drivers/staging/comedi/drivers/dyna_pci10xx.c          |  3 +--
  drivers/staging/comedi/drivers/fl512.c                 |  3 +--
  drivers/staging/comedi/drivers/gsc_hpdi.c              |  3 +--
  drivers/staging/comedi/drivers/icp_multi.c             |  3 +--
  drivers/staging/comedi/drivers/ii_pci20kc.c            |  3 +--
  drivers/staging/comedi/drivers/jr3_pci.c               |  3 +--
  drivers/staging/comedi/drivers/me4000.c                |  3 +--
  drivers/staging/comedi/drivers/me_daq.c                |  3 +--
  drivers/staging/comedi/drivers/mpc624.c                |  3 +--
  drivers/staging/comedi/drivers/multiq3.c               |  3 +--
  drivers/staging/comedi/drivers/ni_6527.c               |  3 +--
  drivers/staging/comedi/drivers/ni_65xx.c               |  4 +---
  drivers/staging/comedi/drivers/ni_660x.c               |  3 +--
  drivers/staging/comedi/drivers/ni_670x.c               |  4 +---
  drivers/staging/comedi/drivers/ni_at_a2150.c           |  3 +--
  drivers/staging/comedi/drivers/ni_at_ao.c              |  3 +--
  drivers/staging/comedi/drivers/ni_atmio16d.c           |  3 +--
  drivers/staging/comedi/drivers/ni_daq_700.c            |  1 -
  drivers/staging/comedi/drivers/ni_labpc.c              |  3 +--
  drivers/staging/comedi/drivers/ni_labpc_cs.c           |  4 +---
  drivers/staging/comedi/drivers/ni_labpc_pci.c          |  4 +---
  drivers/staging/comedi/drivers/ni_mio_common.c         |  3 +--
  drivers/staging/comedi/drivers/ni_pcidio.c             |  3 +--
  drivers/staging/comedi/drivers/ni_tio.c                |  2 ++
  drivers/staging/comedi/drivers/pcl711.c                |  3 +--
  drivers/staging/comedi/drivers/pcl726.c                |  3 +--
  drivers/staging/comedi/drivers/pcl812.c                |  3 +--
  drivers/staging/comedi/drivers/pcl816.c                |  3 +--
  drivers/staging/comedi/drivers/pcl818.c                |  3 +--
  drivers/staging/comedi/drivers/pcm3724.c               |  3 +--
  drivers/staging/comedi/drivers/pcmda12.c               |  3 +--
  drivers/staging/comedi/drivers/pcmmio.c                |  3 +--
  drivers/staging/comedi/drivers/pcmuio.c                |  3 +--
  drivers/staging/comedi/drivers/poc.c                   |  3 +--
  drivers/staging/comedi/drivers/quatech_daqp_cs.c       |  3 +--
  drivers/staging/comedi/drivers/rtd520.c                |  3 +--
  drivers/staging/comedi/drivers/rti800.c                |  3 +--
  drivers/staging/comedi/drivers/rti802.c                |  3 +--
  drivers/staging/comedi/drivers/s526.c                  |  3 +--
  drivers/staging/comedi/drivers/s626.c                  |  3 +--
  drivers/staging/comedi/drivers/s626.h                  |  2 --
  drivers/staging/comedi/drivers/serial2002.c            |  3 +--
  drivers/staging/comedi/drivers/skel.c                  |  6 ++----
  drivers/staging/comedi/drivers/unioxx5.c               |  1 -
  drivers/staging/comedi/drivers/usbduxfast.c            |  3 +--
  drivers/staging/comedi/drivers/usbduxsigma.c           |  3 +--
  drivers/staging/comedi/drivers/vmk80xx.c               |  3 +--
  98 files changed, 110 insertions(+), 208 deletions(-)


Looks good!

Reviewed-by: Ian Abbott <abbotti@xxxxxxxxx>

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@xxxxxxxxx>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux