staging:iio:ad9834: Mark transfer buffers as __b16
Fixes the following warnings from sparse:
drivers/staging/iio/frequency/ad9834.c:45:26: warning: incorrect type in assignment (different base types)
drivers/staging/iio/frequency/ad9834.c:45:26: expected unsigned short [unsigned] [short] <noident>
drivers/staging/iio/frequency/ad9834.c:45:26: got restricted __be16 [usertype] <noident>
drivers/staging/iio/frequency/ad9834.c:47:26: warning: incorrect type in assignment (different base types)
drivers/staging/iio/frequency/ad9834.c:47:26: expected unsigned short [unsigned] [short] <noident>
drivers/staging/iio/frequency/ad9834.c:47:26: got restricted __be16 [usertype] <noident>
drivers/staging/iio/frequency/ad9834.c:59:18: warning: incorrect type in assignment (different base types)
drivers/staging/iio/frequency/ad9834.c:59:18: expected unsigned short [unsigned] data
drivers/staging/iio/frequency/ad9834.c:59:18: got restricted __be16 [usertype] <noident>
drivers/staging/iio/frequency/ad9834.c:100:26: warning: incorrect type in assignment (different base types)
drivers/staging/iio/frequency/ad9834.c:100:26: expected unsigned short [unsigned] data
drivers/staging/iio/frequency/ad9834.c:100:26: got restricted __be16 [usertype] <noident>
drivers/staging/iio/frequency/ad9834.c:108:26: warning: incorrect type in assignment (different base types)
drivers/staging/iio/frequency/ad9834.c:108:26: expected unsigned short [unsigned] data
drivers/staging/iio/frequency/ad9834.c:108:26: got restricted __be16 [usertype] <noident>
drivers/staging/iio/frequency/ad9834.c:122:26: warning: incorrect type in assignment (different base types)
drivers/staging/iio/frequency/ad9834.c:122:26: expected unsigned short [unsigned] data
drivers/staging/iio/frequency/ad9834.c:122:26: got restricted __be16 [usertype] <noident>
drivers/staging/iio/frequency/ad9834.c:131:26: warning: incorrect type in assignment (different base types)
drivers/staging/iio/frequency/ad9834.c:131:26: expected unsigned short [unsigned] data
drivers/staging/iio/frequency/ad9834.c:131:26: got restricted __be16 [usertype] <noident>
drivers/staging/iio/frequency/ad9834.c:194:26: warning: incorrect type in assignment (different base types)
drivers/staging/iio/frequency/ad9834.c:194:26: expected unsigned short [unsigned] data
drivers/staging/iio/frequency/ad9834.c:194:26: got restricted __be16 [usertype] <noident>
drivers/staging/iio/frequency/ad9834.c:387:18: warning: incorrect type in assignment (different base types)
drivers/staging/iio/frequency/ad9834.c:387:18: expected unsigned short [unsigned] data
drivers/staging/iio/frequency/ad9834.c:387:18: got restricted __be16 [usertype] <noident>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
staging:iio:ad9832: Mark transfer buffers as __be16
Fixes the following warnings from sparse:
drivers/staging/iio/frequency/ad9832.c:43:26: warning: incorrect type in assignment (different base types)
drivers/staging/iio/frequency/ad9832.c:43:26: expected unsigned short [unsigned] [short] <noident>
drivers/staging/iio/frequency/ad9832.c:43:26: got restricted __be16 [usertype] <noident>
drivers/staging/iio/frequency/ad9832.c:46:26: warning: incorrect type in assignment (different base types)
drivers/staging/iio/frequency/ad9832.c:46:26: expected unsigned short [unsigned] [short] <noident>
drivers/staging/iio/frequency/ad9832.c:46:26: got restricted __be16 [usertype] <noident>
drivers/staging/iio/frequency/ad9832.c:49:26: warning: incorrect type in assignment (different base types)
drivers/staging/iio/frequency/ad9832.c:49:26: expected unsigned short [unsigned] [short] <noident>
drivers/staging/iio/frequency/ad9832.c:49:26: got restricted __be16 [usertype] <noident>
drivers/staging/iio/frequency/ad9832.c:52:26: warning: incorrect type in assignment (different base types)
drivers/staging/iio/frequency/ad9832.c:52:26: expected unsigned short [unsigned] [short] <noident>
drivers/staging/iio/frequency/ad9832.c:52:26: got restricted __be16 [usertype] <noident>
drivers/staging/iio/frequency/ad9832.c:65:27: warning: incorrect type in assignment (different base types)
drivers/staging/iio/frequency/ad9832.c:65:27: expected unsigned short [unsigned] [short] <noident>
drivers/staging/iio/frequency/ad9832.c:65:27: got restricted __be16 [usertype] <noident>
drivers/staging/iio/frequency/ad9832.c:68:27: warning: incorrect type in assignment (different base types)
drivers/staging/iio/frequency/ad9832.c:68:27: expected unsigned short [unsigned] [short] <noident>
drivers/staging/iio/frequency/ad9832.c:68:27: got restricted __be16 [usertype] <noident>
drivers/staging/iio/frequency/ad9832.c:107:26: warning: incorrect type in assignment (different base types)
drivers/staging/iio/frequency/ad9832.c:107:26: expected unsigned short [unsigned] data
drivers/staging/iio/frequency/ad9832.c:107:26: got restricted __be16 [usertype] <noident>
drivers/staging/iio/frequency/ad9832.c:120:26: warning: incorrect type in assignment (different base types)
drivers/staging/iio/frequency/ad9832.c:120:26: expected unsigned short [unsigned] data
drivers/staging/iio/frequency/ad9832.c:120:26: got restricted __be16 [usertype] <noident>
drivers/staging/iio/frequency/ad9832.c:133:26: warning: incorrect type in assignment (different base types)
drivers/staging/iio/frequency/ad9832.c:133:26: expected unsigned short [unsigned] data
drivers/staging/iio/frequency/ad9832.c:133:26: got restricted __be16 [usertype] <noident>
drivers/staging/iio/frequency/ad9832.c:144:26: warning: incorrect type in assignment (different base types)
drivers/staging/iio/frequency/ad9832.c:144:26: expected unsigned short [unsigned] data
drivers/staging/iio/frequency/ad9832.c:144:26: got restricted __be16 [usertype] <noident>
drivers/staging/iio/frequency/ad9832.c:277:18: warning: incorrect type in assignment (different base types)
drivers/staging/iio/frequency/ad9832.c:277:18: expected unsigned short [unsigned] data
drivers/staging/iio/frequency/ad9832.c:277:18: got restricted __be16 [usertype] <noident>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Currently the IIO buffer interface only allows non-blocking reads. This patch
adds support for blocking IO. In blocking mode the thread will go to sleep if no
data is available and will wait for the buffer implementation to signal that new
data is available by waking up the buffers waitqueue.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch implements the data_available() callback for the kfifo buffer instead
of using the stufftoread flag. The kfifo used by the buffer already knows
whether it is empty or not based on the position of its read and write pointer.
Using this makes it a lot easier to tell whether data is available or not and it
is not necessary to take special measures to ensure that no race conditions
between reading and writing from the buffer occur.
Note, that we still have to take the buffers lock to protect against concurrent
resizeing of the kfifo.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch adds a new data_available() callback to the iio_buffer_access_funcs
struct. The callback is used to indicate whether data is available in the buffer
for reading. It is meant to replace the stufftoread flag from the iio_buffer
struct. The reasoning for this is that the buffer implementation usually can
determine whether data is available rather easily based on its state, on the
other hand it can be rather tricky to update the stufftoread flag in a race free
way.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
staging:iio:ad7746: Mark transfer buffer as __be32
Fixes the following warnings from sparse:
drivers/staging/iio/cdc/ad7746.c:599:25: warning: cast to restricted __be32
drivers/staging/iio/cdc/ad7746.c:599:25: warning: cast to restricted __be32
drivers/staging/iio/cdc/ad7746.c:599:25: warning: cast to restricted __be32
drivers/staging/iio/cdc/ad7746.c:599:25: warning: cast to restricted __be32
drivers/staging/iio/cdc/ad7746.c:599:25: warning: cast to restricted __be32
drivers/staging/iio/cdc/ad7746.c:599:25: warning: cast to restricted __be32
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
staging:iio:ad7280a: Mark transfer buffer as __be32
Fixes the following warnings from sparse:
drivers/staging/iio/adc/ad7280a.c:194:35: warning: incorrect type in initializer (different base types)
drivers/staging/iio/adc/ad7280a.c:194:35: expected unsigned int [unsigned] tx_buf
drivers/staging/iio/adc/ad7280a.c:194:35: got restricted __be32 [usertype] <noident>
drivers/staging/iio/adc/ad7280a.c:207:16: warning: cast to restricted __be32
drivers/staging/iio/adc/ad7280a.c:207:16: warning: cast to restricted __be32
drivers/staging/iio/adc/ad7280a.c:207:16: warning: cast to restricted __be32
drivers/staging/iio/adc/ad7280a.c:207:16: warning: cast to restricted __be32
drivers/staging/iio/adc/ad7280a.c:207:16: warning: cast to restricted __be32
drivers/staging/iio/adc/ad7280a.c:207:16: warning: cast to restricted __be32
drivers/staging/iio/adc/ad7280a.c:219:13: warning: incorrect type in assignment (different base types)
drivers/staging/iio/adc/ad7280a.c:219:13: expected unsigned int [unsigned] [assigned] reg
drivers/staging/iio/adc/ad7280a.c:219:13: got restricted __be32 [usertype] <noident>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Fixes the following warnings from sparse:
drivers/iio/light/vcnl4000.c:88:16: warning: cast to restricted __be16
drivers/iio/light/vcnl4000.c:88:16: warning: cast to restricted __be16
drivers/iio/light/vcnl4000.c:88:16: warning: cast to restricted __be16
drivers/iio/light/vcnl4000.c:88:16: warning: cast to restricted __be16
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Fixes the following warnings from sparse:
drivers/iio/adc/ad7266.c:140:16: warning: cast to restricted __be16
drivers/iio/adc/ad7266.c:140:16: warning: cast to restricted __be16
drivers/iio/adc/ad7266.c:140:16: warning: cast to restricted __be16
drivers/iio/adc/ad7266.c:140:16: warning: cast to restricted __be16
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Fixes the following warnings from sparse:
drivers/iio/dac/ad5504.c:71:19: warning: incorrect type in initializer (different base types)
drivers/iio/dac/ad5504.c:71:19: expected unsigned short [unsigned] [usertype] tmp
drivers/iio/dac/ad5504.c:71:19: got restricted __be16 [usertype] <noident>
drivers/iio/dac/ad5504.c:80:19: warning: incorrect type in initializer (different base types)
drivers/iio/dac/ad5504.c:80:19: expected unsigned short [unsigned] [usertype] tmp
drivers/iio/dac/ad5504.c:80:19: got restricted __be16 [usertype] <noident>
drivers/iio/dac/ad5504.c:93:16: warning: cast to restricted __be16
drivers/iio/dac/ad5504.c:93:16: warning: cast to restricted __be16
drivers/iio/dac/ad5504.c:93:16: warning: cast to restricted __be16
drivers/iio/dac/ad5504.c:93:16: warning: cast to restricted __be16
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Martyn Welch [Fri, 8 Nov 2013 11:58:35 +0000 (11:58 +0000)]
VME: Rename vme_slot_get to avoid confusion with reference counting
Traditionally the "get" functions increment the reference count of the
object that is returned, which does not happen with vme_slot_get. The
function vme_slot_get returns the physical VME slot associated with a
particular struct vme_dev. Rename vme_slot_num to avoid any confusion.
Martyn Welch [Fri, 8 Nov 2013 11:58:34 +0000 (11:58 +0000)]
VME: Provide access to VME bus enumeration and fix vme_user match function
The match function for vme_user is completely wrong. It will blindly bind
against the first VME slot on each bus (at this point that would be just the
first bus as the driver can only handle one bus).
The original intention (before some major subsystem changes) was that the
driver bind against the slot to which the bridge was attached in the VME
system and to the bus(es) provided via the "bus" module parameter.
To do this cleanly (i.e. without poking arround in the subsystems internal
stuctures) a functionality has been added to provide access to the bus
enumeration.
staging: comedi: dt282x: tidy up the irq support in dt282x_attach()
An irq is only needed by this driver in order to support async commands.
Since it is optional, modify the attach so that if the request_irq() fails
the attach does not fail.
Remove the printk noise about the irq.
Only hookup the async command support if the request_irq() was successful.
Also, only call dt282x_grab_dma() if we have an irq since interrupt support
is needed to support dma.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: dt2814: tidy up the irq support in dt2814_attach()
An irq is only needed by this driver in order to support async commands.
Since it is optional, modify the attach so that if the request_irq() fails
the attach does not fail.
Remove the printk noise about the irq.
Only hookup the async command support if the request_irq() was successful.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: dt2811: remove disabled dt2811_adtrig() function
This function is not used by the driver. It's also suffering from bitrot
since COMEDI_MDEMAND and COMEDI_MCONTS are not defined anywhere. Just
remove the code.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: dmm32at: tidy up the irq support in dmm32at_attach()
An irq is only needed by this driver in order to support async commands.
Since it is optional, modify the attach so that if the request_irq() fails
the attach does not fail.
Remove the printk noise about the irq.
Only hookup the async command support if the request_irq() was successful.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: das16m1: tidy up the irq support in das16m1_attach()
An irq is only needed by this driver in order to support async commands.
Since it is optional, modify the attach so that if an invalid irq is
selected by the user, or the request_irq() fails, the attach does not
fail.
Remove all the printk noise about the irq.
Only hookup the async command support if the request_irq() was successful.
Tidy up das16m1_irq_bits() a bit. This helper returns the value that needs
to be written to the DAS16M1_INTR_CONTROL register to setup the irq routing.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Chen Gang [Wed, 27 Nov 2013 03:40:58 +0000 (11:40 +0800)]
drivers: staging: ft1000: ft1000-usb: ft1000_debug.c: check return value of get_user() in ft1000_ioctl()
get_user() may fail and cause 'msgsz' uninitialized, so need give a
check. The related warning (with allmodconfig under hexagon):
CC [M] drivers/staging/ft1000/ft1000-usb/ft1000_debug.o
drivers/staging/ft1000/ft1000-usb/ft1000_debug.c: In function 'ft1000_ioctl':
include/uapi/linux/swab.h:53:9: warning: 'msgsz' may be used uninitialized in this function [-Wuninitialized]
drivers/staging/ft1000/ft1000-usb/ft1000_debug.c:533:17: note: 'msgsz' was declared here
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The rest of the code seem to imply that rmf_dumper may indeed be
NULL. Change the code so that dumping is not even considered if
rmf_dumper callback is not set.
Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
bus_info field of struct ethtool_drvinfo is an array thus it always
evaluates to true in a boolean context. Therefore operation
depending on it being false will never be executed.
Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stephen Warren [Wed, 27 Nov 2013 01:58:01 +0000 (18:58 -0700)]
staging: dwc2: set up all module params
The DWC2 USB controller in the BCM2835 (Raspberry Pi) needs some non-
default parameters. Select these based on the compatible value from the
DT node. For all other HW, fall back to the default parameters currently
in use.
The values in params_bcm2835[] were posted to the mailing list by Paul
quite some time ago. I made a couple of minor modifications since then;
to set ahbcfg instead of ahb_single, and to set uframe_sched.
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Peng Tao [Tue, 3 Dec 2013 14:42:05 +0000 (22:42 +0800)]
staging/lustre/llite: fix used uninitialized warning
Got below warning when building with sparc:
drivers/staging/lustre/lustre/llite/file.c: In function 'll_file_aio_write':
drivers/staging/lustre/lustre/llite/file.c:1247:9: warning: 'count' may be used uninitialized in this function [-Wuninitialized]
drivers/staging/lustre/lustre/llite/file.c: In function 'll_file_aio_read':
drivers/staging/lustre/lustre/llite/file.c:1188:9: warning: 'count' may be used uninitialized in this function [-Wuninitialized]
Signed-off-by: Peng Tao <bergwolf@gmail.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Peng Tao [Tue, 3 Dec 2013 14:42:04 +0000 (22:42 +0800)]
staging/lustre: fix defined not used warning
register_sysctl_table/unregister_sysctl_table are defined
regardless of CONFIG_SYSCTL true or false. so we don't need
to surround them with #ifdef CONFIG_SYSCTL. Besides, current
code got build warnings when CONFIG_SYSCTL is not set:
drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c:368:20: warning:
‘lnet_table’ defined but not used [-Wunused-variable]
Signed-off-by: Peng Tao <bergwolf@gmail.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Peng Tao [Tue, 3 Dec 2013 14:41:58 +0000 (22:41 +0800)]
staging/lustre/obdclass: fix false used uninitialized warning
Got below warning when building lustre with 4.7.3.
drivers/staging/lustre/lustre/obdclass/llog_test.c: In function ‘
llog_test_init’:
drivers/staging/lustre/lustre/obdclass/llog_test.c:1058:28: warning: ‘
lvars.module_vars’ is used uninitialized in this function
[-Wuninitialized]
Signed-off-by: Peng Tao <bergwolf@gmail.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>