staging: comedi: pcl818: convert driver to use the comedi_8254 module
This driver uses an 8254 timer to generate the pacer clock used for analog
input data acquisition. Convert it to use the comedi_8254 module to provide
support for the 8254 timer.
Note that the pacer does not have to be stopped when starting a new async
command in pcl818_ai_cmd() or when the card is initialy reset by pcl818_reset().
The counters are all reset when the driver is initially attached and the
counters used by the pacer are stopped when a command is canceled.
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: pcl816: convert driver to use the comedi_8254 module
This driver uses an 8254 timer to generate the pacer clock used for analog
input data conversion. Convert it to use the comedi_8254 module to provide
support for the 8254 timer.
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: pcl812: convert driver to use the comedi_8254 module
This driver uses an 8254 timer to generate the pacer clock used for analog
input data acquisition. Convert it to use the comedi_8254 module to provide
support for the 8254 timer.
Note that the pacer does not have to be stopped when starting a new async
command in pcl812_ai_cmd() or when the card is initialy reset by pcl812_reset().
The counters are all reset when the driver is initially attached and the
counters used by the pacer are stopped when a command is canceled.
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: add 'pacer' member to struct comedi_device
Add a new member to the comedi_device struct for a comedi_8254 'pacer'. This
provides a convient place to store the data allocated by the comedi_8254 module
for boards that use an 8254 device to create the data acquisition pacer clock.
Automatically free this pointer in comedi_device_detach_cleanup() so that the
drivers don't need to do it when then are detached.
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: comedi_8254: introduce module for 8254 timer support
A 8254 timer/counter is commonly used on data acquisition boards to provide
the internal pacer clock used to acquire analog input samples. Some boards
also to allow the timers to be used externally.
Currently the 8254 timers are supported by comedi using the 8253.h header
and a number of inline functions. This works for the internal pacer clock
but requires the drivers to implement subdevice code necessary to use the
timers externally.
Introduce a new module to support both the internal pacer clock and the
external counter subdevice. This will allow removing a bunch of duplicated
code in the drivers and standardizes the comedi 8254 timer support.
This implementation is based on the 8253.h inline functions and the various
subdevice functionality in the comedi drivers.
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>
The read/write of the PLX_INTRCS_REG during the driver detach is not
necessary. The rtd_reset() function writes 0 to this register which
will disable all interrupts.
This also fixes a dereference after null check reported by coverity.
Reported-by: coverity (CID 751066) 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: cb_pcidas64: fix possible integer overflow
The {min,max}_scan_divisor values could overflow due to the
unsigned int * insigned int calculation. Change the type of the
local variable 'convert_divisor' to unsigned long long to avoid
the possible overflow.
Reported-by: coverity (CID 200653) 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: ni_labpc_common: fix logically dead code issue
The quick exit check of (mode == MODE_SINGLE_CHAN) results in coverity
reporting a logically dead code issue in the switch code in
labpc_ai_check_chanlist().
Remove the quick exit check and allow the function to handle the
MODE_SINGLE_CHAN normally (the for loop will only happen 1 time and
the function will return 0).
Reported-by: coverity (CID 1222108) 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>
Rasmus Villemoes [Fri, 20 Feb 2015 13:13:19 +0000 (14:13 +0100)]
staging: android: ion: fix some format strings
C99 says that a precision which is simply '.' with no following digits
or * should be interpreted as 0, which means that these format strings
actually mean 'print 16 spaces'. However, the kernel's printf
implementation treats this case as if the precision was omitted. Don't
rely on that quirk.
drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c:84: warning: ‘proc_set_timeout’ defined but not used
drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c:95: warning: ‘proc_memory_alloc’ defined but not used
drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c:119: warning: ‘proc_pages_alloc’ defined but not used
drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c:143: warning: ‘proc_mem_max’ defined but not used
drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c:167: warning: ‘proc_pages_max’ defined but not used
drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c:191: warning: ‘proc_max_dirty_pages_in_mb’ defined but not used
drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c:232: warning: ‘proc_alloc_fail_rate’ defined but not used
Make the existing #ifdef CONFIG_SYSCTL cover all sysctl-related
functions to fix this.
Le Tan [Wed, 11 Feb 2015 04:13:14 +0000 (12:13 +0800)]
staging: lustre: resolves sparse warnings using static declaration
This patch resolves sparse warnings about non-declared symbol in
staging/lustre/lustre/lov by adding static declaration.
These warnings are like this:
warning: symbol 'fiemap_calc_fm_end_offset' was not declared. Should it be static?
Signed-off-by: Le Tan <tamlok@live.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Asaf Vertz [Mon, 9 Feb 2015 10:00:50 +0000 (12:00 +0200)]
staging: lustre: use linux headers
WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h>
WARNING: Use #include <linux/statfs.h> instead of <asm/statfs.h>
WARNING: Use #include <linux/kgdb.h> instead of <asm/kgdb.h>
Fabio Estevam [Thu, 19 Feb 2015 12:12:12 +0000 (10:12 -0200)]
staging: fbtft: fbtft-io: Use '%zu' to print 'size_t' format
When building for ARM64 the following build warnings are seen:
drivers/staging/fbtft/fbtft-io.c: In function 'fbtft_write_spi_emulate_9':
drivers/staging/fbtft/fbtft-io.c:63:4: warning: format '%d' expects argument of type 'int', but argument 4 has type 'size_t' [-Wformat=]
drivers/staging/fbtft/fbtft-io.c: In function 'fbtft_read_spi':
drivers/staging/fbtft/fbtft-io.c:110:5: warning: format '%d' expects argument of type 'int', but argument 4 has type 'size_t' [-Wformat=]
Frederic Jacob [Sun, 8 Feb 2015 02:15:25 +0000 (21:15 -0500)]
Staging: fbtft: Fix Sparse warnings
This fixes the folowing sparse warnings:
fb_hx8340bn.c:111:6: warning: symbol 'set_addr_win' was not declared. Should it be static?
fbtft_device.c:32:19: warning: symbol 'spi_device' was not declared. Should it be static?
fbtft_device.c:33:24: warning: symbol 'p_device' was not declared. Should it be static?
Signed-off-by: Frederic Jacob <frederic.jacob.78@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Hatice ERTÜRK [Sun, 1 Mar 2015 21:51:54 +0000 (23:51 +0200)]
Staging: rtl8192u: ieee80211: Add blank line after declarations
The following patch fixes the checkpatch.pl warning:
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c WARNING:
Missing a blank line after declarations
This patch drops #include <linux/moduleparam.h> in all the staging
driver files that also include #include <linux/module.h> as
module.h includes moduleparam.h already.
The following semantic patch is used to make these changes:
Staging: rtl8192e: Use ether_addr_copy() instead of memcpy()
This patch replaces memcpy with ether_addr_copy.
Also pathole was used to make sure that arguments passed to ether_addr_copy
are aligned to u16.
First argument is iwe.u.ap_addr.sa_data i output of pahole is:
struct iw_event {
__u16 len; /* 0 2 */
__u16 cmd; /* 2 2 */
/* XXX 4 bytes hole, try to pack */
union iwreq_data u; /* 8 16 */
/* size: 24, cachelines: 1, members: 3 */
/* sum members: 20, holes: 1, sum holes: 4 */
/* last cacheline: 24 bytes */
};
and inside union iwreq_data u is sa_data:
struct sockaddr {
/* typedef sa_family_t -> __kernel_sa_family_t */ short unsigned int sa_family; /* 8 2 */
char sa_data[14]; /* 10 14 */
} ap_addr; /* 16 */
sa_data is a char array of size 14, and the number of bytes copied using
ether_addr_copy() is 6.
Second argument is network->bssid and output of pahole is:
struct rtllib_network {
u8 bssid[6]; /* 0 6 */
u8 channel; /* 6 1 */
u8 ssid[33]; /* 7 33 */
u8 ssid_len; /* 40 1 */
u8 hidden_ssid[33]; /* 41 33 */
/* --- cacheline 1 boundary (64 bytes) was 10 bytes ago --- */
u8 hidden_ssid_len; /* 74 1 */
Staging: rtl8192u: Replace printk() with netdev_dbg()
For dynamic debugging netdev_dbg (if there is a ponterto a device
net structure) is preferred over printk(), which is the raw way
to print something. Issue found by checkpatch.pl.
Vaishali Thakkar [Fri, 27 Feb 2015 17:55:48 +0000 (23:25 +0530)]
Staging: rtl8712: Eliminate use of _set_timer
This patch introduces the use of API function mod_timer
instead of driver specific function _set_timer as it is
a more efficient and standard way to update the expire
field of an active timer. Also, definition of function
_set_timer is removed as it is no longer needed after
this change.
Here, these cases are handled using Coccinelle and
semantic patch used for this is as follows:
Haneen Mohammed [Sat, 28 Feb 2015 19:33:47 +0000 (22:33 +0300)]
Staging: lustre: lustre: ldlm: Concatenate strings into single string
This patch concatenate two consecutive strings into one, addressing checkpatch.pl warning:
"Consecutive strings are generally better as a single string"
Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dilek Uzulmez [Fri, 27 Feb 2015 22:54:17 +0000 (00:54 +0200)]
Staging: lustre: Deleted space prohibited between function name and open parenthesis
WARNING: space prohibited between function name and open parenthesis '('
Remove unnecessary space between function name and opening parenthesis.
That was found by running checkpatch.pl
Melike Yurtoglu [Fri, 27 Feb 2015 21:25:55 +0000 (23:25 +0200)]
Staging: lustre: Deleted space prohibited between function name and open parenthesis
WARNING: space prohibited between function name and open parenthesis '('
Remove unnecessary space between function name and opening parenthesis.
That was found by running checkpatch
Melike Yurtoglu [Fri, 27 Feb 2015 20:42:11 +0000 (22:42 +0200)]
Staging: lustre: Deleted space prohibited between function name and open parenthesis
WARNING: space prohibited between function name and open parenthesis '('
Remove unnecessary space between function name and opening parenthesis.
That was found by running checkpatch
Melike Yurtoglu [Fri, 27 Feb 2015 19:51:04 +0000 (21:51 +0200)]
Staging: lustre: Deleted space prohibited between function name and open parenthesis
WARNING: space prohibited between function name and open parenthesis '('
Remove unnecessary space between function name and opening parenthesis.
That was found by running checkpatch
Hatice ERTÜRK [Fri, 27 Feb 2015 19:34:25 +0000 (21:34 +0200)]
Staging: lustre: lustre: obdecho: Add blank line after declarations
The following patch fixes the checkpatch.pl warning:
drivers/staging/lustre/lustre/obdecho/echo_client.c WARNING: Missing a blank line after declarations