Roberta Dobrescu [Sun, 14 Sep 2014 20:13:20 +0000 (23:13 +0300)]
staging: dgnc: Fix warnings relating to printk()
This fixes the following checkpatch.pl warnings:
WARNING: printk() should include KERN_ facility level
It replaces printk() with dev_dbg() in order to avoid the warning that a more
specific function should be used.
Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This fixes the following checkpatch.pl warnings:
WARNING: Prefer [subsystem eg: netdev]_dbg([subsystem]dev, ... then dev_dbg(dev,
... then pr_debug(... to printk(KERN_DEBUG ...
This fixes the following checkpatch.pl warnings:
WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...
staging: rtl8192u: Move ieee80211_crypto_* declarations to ieee80211/ieee80211.h
Move ieee80211_crypto*_init and _exit prototype declarations from r8192U_core.c to ieee80211/ieee80211.h. This fixes the following sparse warnings:
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c:203:12: warning: symbol 'ieee80211_crypto_init' was not declared. Should it be static?
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c:223:13: warning: symbol 'ieee80211_crypto_deinit' was not declared. Should it be static?
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c:764:12: warning: symbol 'ieee80211_crypto_tkip_init' was not declared. Should it be static?
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c:769:13: warning: symbol 'ieee80211_crypto_tkip_exit' was not declared. Should it be static?
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c:467:12: warning: symbol 'ieee80211_crypto_ccmp_init' was not declared. Should it be static?
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c:472:13: warning: symbol 'ieee80211_crypto_ccmp_exit' was not declared. Should it be static?
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c:281:12: warning: symbol 'ieee80211_crypto_wep_init' was not declared. Should it be static?
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c:286:13: warning: symbol 'ieee80211_crypto_wep_exit' was not declared. Should it be static?
Signed-off-by: Ragnar B. Johannsson <ragnar@igo.is> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Staging: rtl8192e: Fix style warnings relating to printk(KERN_DEBUG
This fixes the following checkpatch.pl warnings:
WARNING: Prefer [subsystem eg: netdev]_dbg([subsystem]dev, ... then dev_dbg(dev, ... then pr_debug(... to printk(KERN_DEBUG ...
staging: dgap: use schedule_timeout_interruptible() instead of dgap_ms_sleep()
Using schedule_timeout_interruptible() is exactly same as
setting a status of current process and calling schedule_timeout().
Removes dgap_ms_sleep(), because this function is used
only when closing tty channel on dgap_tty_close().
And also removes ch_close_delay that is always set to 250
on dgap_tty_init().
Staging: rtl8188eu: os_dep: Compression of lines for immediate return
This patch compresses two lines in to a single line in file rtw_android.c
if immediate return statement is found. It also removes variable bytes_written as
it is no longer needed.
It is done using script Coccinelle. And coccinelle uses following semantic
patch for this compression function:
staging: unisys: uislib: uislib.c: sparse warning of context imbalance
fixed sparse warning : context imbalance in 'destroy_device'
unexpected unlock
this patch will generate warning from checkpatch for
lines over 80 character , but since those are user-visible strings
so it was not modified.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Tested-by: Benjamin Romer <benjamin.romer@unisys.com> Acked-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Copy the channel type into a temporary buffer so that code will work
for architectures that don't support MMIO. This now works in same way
as other tests in same function.
Signed-off-by: Luke Hart <luke.hart@birchleys.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Mark Einon [Sun, 14 Sep 2014 15:58:59 +0000 (16:58 +0100)]
staging: et131x: Simplify unlocking tcb_send_qlock in et131x_tx_timeout()
The tcb_send_qlock spinlock is unlocked in all three paths at the end of
et131x_tx_timeout(). We can call it once before entering any of the paths,
saving ourselves a few lines of code.
This change puts tcb->count++ outside of the lock, but et131x_tx_timeout()
itself is protected by the tx_global_lock, so this shouldn't matter.
Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Mark Einon [Thu, 11 Sep 2014 21:59:45 +0000 (22:59 +0100)]
staging: et131x: Simplify code in nic_rx_pkts() for multicast_pkts_rcvd
In nic_rx_pkts(), we check that a multicast packet received (when using
a multicast list) is one that was requested - despite setting the list
up with the hardware. We shouldn't expect to get a mc packet we didn't
ask for, so remove these extra checks.
This also means that the surrounding code can be tiedied up a little.
Tested somewhat with omping, with no adverse effects seen.
Also remove this item from the TODO list.
Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Mark Einon [Thu, 11 Sep 2014 21:59:43 +0000 (22:59 +0100)]
staging: et131x: Remove struct tcb->flags
'struct tcb' member 'flags' was only used to collect tx stats, now
we are no longer collecting those particular stats, we no longer
need tcb->flags or the code used to peek into the skb to set it's
value.
Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Mark Einon [Thu, 11 Sep 2014 21:59:42 +0000 (22:59 +0100)]
staging: et131x: Remove ununsed statistics
From struct ce_stats; unicast_pkts_rcvd, unicast_pkts_xmtd,
multicast_pkts_xmtd, broadcast_pkts_rcvd and broadcast_pkts_xmtd
are not returned or used for anything meaningful - remove the code
that collects them, and the struct members too.
Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Mon, 15 Sep 2014 12:46:07 +0000 (13:46 +0100)]
staging: comedi: remove comedi_fc module
All the exported functions in the "comedi_fc" module have been migrated
to the core "comedi" module and renamed, so it is now just a dummy
module. Remove it.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Mon, 15 Sep 2014 12:46:06 +0000 (13:46 +0100)]
staging: comedi: migrate copyrights from "comedi_fc.c"
The "comedi_fc" module was originally written and copyrighted by Frank
Mori Hess, but the functionality has been migrated into the core
"comedi" module. Move the copyright notices over to the affected .c
files in the core comedi module.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The "comedi_fc" module contains a few functions useful to Comedi
drivers. Their functionality is being migrated to the core "comedi"
module and renamed to start with the prefix `comedi_`. As part of this
migration, move `cfc_read_array_from_buffer()` into the core comedi
module and rename it to `comedi_read_array_from_buffer()`. Change the
external declaration of `cfc_read_array_from_buffer()` into an inline
function that calls `comedi_read_array_from_buffer()`.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Mon, 15 Sep 2014 12:46:04 +0000 (13:46 +0100)]
staging: comedi: comedi_fc.h: use comedi_write_array_to_buffer()
Since `cfc_write_array_to_buffer()` is just an inline function that
calls `comedi_write_array_to_buffer()`, replace calls to the former to
the latter in the "comedi_fc.h" header. This is part of the migration
of functionality from the "comedi_fc" module to the core "comedi"
module.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The "comedi_fc" module contains a few functions useful to Comedi
drivers. Their functionality is being migrated to the core "comedi"
module and renamed to start with the prefix `comedi_`. As part of this
migration, move `cfc_write_array_to_buffer()` into the core comedi
module and rename it to `comedi_write_array_to_buffer()`. Change the
external declaration of `cfc_write_array_to_buffer()` into an inline
function that calls `comedi_write_array_to_buffer()`.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Mon, 15 Sep 2014 12:46:01 +0000 (13:46 +0100)]
staging: comedi: add comedi_handle_events()
The "comedi_fc" module contains a few functions useful to Comedi
drivers. Their functionality is being migrated to the core "comedi"
module and renamed to start with the prefix `comedi_`. As part of this
migration, move `cfc_handle_events()` into the core comedi module and
rename it to `comedi_handle_events()`. Change the external declaration
of `cfc_handle_events()` into an inline function that calls
`comedi_handle_events()`.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Mon, 15 Sep 2014 12:46:00 +0000 (13:46 +0100)]
staging: comedi: comedi_fc: use comedi_inc_scan_progress()
Since `cfc_inc_scan_progress()` is just an inline function that calls
`comedi_inc_scan_progress()`, replace calls to the former to the latter
in the "comedi_fc" module. This is part of the migration of
functionality from the "comedi_fc" module to the core "comedi" module.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Mon, 15 Sep 2014 12:45:59 +0000 (13:45 +0100)]
staging: comedi: add comedi_inc_scan_progress()
The "comedi_fc" module contains a few functions useful to Comedi
drivers. Their functionality is being migrated to the core "comedi"
module and renamed to start with the prefix `comedi_`. As part of this
migration, move `cfc_inc_scan_progress()` into the core comedi module
and rename it to `comedi_inc_scan_progress()`. Change the external
declaration of `cfc_inc_scan_progress()` into an inline function that
calls `comedi_inc_scan_progress()`.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Mon, 15 Sep 2014 12:45:58 +0000 (13:45 +0100)]
staging: comedi: comedi_fc: use comedi_bytes_per_scan()
Since `cfc_bytes_per_scan()` is just an inline function that calls
`comedi_bytes_per_scan()`, replace calls to the former to the latter in
the "comedi_fc" module. This is part of the migration of functionality
from the "comedi_fc" module to the core "comedi" module.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Mon, 15 Sep 2014 12:45:57 +0000 (13:45 +0100)]
staging: comedi: add comedi_bytes_per_scan()
The "comedi_fc" module contains a few functions useful to Comedi
drivers. Their functionality is being migrated to the core "comedi"
module and renamed to start with the prefix `comedi_`. As part of this
migration, move `cfc_bytes_per_scan()` into the core comedi module and
rename it to `comedi_bytes_per_scan()`. Change the external declaration
of `cfc_bytes_per_scan()` into an inline function that calls
`comedi_bytes_per_scan()`.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 12 Sep 2014 11:19:57 +0000 (12:19 +0100)]
staging: comedi: addi_apci_3120: simplify setting of devpriv->us_UseDma
`apci3120_auto_attach()` first sets `devpriv->us_UseDma` to 1, then sets
it back to 0 if it fails to allocate the DMA buffer. Since `*devpriv`
is initially zeroed out by `comedi_alloc_devpriv()`, change it to only
set `devpriv->us_UseDma` to 1 if the allocation succeeds. Also, don't
bother explicitly initializing `devpriv->b_DmaDoubleBuffer` to 0 as it
is already zeroed out.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 12 Sep 2014 11:19:56 +0000 (12:19 +0100)]
staging: comedi: addi_apci_3120: use dma_alloc_coherent()
Use `dma_alloc_coherent()` to allocate the DMA buffers instead of
using `__get_free_pages()` to allocate and `virt_to_bus()` to get the
hardware address. The coherent buffers are fairly small - at most 4
pages (although there are two of them). Use of `virt_to_bus()` is
discouraged.
Note: `struct addi_private` is used by some other ADDI-DATA drivers as
well, but this is the only one using the affected members.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The last parameter of `__get_free_pages()` is log2 (the 'order') of the
number of pages to be allocated. This driver seems to think it is the
linear number of pages, so `apci3120_auto_attach()` first tries to allocate
16 pages, but only uses 4 of them, setting the buffer size to PAGE_SIZE
multiplied by the 'order'. If the allocation fails, it tries
progressively smaller orders, down to 0. If the allocation at order 0
succeeds, the buffer size is set to 0, which is likely to cause
problems.
Set the buffer size to `PAGE_SIZE` shifted left by the allocation order.
Since the maximum buffer size previously used was 4, start with an
allocation order of 2 instead of 4. Rename the `ui_DmaBufferPages` member of
`struct addi_private` to `ui_DmaBufferPageOrder` and rename the `pages`
local variable to `order` to make it clearer what it is.
Note: `struct addi_private` is used by some other ADDI-DATA drivers as
well, but this is the only one using the affected members.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 12 Sep 2014 11:19:54 +0000 (12:19 +0100)]
staging: comedi: addi_apci_3120: don't allocate 2nd DMA buffer on failure
`apci3120_auto_attach()` tries to allocate two DMA buffers but may
allocate a single buffer or none at all. If it fails to allocate the
first buffer, it still tries to allocate the second buffer, even though
it won't be used. Change it to not bother trying to allocate the second
buffer if the first one fails.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 12 Sep 2014 09:04:44 +0000 (10:04 +0100)]
staging: comedi: adl_pci9118: use dma_alloc_coherent()
Use `dma_alloc_coherent()` to allocate the DMA buffers instead of
using `__get_free_pages()` to allocate and `virt_to_bus()` to get the
hardware address. The coherent buffers are fairly small - at most 4
pages (although there are two of them). Use of `virt_to_bus()` is
discouraged.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The last parameter of `__get_free_pages()` is log2 (the 'order') of the
number of pages to be allocated. This driver seems to think it is the
linear number of pages, so `pci9118_alloc_dma()` first tries to allocate
16 pages, but only uses 4 of them, setting the buffer size to PAGE_SIZE
multiplied by the 'order'. If the allocation fails, it tries
progressively smaller orders, down to 0. If the allocation at order 0
succeeds, the buffer size is set to 0, which is likely to cause
problems.
Set the buffer size to `PAGE_SIZE` shifted left by the allocation order.
Since the maximum buffer size previously used was 4, start with an
allocation order of 2 instead of 4. Rename the `pages` member of
`struct pci9118_dmabuf` (and the local variable in
`pci9118_alloc_dma()`) to `order` to make it clearer what it is.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 12 Sep 2014 09:04:42 +0000 (10:04 +0100)]
staging: comedi: adl_pci9118: don't allocate 2nd DMA buffer on failure
`pci9118_alloc_dma()` tries to allocate two DMA buffers but may allocate
a single buffer or none at all. If it fails to allocate the first
buffer, it still tries to allocate the second buffer, even though it
won't be used. Change it to not bother trying to allocate the second
buffer if the first one fails.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Merge tag 'iio-for-3.18b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
Second round of new IIO drivers, features and cleanups for the 3.18 cycle.
New drivers and part support
* Bosch bmg160 Gyroscope driver
* Dyna-Image al3320a ambient light sensor driver
* Bosh bmi055 gyroscope part driver (accelerometer part supported by bmc150)
* isl29018 - add support for isl29023 and isl29035
* kxcjk-1013 - add support for kxcj9-1008 and kxtj2-1009
* bmc150 - additional part support (BMI055 accelerometer part, BMA255,
BMA222E, BMA250E and BMA280). Different resolutions but otherwise similar
parts.
* bma180 - add BMA250 (note different from the BMA250E support above despite
the naming). A lot of driver reworking lead up to this - described below.
New features
* kxcjk1013 - add threshold event support.
* rockchip - document DT bindings.
* isl29018 - ACPI support
* bma180 - enable use without IRQ
Cleanups
* Tree wide - drop owner field assignment if using the module_platform_driver
helper as that assigns it anyway.
* kxcjk1013 - drop a redundant assignment of the current range and fix a
a defined but not used warning.
* inv_mpu6050 - Remove an unnecessary cast form a void pointer.
* rockchip - drop and unused variable.
* at91_adc - make a local function static.
* st-sensors-core - correctly handle an error in setting in
st_sensors_set_drdy_int_pin
* isl29018 - typo fix
* bmc150 - fix incorrect scale value for 16G range (Driver new this cycle)
* bmc150 - fix issues when CONFIG_PM_RUNTIME not set (Driver new this cycle)
* ad7606 - line length tidy up.
* bmg160 - set power state only if PM_RUNTIME is defined.
* ak8975 - fix some unnecessary casting between char * and const char *
* bma180 - prefix remaining bits and bobs with bma180_ and ensure consistent.
- use a bool instead of an int for state (as its either on or off).
- expose the temperature channel
- statically allocate buffers to avoid need for update_scan_mode
callback.
- refactor to allow futher chip variants including support for part
specific config and disable code + different resolutions.