1. 28 Aug, 2013 15 commits
  2. 27 Aug, 2013 14 commits
  3. 26 Aug, 2013 11 commits
    • Lidza Louina's avatar
      staging: dgnc: tty.c: edits var in init func for sparse · e7f1c932
      Lidza Louina authored
      This patch edits the vaddr variable in dgnc_tty_init.
      The variable gets set to board_t->re_map_membase. A
      previous patch changed the re_map_membase variable's
      marker and type. This patch makes sure that the
      changes are consistent and that it doesn't cause
      sparse warnings.
      Signed-off-by: default avatarLidza Louina <lidza.louina@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e7f1c932
    • Lidza Louina's avatar
      staging: dgnc: neo.c: changes param in neo_read_eeprom function for sparse · c2ac546e
      Lidza Louina authored
      This patch adds a marker to neo_read_eeprom function's
      base parameter.
      
      It removes these warnings found in neo.c:
      
      warning: incorrect type in argument 1 (different address spaces)
        expected unsigned char *base
        got unsigned char [noderef] [usertype] <asn:2>*re_map_membase
      warning: incorrect type in argument 2 (different address spaces)
        expected void volatile [noderef] <asn:2>*addr
        got unsigned char *
      
      These warnings happen because this function gets
      called with a board_t->re_map_base variable. A previous
      patch added the __iomem marker to this variable. This
      patch ensures that the changes are consistent.
      Signed-off-by: default avatarLidza Louina <lidza.louina@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c2ac546e
    • Lidza Louina's avatar
      staging: dgnc: cls.c: changes var in cls_vpd function for sparse · 68b146e8
      Lidza Louina authored
      This patch changes cls_vpd function's re_map_vpdbase variable
      type and marker.
      
      It removes these warnings found in cls.c:
      
      warning: incorrect type in assignment (different address spaces)
        expected unsigned char [usertype] *re_map_vpdbase
        got void [noderef] <asn:2>*
      warning: incorrect type in argument 1 (different address spaces)
        expected void const volatile [noderef] <asn:2>*addr
        got unsigned char [usertype] *
      warning: incorrect type in argument 1 (different address spaces)
        expected void volatile [noderef] <asn:2>*addr
        got unsigned char [usertype] *re_map_vpdbase
      
      The variables passed to readb needs to be of type u8
      with a __iomem marker. re_map_vpdbase is passed into
      readb in the code.
      Signed-off-by: default avatarLidza Louina <lidza.louina@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      68b146e8
    • Lidza Louina's avatar
      staging: dgnc: driver.h: changes a struct board_t var's type and marker for sparse · 7915dea7
      Lidza Louina authored
      This patch changes the board_t->re_map_membase variable
      type and marker.
      
      It removes these warnings found in the neo.c,
      driver.c and cls.c files:
      
      warning: incorrect type in argument 1 (different address spaces)
        expected void const volatile [noderef] <asn:2>*addr
        got unsigned char volatile *<noident>
      warning: incorrect type in argument 2 (different address spaces)
        expected void volatile [noderef] <asn:2>*addr
        got unsigned char volatile *<noident>
      
      The variables passed to readb and writeb need to
      be of type u8 with a __iomem marker. These warnings
      were popping up everytime the readb and writeb
      functions were called with a
      board_t->re_map_membase variable.
      
      The change made to the driver.h file adds the marker
      and changes the variable type.
      Signed-off-by: default avatarLidza Louina <lidza.louina@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7915dea7
    • Lidza Louina's avatar
      staging: dgnc: neo_uart_struct: adds marker and changes vars' types for sparse · 2587771a
      Lidza Louina authored
      This patch fixes these warnings found in the neo.c file:
      
      warning: incorrect type in argument 1 (different address spaces)
        expected void const volatile [noderef] <asn:2>*addr
        got unsigned char volatile *<noident>
      warning: incorrect type in argument 2 (different address spaces)
        expected void volatile [noderef] <asn:2>*addr
        got unsigned char volatile *<noident>
      
      The variables passed to readb and writeb need to
      be of type u8 with a __iomem marker. These warnings
      were popping up everytime the readb and writeb
      functions were called with a neo_uart_struct variable.
      
      The change made to the driver.h file adds the marker
      to the neo_uart_struct and the changes in neo.h
      changes the variables' types.
      Signed-off-by: default avatarLidza Louina <lidza.louina@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2587771a
    • Lidza Louina's avatar
      staging: dgnc: cls_uart_struct: adds marker and changes vars' types for sparse · 2ea550bd
      Lidza Louina authored
      This patch removes these sparse warnings found in the cls.c file:
      
      warning: incorrect type in argument 1 (different address spaces)
        expected void const volatile [noderef] <asn:2>*addr
        got unsigned char volatile *<noident>
      warning: incorrect type in argument 2 (different address spaces)
        expected void volatile [noderef] <asn:2>*addr
        got unsigned char volatile *<noident>
      
      The variables passed to readb and writeb need to
      be of type u8 with a __iomem marker. These warnings
      were popping up everytime the readb and writeb
      functions were called with a cls_uart_struct variable.
      
      The change made to the driver.h file adds the marker
      to the cls_uart_struct and the changes in cls.h
      changes its variables' types.
      Signed-off-by: default avatarLidza Louina <lidza.louina@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2ea550bd
    • Greg Kroah-Hartman's avatar
      staging: usbip: use DEVICE_ATTR_RO/RW for sysfs attributes · b1f56aca
      Greg Kroah-Hartman authored
      It's easier to audit the sysfs files if they use the RO/RW macros, so
      convert the usbip code to them.
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b1f56aca
    • Ian Abbott's avatar
      staging: comedi: comedi_bond: use correct minor device numbers in name · 7322b320
      Ian Abbott authored
      The board name for "comedi_bond" is constructed from a space-separated
      list of items of the form "minor:subdevice" where "minor" is a minor
      device number and "subdevice" is a subdevice number.  Currently, all the
      "minor" device numbers are for the "comedi_bond" device itself and the
      "subdevice" numbers are for the bonded devices.  It makes makes more
      sense for the "minor" device numbers to come from the bonded devices as
      well so that the string is a list of bonded "minor:subdevice" pairs.
      Fix it.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7322b320
    • Ian Abbott's avatar
      staging: comedi: comedi_bond: use krealloc() and fix memory leak · a55de0f4
      Ian Abbott authored
      `do_dev_config()` is called from the comedi 'attach' handler,
      `bonding_attach()`.  The device private data structure contains a
      dynamically allocated array of pointers to "bonded" device structures
      which grows during the `do_dev_config()` call.  The length of this array
      is in `devpriv->ndevs`.  It currently uses a local function `realloc()`
      to allocate a new array, copy the old contents over and free the old
      array.  It should be more efficient to use `krealloc()` as it may be
      able to use slack space at the end of the previous array and avoid a
      copy.
      
      The old `realloc()` function always freed the old buffer which meant
      that if it failed to allocate the new buffer it would lose the contents
      of the old buffer.  Unfortunately, that contained pointers to more
      dynamically allocated memory, leading to a memory leak.  If `krealloc()`
      fails, keep the old buffer and avoid the memory leak.  The
      aforementioned pointers to more dynamically allocated memory will be
      cleaned up by the 'detach' handler, `bonding_detach()` which will be
      called by the comedi core as a consequence of `krealloc()` failing in
      `do_dev_config()`.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a55de0f4
    • Ian Abbott's avatar
      staging: comedi: comedi_bond: handle base channel for insn_bits · 0f3ce1a6
      Ian Abbott authored
      If a DIO subdevice has more than 32 channels, its 'insn_bits' handler is
      supposed to take account of the base channel from
      `CR_CHAN(insn->chanspec)`.  (The comedi core will adjust the base
      channel to 0 and shift the mask and data to compensate if the subdevice
      has less than or equal to 32 channels.)  The "comedi_bond" driver
      currently ignores the base channel and assumes it is 0.
      
      Replace `comedi_dio_bitfield()` in the "kcomedilib" module with
      `comedi_dio_bitfield2()` that takes account of the base channel, and
      rewrite the "comedi_bond" driver's 'insn_bits' handler
      (`bonding_dio_insn_bits()`) to take account of the base channel and use
      the new function.
      
      No other modules use `comedi_dio_bitfield()` so it is safe to replace it
      with `comedi_dio_bitfield2()`.  The name follows that of the equivalent
      function in the user-space comedilib.  If the base channel is non-zero
      and the subdevice has less than or equal to 32 channels it needs to
      adjust things in the same way as the comedi core (same as `parse_insn()`
      in "comedi_fops.c") due to most drivers ignoring the base channel.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0f3ce1a6
    • Ian Abbott's avatar
      staging: comedi: comedi_bond: get INSN_CONFIG_DIO_QUERY info from horse's mouth · 16d2d3cb
      Ian Abbott authored
      The DIO subdevice of the "comedi_bond" device attempts to remember the
      directions of DIO channels itself in the `io_bits` member of the
      subdevice, but that is only large enough for the first 32 channels and
      it might not be accurate anyway as changing the direction of one channel
      may have affected a whole group of channels and we have no idea of the
      initial directions before the "bonded" device was linked to the the
      "comedi_bond" device.  It would be better to ask the bonded device for
      this information when handling a `INSN_CONFIG_DIO_QUERY` configuration
      instruction.  Add new function `comedi_dio_get_config()` to the
      "kcomedilib" module to allow us to get the DIO direction of a channel
      and use it.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      16d2d3cb