firefly-linux-kernel-4.4.55.git
10 years agoStaging:rtl8192e:rtl819x_BAProc:Remove whitespaces
Paul McQuade [Wed, 9 Apr 2014 20:01:29 +0000 (21:01 +0100)]
Staging:rtl8192e:rtl819x_BAProc:Remove whitespaces

ERROR: spaces required around that '=' (ctx:OxW)

Signed-off-by: Paul McQuade <paulmcquad@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: rtl8188eu: overflow in update_sta_support_rate()
Dan Carpenter [Mon, 7 Apr 2014 06:31:21 +0000 (09:31 +0300)]
Staging: rtl8188eu: overflow in update_sta_support_rate()

The ->SupportedRates[] array has NDIS_802_11_LENGTH_RATES_EX (16)
elements.  Since "ie_len" comes from then network and can go up to 255
then it means we should add a range check to prevent memory corruption.

Fixes: d6846af679e0 ('staging: r8188eu: Add files for new driver - part 7')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8192u: Fix indentation problems
Loïc Pellegrino [Sun, 6 Apr 2014 13:03:39 +0000 (14:03 +0100)]
staging: rtl8192u: Fix indentation problems

Fix coding style problems (incorrect indentation).

Signed-off-by: Loïc Pellegrino <oort10@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging rtl8188eu: add a blank line after declarations
huanqi chi [Sat, 5 Apr 2014 05:53:27 +0000 (13:53 +0800)]
staging rtl8188eu: add a blank line after declarations

fix a coding style issue: Missing a blank line after declarations

Signed-off-by: huanqi chi <chihuanqi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: silicom: remove redundant pci_get_drvdata() call
Daeseok Youn [Wed, 23 Apr 2014 08:18:42 +0000 (17:18 +0900)]
staging: silicom: remove redundant pci_get_drvdata() call

The pci_get_drvdata() and checking NULL for dev are
called twice in while loop in is_bypass_dev().

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: silicom: fix dangerous if condition in bpctl_mod.c
Neil Armstrong [Tue, 1 Apr 2014 13:03:44 +0000 (15:03 +0200)]
Staging: silicom: fix dangerous if condition in bpctl_mod.c

checkpatch script returns the following warning:
ERROR: do not use assignment in if condition
+                       if (((dev_num = get_dev_idx(dev->ifindex)) ==
            -1) |

This patch fixes the if condition by splitting it.

Signed-off-by: Neil Armstrong <superna9999@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: silicom: remove BP_PROC_SUPPORT dependant code
SeongJae Park [Wed, 26 Mar 2014 14:24:06 +0000 (23:24 +0900)]
staging: silicom: remove BP_PROC_SUPPORT dependant code

Some code is hide inside #ifdef BP_PROC_SUPPORT and it never defined
anywhere. And, it made defined but not used function which calling
code was hide inside #ifdef BP_PROC_SUPPORT and caused following
build warning:

drivers/staging/silicom/bpctl_mod.c:6786:12: warning:
‘bp_proc_create’ defined but not used [-Wunused-function]
 static int bp_proc_create(void)
            ^

Fix the warning and remove code complexity by remove whole code
inside #ifdef BP_PROC_SUPPORT.

Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: unisys: virthba: add MODULE_DEVICE_TABLE
Ken Cox [Thu, 24 Apr 2014 18:57:11 +0000 (13:57 -0500)]
Staging: unisys: virthba: add MODULE_DEVICE_TABLE

Add x86_cpu_id struct and call to MODULE_DEVICE_TABLE so this module
will be auto loaded on boot.

Signed-off-by: Ken Cox <jkc@redhat.com>
Tested-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: unisys: fix copyright notices
Benjamin Romer [Wed, 23 Apr 2014 18:58:34 +0000 (14:58 -0400)]
staging: unisys: fix copyright notices

This patch changes all of the various representations of the copyright symbol
to (C).

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: unisys: Fix typo in comment and printk
Masanari Iida [Mon, 14 Apr 2014 16:56:33 +0000 (01:56 +0900)]
staging: unisys: Fix typo in comment and printk

Fix spelling typo in comments and printk within unisys.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: unisys: Fix format string mismatch in virthba.c
Masanari Iida [Mon, 14 Apr 2014 16:56:32 +0000 (01:56 +0900)]
staging: unisys: Fix format string mismatch in virthba.c

Fix format string mismatch in info_proc_read() within virthba.c.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: keucr: fix sparse warning
Rui Miguel Silva [Sat, 12 Apr 2014 00:33:11 +0000 (01:33 +0100)]
staging: keucr: fix sparse warning

fix sparse warning:
drivers/staging/keucr/smilmain.c:163:5: warning: symbol 'Check_D_MediaFmt' was not declared. Should it be static?

by declaring it in the right header. And remove duplication of definition of
SM_INIT

Signed-off-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: keucr: Fix warning about missing blank lines after declarations
Jonas Hahnfeld [Wed, 26 Mar 2014 19:56:53 +0000 (20:56 +0100)]
staging: keucr: Fix warning about missing blank lines after declarations

This patches fixes two warnings of checkpatch.pl, both of the type
WARNING: Missing a blank line after declarations

Signed-off-by: Jonas Hahnfeld <hahnjo@hahnjo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: android: ion: duplicated clearing of sg_table
Gioh Kim [Thu, 24 Apr 2014 23:24:24 +0000 (08:24 +0900)]
Staging: android: ion: duplicated clearing of sg_table

Because sg_table is cleared in sg_alloc_table via memset we don't need to use
kzalloc to allocate sg_table.

Signed-off-by: Gioh Kim <gioh.kim@lge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/android: Remove ram_console.h
Bintian Wang [Tue, 22 Apr 2014 09:22:58 +0000 (17:22 +0800)]
staging/android: Remove ram_console.h

ram_console is replaced by pstore and pstore_ram drivers,
and there is no code to use this head file, so remove it.

Signed-off-by: Bintian Wang <bintian.wang@huawei.com>
Acked-by: Colin Cross <ccross@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: lustre: gfp_mask should be of gfp_t type
Fabio Falzoi [Fri, 25 Apr 2014 09:41:43 +0000 (11:41 +0200)]
Staging: lustre: gfp_mask should be of gfp_t type

Fixed the following sparse complaints:

drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:1039:61:
warning: restricted gfp_t degrades to integer
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:1092:61:
warning: restricted gfp_t degrades to integer
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:1136:58:
warning: incorrect type in argument 2 (different base types)
expected unsigned int [unsigned] gfp_mask
got restricted gfp_t [usertype] gfp_mask
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:1142:34:
warning: incorrect type in argument 3 (different base types)
expected unsigned int [unsigned] gfp_mask
got restricted gfp_t [usertype] gfp_mask
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:1147:58:
warning: incorrect type in argument 2 (different base types)
expected unsigned int [unsigned] gfp_mask
got restricted gfp_t [usertype] gfp_mask
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:1153:34:
warning: incorrect type in argument 3 (different base types)
expected unsigned int [unsigned] gfp_mask
got restricted gfp_t [usertype] gfp_mask

Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: lustre: ops structs should be declared static
Fabio Falzoi [Fri, 25 Apr 2014 09:41:42 +0000 (11:41 +0200)]
Staging: lustre: ops structs should be declared static

Fixed the following sparse complaints:

drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:549:22:
warning: symbol 'ldlm_srv_pool_ops' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:555:22:
warning: symbol 'ldlm_cli_pool_ops' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:681:1:
warning: symbol 'lprocfs_pool_state_fops' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:697:1:
warning: symbol 'lprocfs_grant_plan_fops' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:700:1:
warning: symbol 'lprocfs_wr_recalc_period' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:708:1:
warning: symbol 'lprocfs_recalc_period_fops' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:710:1:
warning: symbol 'ldlm_pool_u64_fops' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:711:1:
warning: symbol 'ldlm_pool_atomic_fops' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:712:1:
warning: symbol 'ldlm_pool_rw_atomic_fops' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:714:1:
warning: symbol 'lprocfs_grant_speed_fops' was not declared. Should it be static?

Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoStaging: lustre: Avoid using 0 instead of NULL
Fabio Falzoi [Fri, 25 Apr 2014 09:41:41 +0000 (11:41 +0200)]
Staging: lustre: Avoid using 0 instead of NULL

Fixed the following sparse complaints:

drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:755:9:
warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:757:9:
warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:758:9:
warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:759:9:
warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:760:9:
warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:762:9:
warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:764:9:
warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:765:9:
warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:766:9:
warning: Using plain integer as NULL pointer
drivers/staging/lustre/lustre/ptlrpc/../../lustre/ldlm/ldlm_pool.c:768:9:
warning: Using plain integer as NULL pointer

Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: lustre: improve length checks in ioctls
Dan Carpenter [Thu, 24 Apr 2014 21:49:13 +0000 (00:49 +0300)]
staging: lustre: improve length checks in ioctls

We copy "hdr->ioc_len" from the user twice but we only verify that it's
within the limit on the first copy.  Otherwise we could read unmapped
memory and Oops.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging:lustre: use gfp_t instead of int
Vitaly Osipov [Tue, 22 Apr 2014 13:25:21 +0000 (23:25 +1000)]
staging:lustre: use gfp_t instead of int

Fixed several sparse "warning: incorrect type" by replacing int
declarations with gfp_t

Signed-off-by: Vitaly Osipov <vitaly.osipov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: adv_pci1710: rename check_channel_list()
H Hartley Sweeten [Wed, 23 Apr 2014 23:07:01 +0000 (16:07 -0700)]
staging: comedi: adv_pci1710: rename check_channel_list()

For aesthetics, rename this function so it has namespace associated
with the driver.

Also, change it's parameters. The cmd->chanlist and cmd->chanlist_len
are always passed, just pass the comedi_cmd pointer instead.

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>
10 years agostaging: comedi: adv_pci1710: remove 'ai_do' from private data
H Hartley Sweeten [Wed, 23 Apr 2014 23:07:00 +0000 (16:07 -0700)]
staging: comedi: adv_pci1710: remove 'ai_do' from private data

This member of the private data is set to the "mode" that the ai command
is operating in but nothing uses it. Just remove it.

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>
10 years agostaging: comedi: adv_pci1710: absorb pci171x_ai_docmd_and_mode()
H Hartley Sweeten [Wed, 23 Apr 2014 23:06:59 +0000 (16:06 -0700)]
staging: comedi: adv_pci1710: absorb pci171x_ai_docmd_and_mode()

This helper function is called by the ai (*do_cmd) to setup and
start the async command based on the "mode" of operation. This
"mode" is determined by the cmd convert_src and start_src.

Move this "mode" determination and combine the functions.

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>
10 years agostaging: comedi: adv_pci1710: cmd->scan_begin_src can only be TRIG_FOLLOW
H Hartley Sweeten [Wed, 23 Apr 2014 23:06:58 +0000 (16:06 -0700)]
staging: comedi: adv_pci1710: cmd->scan_begin_src can only be TRIG_FOLLOW

In Step 1 of the (*do_cmdtest), the cmd->scan_begin_src is checked to
only allow TRIG_FOLLOW. The (*do_cmd) does not need to recheck this.

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>
10 years agostaging: comedi: adv_pci1710: remove 'ai_data_len' from private data
H Hartley Sweeten [Wed, 23 Apr 2014 23:06:57 +0000 (16:06 -0700)]
staging: comedi: adv_pci1710: remove 'ai_data_len' from private data

This member of the private data is just a copy of the s->async->prealloc_bufsz.
Use that instead.

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>
10 years agostaging: comedi: adv_pci1710: remove 'ai_scans' from private data
H Hartley Sweeten [Wed, 23 Apr 2014 23:06:56 +0000 (16:06 -0700)]
staging: comedi: adv_pci1710: remove 'ai_scans' from private data

This member of the private data is just a copy of the cmd->stop_arg.
Use that instead.

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>
10 years agostaging: comedi: adv_pci1710: remove 'ai_n_chan' from private data
H Hartley Sweeten [Wed, 23 Apr 2014 23:06:55 +0000 (16:06 -0700)]
staging: comedi: adv_pci1710: remove 'ai_n_chan' from private data

This member of the private data is just a copy of the cmd->chanlist_len.
Use that instead.

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>
10 years agostaging: comedi: adv_pci1710: remove 'ai_chanlist' from private data
H Hartley Sweeten [Wed, 23 Apr 2014 23:06:54 +0000 (16:06 -0700)]
staging: comedi: adv_pci1710: remove 'ai_chanlist' from private data

This member of the private data is just a copy of the cmd->chanlist.
Use that instead.

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>
10 years agostaging: comedi: adv_pci1710: remove 'ai_flags' from private data
H Hartley Sweeten [Wed, 23 Apr 2014 23:06:53 +0000 (16:06 -0700)]
staging: comedi: adv_pci1710: remove 'ai_flags' from private data

This member of the private data is just a copy of the cmd->flags. Use
that instead.

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>
10 years agostaging: comedi: adv_pci1710: remove 'ai_timer1' from private data
H Hartley Sweeten [Wed, 23 Apr 2014 23:06:52 +0000 (16:06 -0700)]
staging: comedi: adv_pci1710: remove 'ai_timer1' from private data

This member of the private data is just a copy of the cmd->convert_arg.
Use that instead and remove the unnecessary sanity checking since it
was already validated in the (*do_cmdtest).

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>
10 years agostaging: comedi: adv_pci1710: remove 'ai_timer2' from private data
H Hartley Sweeten [Wed, 23 Apr 2014 23:06:51 +0000 (16:06 -0700)]
staging: comedi: adv_pci1710: remove 'ai_timer2' from private data

This member of the private data is set to 0 but it is never used. Just
remove it.

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>
10 years agostaging: comedi: addi_apci_1564: board does not have analog outputs
Chase Southwood [Fri, 25 Apr 2014 08:18:10 +0000 (03:18 -0500)]
staging: comedi: addi_apci_1564: board does not have analog outputs

The board supported by this driver does not have analog outputs.  Remove
the subdevice init for it.

Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: addi_apci_1564: board does not have analog inputs
Chase Southwood [Fri, 25 Apr 2014 08:17:06 +0000 (03:17 -0500)]
staging: comedi: addi_apci_1564: board does not have analog inputs

This board does not have analog inputs.  Remove the subdevice init for
them.

Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: addi_apci_1564: separate from addi_common.c
Chase Southwood [Thu, 24 Apr 2014 07:19:01 +0000 (02:19 -0500)]
staging: comedi: addi_apci_1564: separate from addi_common.c

Using the addi-data "common" code in addi_apci_1564 introduces a lot of
bloat.  By separating this driver off from addi_common.c, a lot of the
common code can be stripped out.  This patch copies the code over from
addi_common.c, and removes the #include of the file.  The auto_attach
function from the common code replaces the one that was previously in this
driver, though renamed to that it stays within the namespace associated
with this driver, and the detach function has been renamed for this reason
as well.

Signed-off-by: Chase Southwood <chase.southwood@yahoo.com>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: amplc_pci224: only calc the pacer divisors once
H Hartley Sweeten [Wed, 23 Apr 2014 22:57:19 +0000 (15:57 -0700)]
staging: comedi: amplc_pci224: only calc the pacer divisors once

When the cmd->scan_begin_src == TRIG_TIMER the divisors needed to
generate the pacer time are calculated in the (*do_cmdtest) to
validate the cmd->scan_begin_arg. The core always does the
(*do_cmdtest) before the (*do_cmd) so there is no reason to recalc
the divisors.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: amplc_pci224: always cascade the 8254 timers
H Hartley Sweeten [Wed, 23 Apr 2014 22:57:18 +0000 (15:57 -0700)]
staging: comedi: amplc_pci224: always cascade the 8254 timers

The 8254 timers are only used in this driver to generate the analog
output pacer. To simplify the driver, always cascade the timers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: amplc_pci224: factor out the 'start pacer' code
H Hartley Sweeten [Wed, 23 Apr 2014 22:57:17 +0000 (15:57 -0700)]
staging: comedi: amplc_pci224: factor out the 'start pacer' code

To clarify the analog output (*do_cmd) function, factor out the
code that starts the pacer.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: amplc_pci224: remove pci224_cascade_ns_to_timer()
H Hartley Sweeten [Wed, 23 Apr 2014 22:57:16 +0000 (15:57 -0700)]
staging: comedi: amplc_pci224: remove pci224_cascade_ns_to_timer()

This function is just a wrapper around i8253_cascade_ns_to_timer().
Remove it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: addi_apci_1564: tidy up apci1564_reset()
Chase Southwood [Thu, 17 Apr 2014 06:33:03 +0000 (01:33 -0500)]
staging: comedi: addi_apci_1564: tidy up apci1564_reset()

The reset function for this driver is a bit of a mess; clean it up to
ensure that it is functioning properly.

Signed-off-by: Chase Southwood <chase.southwood@yahoo.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: me4000: remove unnecessary Step 2b test in (*do_cmdtest)
H Hartley Sweeten [Wed, 23 Apr 2014 22:52:32 +0000 (15:52 -0700)]
staging: comedi: me4000: remove unnecessary Step 2b test in (*do_cmdtest)

This test is unnecessary. It covers all the possible combinations of the
scan_end_src and stop_src triggers so the final else can never be reached.

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>
10 years agostaging: comedi: cb_pcidas64: remove unnecessary Step 2b test in (*do_cmdtest)
H Hartley Sweeten [Wed, 23 Apr 2014 22:52:31 +0000 (15:52 -0700)]
staging: comedi: cb_pcidas64: remove unnecessary Step 2b test in (*do_cmdtest)

This test is unnecessary. The cfc_check_trigger_src() in Step 1 ensures that
the trigger source is one of these values and Step 2 makes sure it's only one
of these values.

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>
10 years agostaging: comedi: adl_pci9111: clarify Step 2b of the (*do_cmdtest)
H Hartley Sweeten [Wed, 23 Apr 2014 22:52:30 +0000 (15:52 -0700)]
staging: comedi: adl_pci9111: clarify Step 2b of the (*do_cmdtest)

This step of the (*do_cmdtest) verifies that the selected trigger sources
are mutually compatible.

For this driver the scan_begin_src must be TRIG_FOLLOW or the same source
as the convert_src.

Simplify the logic to clarify this.

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>
10 years agodrivers/staging: Use RCU_INIT_POINTER(x, NULL) in fwserial/fwserial.c
Monam Agarwal [Sun, 23 Mar 2014 18:38:22 +0000 (00:08 +0530)]
drivers/staging: Use RCU_INIT_POINTER(x, NULL) in fwserial/fwserial.c

This patch replaces rcu_assign_pointer(x, NULL) with RCU_INIT_POINTER(x, NULL)

The rcu_assign_pointer() ensures that the initialization of a structure
is carried out before storing a pointer to that structure.
And in the case of the NULL pointer, there is no structure to initialize.
So, rcu_assign_pointer(p, NULL) can be safely converted to RCU_INIT_POINTER(p, NULL)

Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agofwserial: (coding style) removing FSF postal address
Dominique van den Broeck [Sat, 12 Apr 2014 13:18:15 +0000 (15:18 +0200)]
fwserial: (coding style) removing FSF postal address

Style-only modifications to make checkpatch.pl --file --strict a bit happier.
Removing FSF postal address from file top comment since it has changed in the
past, as stated by checkpatch.pl.

Signed-off-by: Dominique van den Broeck <domdevlin@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agofwserial: (coding style) useless "extern" & space
Dominique van den Broeck [Sat, 12 Apr 2014 13:18:14 +0000 (15:18 +0200)]
fwserial: (coding style) useless "extern" & space

Style-only modifications to make checkpatch.pl --file --strict a bit happier.
Removed useless "extern" in dma_fifo.h ;
Removed one supernumerary space.

Signed-off-by: Dominique van den Broeck <domdevlin@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agofwserial: (coding style) if/else bracket matching
Dominique van den Broeck [Sat, 12 Apr 2014 13:18:13 +0000 (15:18 +0200)]
fwserial: (coding style) if/else bracket matching

Style-only modifications to make checkpatch.pl --file --strict a bit happier.
if/else bracket matching (either none or both options should be bracketed).

Signed-off-by: Dominique van den Broeck <domdevlin@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agofwserial: (coding style) open parenthesis alignments
Dominique van den Broeck [Sat, 12 Apr 2014 13:18:12 +0000 (15:18 +0200)]
fwserial: (coding style) open parenthesis alignments

Style-only modifications to make checkpatch.pl --file --strict a bit happier.
Open parenthesis alignments.

Signed-off-by: Dominique van den Broeck <domdevlin@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: remove sbe-2t3e3 driver.
Greg Kroah-Hartman [Fri, 25 Apr 2014 20:59:57 +0000 (13:59 -0700)]
staging: remove sbe-2t3e3 driver.

It never really got cleaned up properly, and no one is working on it, so
remove it.  If someone wants to pick it up, this can be easily reverted.

Cc: Krzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: ni_mio_common: clarify the cmd->start_arg validation and use
H Hartley Sweeten [Thu, 17 Apr 2014 17:08:11 +0000 (10:08 -0700)]
staging: comedi: ni_mio_common: clarify the cmd->start_arg validation and use

Clarify the cmd->start_arg validation in Step 3 of the (*do_cmdtest)
functions.

For a TRIG_INT source, the cmd->start_arg is actually the valid
trig_num that is used by the async (*inttrig) callbacks.

Refactor the (*inttrig) functions so that the cmd->start_arg is used
to check the trig_num instead of the open coded values.

For aesthetics, refactor the (*do_cmd) functions to use if/else instead
of the switch to handle the cmd->start_src.

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>
10 years agostaging: comedi: usbdux: fix the cmd->start_arg use
H Hartley Sweeten [Thu, 17 Apr 2014 17:08:10 +0000 (10:08 -0700)]
staging: comedi: usbdux: fix the cmd->start_arg use

For all cmd->start_src values this driver trivially validates that the
cmd->start_arg is 0.

For a TRIG_INT source, the cmd->start_arg is actually the valid trig_num
that is used by the async (*inttrig) callback.

Refactor the (*inttrig) functions so that the cmd->start_arg is used to
check the trig_num instead of the open coded values.

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>
10 years agostaging: comedi: usbduxfast: fix the cmd->start_arg validation and use
H Hartley Sweeten [Thu, 17 Apr 2014 17:08:09 +0000 (10:08 -0700)]
staging: comedi: usbduxfast: fix the cmd->start_arg validation and use

This driver supports cmd->start_src values of TRIG_NOW, TRIG_EXT, and
TRIG_INT. Currently the cmd->start_arg is only validated for TRIG_NOW.

For TRIG_EXT sources, the cmd->start_src is driver specific. For a
TRIG_INT source, the cmd->start_arg is actually the valid trig_num
that is used by the async (*inttrig) callback.

The cmd->start_arg is currently not use in the driver. Just trivially
validate it to be 0 for all cmd->start_src values.

Refactor the (*inttrig) function so that the cmd->start_arg is used
to check the trig_num instead of the open coded value.

For aesthetics, remove some unnecessary comments in the (*do_cmd)
function.

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>
10 years agostaging: comedi: usbduxsigma: fix the ai/ao cmd->start_arg use for TRIG_INT
H Hartley Sweeten [Thu, 17 Apr 2014 17:08:08 +0000 (10:08 -0700)]
staging: comedi: usbduxsigma: fix the ai/ao cmd->start_arg use for TRIG_INT

For both ai and ao commands this driver supports a cmd->start_src of
TRIG_NOW or TRIG_INT. The cmd->start_arg is trivially validated for
both sources to be 0.

For a TRIG_INT source, the cmd->start_arg is actually the valid
trig_num that is used by the async (*inttrig) callback.

Refactor the (*inttrig) functions so that the cmd->start_arg is used
to check the trig_num instead of the open coded values.

For aesthetics, remove some unnecessary comments in the (*do_cmd)
functions.

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>
10 years agostaging: comedi: s626: clarify the cmd->start_arg validation and use
H Hartley Sweeten [Thu, 17 Apr 2014 17:08:07 +0000 (10:08 -0700)]
staging: comedi: s626: clarify the cmd->start_arg validation and use

This driver supports a cmd->start_src of TRIG_NOW, TRIG_INT or TRIG_EXT.

Clarify the cmd->start_arg validation in Step 3 of the (*do_cmdtest).

For a TRIG_INT source, the cmd->start_arg is actually the valid
trig_num that is used by the async (*inttrig) callback.

Refactor the (*inttrig) function so that the cmd->start_arg is used
to check the trig_num instead of the open coded value.

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>
10 years agostaging: comedi: pcmuio: fix the cmd->start_arg use for TRIG_INT
H Hartley Sweeten [Thu, 17 Apr 2014 17:08:06 +0000 (10:08 -0700)]
staging: comedi: pcmuio: fix the cmd->start_arg use for TRIG_INT

This driver supports a cmd->start_src of TRIG_NOW or TRIG_INT. The
cmd->start_arg is trivially validated for both sources to be 0.

For a TRIG_INT source, the cmd->start_arg is actually the valid
trig_num that is used by the async (*inttrig) callback.

Refactor the (*inttrig) function so that the cmd->start_arg is used
to check the trig_num instead of the open coded value.

For aesthetics, refactor the (*do_cmd) to use if/else instead if the
switch when handling the cmd->start_src.

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>
10 years agostaging: comedi: pcmmio: fix the cmd->start_arg use for TRIG_INT
H Hartley Sweeten [Thu, 17 Apr 2014 17:08:05 +0000 (10:08 -0700)]
staging: comedi: pcmmio: fix the cmd->start_arg use for TRIG_INT

This driver supports a cmd->start_src of TRIG_NOW or TRIG_INT. The
cmd->start_arg is trivially validated for both sources to be 0.

For a TRIG_INT source, the cmd->start_arg is actually the valid
trig_num that is used by the async (*inttrig) callback.

Refactor the (*inttrig) function so that the cmd->start_arg is used
to check the trig_num instead of the open coded value.

For aesthetics, refactor the (*do_cmd) to use if/else instead if the
switch when handling the cmd->start_src.

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>
10 years agostaging: comedi: ni_labpc: clarify the cmd->start_arg validation
H Hartley Sweeten [Thu, 17 Apr 2014 17:08:04 +0000 (10:08 -0700)]
staging: comedi: ni_labpc: clarify the cmd->start_arg validation

This driver supports cmd->start_src sources of TRIG_NOW and TRIG_EXT.
Refactor the (*do_cmdtest) to clarify the trivial validation of the
cmd->start_arg.

This also fixes a bug, the cmd->start_src has the trigger not the
cmd->start_arg.

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>
10 years agostaging: comedi: ni_tiocmd: clarify the cmd->start_arg validation and use
H Hartley Sweeten [Thu, 17 Apr 2014 17:08:03 +0000 (10:08 -0700)]
staging: comedi: ni_tiocmd: clarify the cmd->start_arg validation and use

This driver supportes cmd->start_src sources of TRIG_NOW, TRIG_INT, TRIG_OTHER,
and TRIG_EXT. Refactor the (*do_cmdtest) to clarify the trivial validation of
the cmd->start_arg. For a TRIG_INT source, the cmd->start_arg is actually the
valid trig_num that is passed to the async (*inttrig) callback.

Refactor the (*inttrig) function so that the cmd->start_arg is used to check
the trig_num instead of the open coded value.

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>
10 years agostaging: comedi: ni_pcidio: fix the cmd->start_arg use for TRIG_INT
H Hartley Sweeten [Thu, 17 Apr 2014 17:08:02 +0000 (10:08 -0700)]
staging: comedi: ni_pcidio: fix the cmd->start_arg use for TRIG_INT

This driver only a cmd->start_src of TRIG_NOW or TRIG_INT. The cmd->start_arg
is trivially validated for both sources to be 0. For a TRIG_INT source, the
cmd->start_arg is actually the valid trig_num that is passed to the async
(*inttrig) callback.

Refactor the (*inttrig) function so that the cmd->start_arg is used to check
the trig_num instead of the open coded value.

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>
10 years agostaging: comedi: me4000: validate the cmd->start_arg
H Hartley Sweeten [Thu, 17 Apr 2014 17:08:01 +0000 (10:08 -0700)]
staging: comedi: me4000: validate the cmd->start_arg

The cmd->start_arg should be trivially validated in Step 3 of the
(*do_cmdtest) functions. Add the necessary 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>
10 years agostaging: comedi: gsc_hpdi: validate the cmd->start_arg
H Hartley Sweeten [Thu, 17 Apr 2014 17:08:00 +0000 (10:08 -0700)]
staging: comedi: gsc_hpdi: validate the cmd->start_arg

The cmd->start_arg should be trivially validated in Step 3 of the
(*do_cmdtest) functions. Add the necessary 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>
10 years agostaging: comedi: dt282x: fix the ao cmd->start_arg use for TRIG_INT
H Hartley Sweeten [Thu, 17 Apr 2014 17:07:59 +0000 (10:07 -0700)]
staging: comedi: dt282x: fix the ao cmd->start_arg use for TRIG_INT

This driver only supports a cmd->start_src of TRIG_INT for ao commands. The
cmd->start_arg is trivially validated to be 0. For TRIG_INT source, the
cmd->start_arg is actually the valid trig_num that is passed to the async
(*inttrig) callback.

Refactor the (*inttrig) function so that the cmd->start_arg is used to check
the trig_num instead of the open coded value.

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>
10 years agostaging: comedi: cb_pcidas64: validate the ai/ao cmd->start_arg
H Hartley Sweeten [Thu, 17 Apr 2014 17:07:58 +0000 (10:07 -0700)]
staging: comedi: cb_pcidas64: validate the ai/ao cmd->start_arg

The cmd->start_arg should be trivially validated in Step 3 of the
(*do_cmdtest) functions. Add the necessary code.

For the analog output, a cmd->start_src of TRIG_NOW and TRIG_INT is
supported. For both sources the cmd->start_arg is validated to be 0.
For a TRIG_INT source, the cmd->start_Arg is actually the valid trig_num
that is passed to the async (*inttrig) callback.

Refactor the (*inttrig) function so that the cmd->start_arg is used to
check the trig_num instead of the open coded value.

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>
10 years agostaging: comedi: cb_pcidas: fix the ao cmd->start_arg use for TRIG_INT
H Hartley Sweeten [Thu, 17 Apr 2014 17:07:57 +0000 (10:07 -0700)]
staging: comedi: cb_pcidas: fix the ao cmd->start_arg use for TRIG_INT

This driver only supports a cmd->start_src of TRIG_INT for ai commands. The
cmd->start_arg is trivially validated to be 0. For TRIG_INT source, the
cmd->start_arg is actually the valid trig_num that is passed to the async
(*inttrig) callback.

Refactor the (*inttrig) function so that the cmd->start_arg is used to check
the trig_num instead of the open coded value.

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>
10 years agostaging: comedi: cb_pcidas: clarify the ai cmd->start_arg validation
H Hartley Sweeten [Thu, 17 Apr 2014 17:07:56 +0000 (10:07 -0700)]
staging: comedi: cb_pcidas: clarify the ai cmd->start_arg validation

This driver supports two cmd->start_src values, TRIG_NOW and TRIG_EXT.

For aesthetics, replace the default case when validating the cmd->start_arg
with the proper case statement.

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>
10 years agostaging: comedi: amplc_pci230: fix the ai/ao cmd->start_arg use for TRIG_INT
H Hartley Sweeten [Thu, 17 Apr 2014 17:07:55 +0000 (10:07 -0700)]
staging: comedi: amplc_pci230: fix the ai/ao cmd->start_arg use for TRIG_INT

This driver trivially validates the cmd->start_arg for all cmd->start_src values
to be 0. For TRIG_INT source, the cmd->start_arg is actually the valid trig_num
that is passed to the async (*inttrig) callback.

Refactor the (*inttrig) functions so that the cmd->start_arg is used to check the
trig_num instead of the open coded values.

For aesthetics, refactor the ai (*do_cmd) to remove some unnecessary {}.

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>
10 years agostaging: comedi: amplc_pci224: fix the ao cmd->start_arg use
H Hartley Sweeten [Thu, 17 Apr 2014 17:07:54 +0000 (10:07 -0700)]
staging: comedi: amplc_pci224: fix the ao cmd->start_arg use

This driver supports two cmd->start_src values, TRIG_INT and TRIG_EXT. For
TRIG_INT sources, the cmd->start_arg is actually the valid trig_num that is
passed to the async (*inttrig) callback. This driver trivially validates the
arg for this source to be 0.

Refactor the (*inttrig) so that the cmd->start_arg is used to check the trig_num
instead of the open coded value.

For aesthetics, refactor the (*do_cmd) to use if/else instead of the switch when
handling the cmd->start_src. All code paths do the spin lock/unlock so move those
out of the if/else.

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>
10 years agostaging: comedi: amplc_dio200_common: fix the cmd->start_arg use
H Hartley Sweeten [Thu, 17 Apr 2014 17:07:53 +0000 (10:07 -0700)]
staging: comedi: amplc_dio200_common: fix the cmd->start_arg use

This driver supports two cmd->start_src values, TRIG_NOW and TRIG_INT. TRIG_NOW
sources should always have an arg of 0. For TRIG_INT sources, the cmd->start_arg
is actually the valid trig_num that is passed to the async (*inttrig) callback.
This driver trivially validates the arg for both sources to be 0.

Refactor the (*inttrig) so that the cmd->start_arg is used to check the trig_num
instead of the open coded value.

For aesthetics, refactor the (*do_cmd) to use if/else instead of the switch when
handling the cmd->start_src.

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>
10 years agostaging: comedi: adl_pci9118: fix the ai cmd->start_arg validation and use
H Hartley Sweeten [Thu, 17 Apr 2014 17:07:52 +0000 (10:07 -0700)]
staging: comedi: adl_pci9118: fix the ai cmd->start_arg validation and use

This driver supports three cmd->start_src values, TRIG_NOW, TRIG_EXT, and
TRIG_INT. TRIG_NOW sources should always have an arg of 0 and arg for TRIG_EXT
sources is driver specific. This driver does not use the cmd->start_arg with
the TRIG_EXT source so a trivial value of 0 is good.

When the cmd->start_src is TRIG_INT the cmd->start_arg is actually the valid
trig_num that is passed to the async (*inttrig) callback. This driver allows
any value to be used and currently carries that value in the private data.

Refactor the (*do_cmdtest) so that the trivial validation of the cmd->start_arg
is clear.

Refactor the (*inttrig) so that the cmd->start_arg is used directly to check
the trig_num and remove the then unused 'ai_inttrig_start' member from the
private data.

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>
10 years agostaging: comedi: hwdrv_apci3200: properly validata the ai cmd->start_arg
H Hartley Sweeten [Thu, 17 Apr 2014 17:07:51 +0000 (10:07 -0700)]
staging: comedi: hwdrv_apci3200: properly validata the ai cmd->start_arg

The async command 'arguments' should be trivially validated in Step 3 of
the (*do_cmdtest) not Step 2b. Move the validataion in this driver to the
proper place.

This driver supports two cmd->start_src values, TRIG_NOW and TRIG_EXT.
TRIG_NOW sources should always have an arg of 0. The arg for TRIG_EXT
sources is driver specific.

Properly validate the cmd->start_arg based on the cmd->start_src. Remove
the noise when the arg is invalid and modify the cmd->start_arg so that
a valid value is returned to the user.

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>
10 years agostaging: comedi: comedi_test: ao subdevice does not support async commands
H Hartley Sweeten [Thu, 17 Apr 2014 17:07:50 +0000 (10:07 -0700)]
staging: comedi: comedi_test: ao subdevice does not support async commands

The comedi_subdevices array is kzalloc()'d so the async command callbacks do
not need to be set to NULL when the analog output subdevice is initialized.

Also, remove the initialzation of the subdevice 'len_chanlist' since this
value is only used by the async commands. The core will default it to 1.

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>
10 years agostaging: comedi: adl_pci9111: rename local var in pci9111_ai_do_cmd_test()
H Hartley Sweeten [Thu, 17 Apr 2014 17:07:49 +0000 (10:07 -0700)]
staging: comedi: adl_pci9111: rename local var in pci9111_ai_do_cmd_test()

For aesthetics, rename the local variable 'error' to 'err'. This is the
normal name for this local variable in (*do_cmdtest) functions.

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>
10 years agostaging: comedi: addi_apci_3xxx: fix ai subdevice 'len_chanlist'
H Hartley Sweeten [Thu, 17 Apr 2014 17:07:48 +0000 (10:07 -0700)]
staging: comedi: addi_apci_3xxx: fix ai subdevice 'len_chanlist'

Due to a driver limitation, the (*do_cmdtest) for the analog input subdevice
overrides the cmd->chanlist_len to force single channel chanlists. But, the
cmd->scan_end_arg was already validated before this happens. Instead of
fixing the (*do_cmdtest) just set the subdevice len_chanlist to 1 to limit
the chanlist size. Move the comment also.

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>
10 years agostaging: comedi: drivers: properly validate cmd->scan_end_arg
H Hartley Sweeten [Thu, 17 Apr 2014 17:07:47 +0000 (10:07 -0700)]
staging: comedi: drivers: properly validate cmd->scan_end_arg

When the async command 'scan_end_src' is TRIG_COUNT the 'scan_end_arg'
is the cmd->chanlist_len. Fix a couple open-coded drivers. Add the
check to the drivers that do not validate this command argument.

The core validates that the cmd->chanlist_len is <= s->len_chanlist.
During the post config after the attach the core also make sure that
the s->len_chanlist is initialized. For clarity, initialize the
s->len_chanlist in a couple drivers that are relying on the core to
initialize it to '1'.

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>
10 years agostaging: comedi: drivers: core validates chanlist_len max
H Hartley Sweeten [Thu, 17 Apr 2014 17:07:46 +0000 (10:07 -0700)]
staging: comedi: drivers: core validates chanlist_len max

The comedi core checks if the (cmd->chanlist_len > s->len_chanlist) when the
comedi_cmd is copied from user to kernel space by __comedi_get_user_cmd().
If so, the core returns -EINVAL and will not call the subdevice (*do_cmdtest)
and (*do_cmd).

Remove the unnecessary "max" checks in the comedi driver (*do_cmdtest) and
helper functions.

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>
10 years agostaging: comedi: ni_labpc: tidy up the chanlist checking
H Hartley Sweeten [Wed, 16 Apr 2014 21:19:21 +0000 (14:19 -0700)]
staging: comedi: ni_labpc: tidy up the chanlist checking

The labpc_ai_chanlist_invalid() function validates that the cmd->chanlist
is compatible with the hardware. This is step 5 of the (*do_cmdtest).

For aesthetics, rename this function and tidy up the code.

To minimize the noise, change the comedi_error(), which is a wrapper around
dev_err(), to dev_dbg().

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>
10 years agostaging: comedi: me4000: tidy up the chanlist checking
H Hartley Sweeten [Wed, 16 Apr 2014 21:19:20 +0000 (14:19 -0700)]
staging: comedi: me4000: tidy up the chanlist checking

The ai_check_chanlist() function validates that the cmd->chanlist is compatible
with the hardware. This is step 5 of the (*do_cmdtest).

For aesthetics, rename this function so it has namespace associated with the
driver and tidy up the code.

To minimize the noise, change the dev_err() to dev_dbg().

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>
10 years agostaging: comedi: ni_mio_common: factor out chanlist checking from (*do_cmdtest)
H Hartley Sweeten [Wed, 16 Apr 2014 21:19:19 +0000 (14:19 -0700)]
staging: comedi: ni_mio_common: factor out chanlist checking from (*do_cmdtest)

Step 5 of the (*do_cmdtest) validates that the cmd->chanlist is compatible
with the hardware.

Remove the unnecessary step 5 code in the analog output async command support.

For aesthetics, factor out the step 5 code for the "cdio" async command support.
Tidy up the factored out 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>
10 years agostaging: comedi: ni_at_a2150: factor out chanlist checking from (*do_cmdtest)
H Hartley Sweeten [Wed, 16 Apr 2014 21:19:18 +0000 (14:19 -0700)]
staging: comedi: ni_at_a2150: factor out chanlist checking from (*do_cmdtest)

Step 5 of the (*do_cmdtest) validates that the cmd->chanlist is compatible
with the hardware.

For aesthetics, factor out the step 5 code for the analog input async command
support. Tidy up the factored out code.

To minimize the noise, change the comedi_error(), which is a wrapper around
dev_err(), to dev_dbg().

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>
10 years agostaging: comedi: gsc_hpdi: factor out chanlist checking from (*do_cmdtest)
H Hartley Sweeten [Wed, 16 Apr 2014 21:19:17 +0000 (14:19 -0700)]
staging: comedi: gsc_hpdi: factor out chanlist checking from (*do_cmdtest)

Step 5 of the (*do_cmdtest) validates that the cmd->chanlist is compatible
with the hardware.

For aesthetics, factor out the step 5 code for the async command support. Tidy
up the factored out code.

To minimize the noise, change the dev_err() to dev_dbg().

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>
10 years agostaging: comedi: dmm32at: factor out chanlist checking from (*do_cmdtest)
H Hartley Sweeten [Wed, 16 Apr 2014 21:19:16 +0000 (14:19 -0700)]
staging: comedi: dmm32at: factor out chanlist checking from (*do_cmdtest)

Step 5 of the (*do_cmdtest) validates that the cmd->chanlist is compatible
with the hardware.

For aesthetics, factor out the step 5 code for the analog input async command
support. Tidy up the factored out code.

To minimize the noise, change the comedi_error(), which is a wrapper around
dev_err(), to dev_dbg().

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>
10 years agostaging: comedi: das800: factor out chanlist checking from (*do_cmdtest)
H Hartley Sweeten [Wed, 16 Apr 2014 21:19:15 +0000 (14:19 -0700)]
staging: comedi: das800: factor out chanlist checking from (*do_cmdtest)

Step 5 of the (*do_cmdtest) validates that the cmd->chanlist is compatible
with the hardware.

For aesthetics, factor out the step 5 code for the analog input async command
support. Tidy up the factored out code.

To minimize the noise, change the dev_err() to dev_dbg().

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>
10 years agostaging: comedi: das1800: factor out chanlist checking from (*do_cmdtest)
H Hartley Sweeten [Wed, 16 Apr 2014 21:19:14 +0000 (14:19 -0700)]
staging: comedi: das1800: factor out chanlist checking from (*do_cmdtest)

Step 5 of the (*do_cmdtest) validates that the cmd->chanlist is compatible
with the hardware.

For aesthetics, factor out the step 5 code for the analog input async command
support. Tidy up the factored out code.

To minimize the noise, change the comedi_error(), which is a wrapper around
dev_err(), to dev_dbg().

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>
10 years agostaging: comedi: das16m1: factor out chanlist checking from (*do_cmdtest)
H Hartley Sweeten [Wed, 16 Apr 2014 21:19:13 +0000 (14:19 -0700)]
staging: comedi: das16m1: factor out chanlist checking from (*do_cmdtest)

Step 5 of the (*do_cmdtest) validates that the cmd->chanlist is compatible
with the hardware.

For aesthetics, factor out the step 5 code for the analog input async command
support. Tidy up the factored out code.

To minimize the noise, change the comedi_error(), which is a wrapper around
dev_err(), to dev_dbg().

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>
10 years agostaging: comedi: das16: factor out chanlist checking from (*do_cmdtest)
H Hartley Sweeten [Wed, 16 Apr 2014 21:19:12 +0000 (14:19 -0700)]
staging: comedi: das16: factor out chanlist checking from (*do_cmdtest)

Step 5 of the (*do_cmdtest) validates that the cmd->chanlist is compatible
with the hardware.

For aesthetics, factor out the step 5 code for the analog input async command
support. Tidy up the factored out code.

To minimize the noise, change the dev_err() to dev_dbg().

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>
10 years agostaging: comedi: cb_pcidas64: factor out chanlist checking from (*do_cmdtest)
H Hartley Sweeten [Wed, 16 Apr 2014 21:19:11 +0000 (14:19 -0700)]
staging: comedi: cb_pcidas64: factor out chanlist checking from (*do_cmdtest)

Step 5 of the (*do_cmdtest) validates that the cmd->chanlist is compatible
with the hardware.

For aesthetics, factor out the step 5 code for the analog input and analog
output async command support. Tidy up the factored out code.

To minimize the noise, change the comedi_error(), which is a wrapper around
dev_err(), to dev_dbg().

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>
10 years agostaging: comedi: cb_pcidas: factor out chanlist checking from (*do_cmdtest)
H Hartley Sweeten [Wed, 16 Apr 2014 21:19:10 +0000 (14:19 -0700)]
staging: comedi: cb_pcidas: factor out chanlist checking from (*do_cmdtest)

Step 5 of the (*do_cmdtest) validates that the cmd->chanlist is compatible
with the hardware.

For aesthetics, factor out the step 5 code for the analog input and analog
output async command support. Tidy up the factored out code.

To minimize the noise, change the comedi_error(), which is a wrapper around
dev_err(), to dev_dbg().

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>
10 years agostaging: comedi: amplc_pci230: factor out chanlist checking from (*do_cmdtest)
H Hartley Sweeten [Wed, 16 Apr 2014 21:19:09 +0000 (14:19 -0700)]
staging: comedi: amplc_pci230: factor out chanlist checking from (*do_cmdtest)

Step 5 of the (*do_cmdtest) validates that the cmd->chanlist is compatible
with the hardware.

For aesthetics, factor out the step 5 code for the analog output and analog
input async command support. Tidy up the factored out 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>
10 years agostaging: comedi: amplc_pci224: factor out chanlist checking from (*do_cmdtest)
H Hartley Sweeten [Wed, 16 Apr 2014 21:19:08 +0000 (14:19 -0700)]
staging: comedi: amplc_pci224: factor out chanlist checking from (*do_cmdtest)

Step 5 of the (*do_cmdtest) validates that the cmd->chanlist is compatible
with the hardware.

For aesthetics, factor the step 5 code for the analog output async command
support. Tidy up the factored out 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>
10 years agostaging: comedi: adl_pci9111: factor out chanlist checking from (*do_cmdtest)
H Hartley Sweeten [Wed, 16 Apr 2014 21:19:07 +0000 (14:19 -0700)]
staging: comedi: adl_pci9111: factor out chanlist checking from (*do_cmdtest)

Step 5 of the (*do_cmdtest) validates that the cmd->chanlist is compatible
with the hardware.

For aesthetics, factor out the step 5 code for the analog input async command
support. Tidy up the factored out code.

To minimize the noise, change the comedi_err(), which is a wrapper around
dev_err(), to dev_dbg().

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>
10 years agostaging: comedi: addi_apci_1564: remove use of devpriv->iobase
Chase Southwood [Tue, 15 Apr 2014 05:53:55 +0000 (00:53 -0500)]
staging: comedi: addi_apci_1564: remove use of devpriv->iobase

devpriv->iobase is currently being used to hold the iobase address used to
read/write the board's registers.  The same address is stored in the
comedi_device dev->iobase.  We use that instead.  The eventual goal is to
decrease the driver's use of the struct addi_private, so that it may
eventually use a much slimmer specialized private struct instead, as the
other addi_apci_* drivers do.

Signed-off-by: Chase Southwood <chase.southwood@yahoo.com>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoMerge 3.15-rc2 into staging-next
Greg Kroah-Hartman [Tue, 22 Apr 2014 17:08:40 +0000 (10:08 -0700)]
Merge 3.15-rc2 into staging-next

This resolves a bunch of merge errors with other fixes that are already
in Linus's tree.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoLinux 3.15-rc2
Linus Torvalds [Sun, 20 Apr 2014 18:08:50 +0000 (11:08 -0700)]
Linux 3.15-rc2

10 years agoMerge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma
Linus Torvalds [Sun, 20 Apr 2014 17:35:31 +0000 (10:35 -0700)]
Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma

Pull slave-dmaengine fixes from Vinod Koul:
 "Back from long weekend here in India and now the time to send fixes
  for slave dmaengine.
   - Dan's fix of sirf xlate code
   - Jean's fix for timberland
   - edma fixes by Sekhar for SG handling and Yuan for changing init
     call"

* 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
  dma: fix eDMA driver as a subsys_initcall
  dmaengine: sirf: off by one in of_dma_sirfsoc_xlate()
  platform: Fix timberdale dependencies
  dma: edma: fix incorrect SG list handling

10 years agoMerge tag 'iommu-fixes-v3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 20 Apr 2014 17:33:49 +0000 (10:33 -0700)]
Merge tag 'iommu-fixes-v3.15-rc1' of git://git./linux/kernel/git/joro/iommu

Pull iommu fixes from Joerg Roedel:
 "Fixes for regressions:

   - fix wrong IOMMU enumeration causing some SCSI device drivers
     initialization failures
   - ARM-SMMU fixes for a panic condition and a wrong return value"

* tag 'iommu-fixes-v3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
  iommu/arm-smmu: fix panic in arm_smmu_alloc_init_pte
  iommu/arm-smmu: Return 0 on unmap failure
  iommu/vt-d: fix bug in matching PCI devices with DRHD/RMRR descriptors
  iommu/vt-d: Fix get_domain_for_dev() handling of upstream PCIe bridges
  iommu/vt-d: fix memory leakage caused by commit ea8ea46

10 years agoMerge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 20 Apr 2014 17:32:33 +0000 (10:32 -0700)]
Merge branch 'perf-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull perf tooling fixes from Ingo Molnar:
 "Three small tooling fixes"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf tools: Improve error reporting
  perf tools: Adjust symbols in VDSO
  perf kvm: Fix 'Min time' counting in report command

10 years agoMerge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git...
Ingo Molnar [Sun, 20 Apr 2014 07:53:55 +0000 (09:53 +0200)]
Merge tag 'perf-urgent-for-mingo' of git://git./linux/kernel/git/jolsa/perf into perf/urgent

Pull perf/urgent fixes from Jiri Olsa:

User visible changes:

  * Adjust symbols in VDSO to properly resolve its function names (Vladimir Nikulichev)

  * Improve error reporting for record session failure (Adrien BAK)

  * Fix 'Min time' counting in report command (Alexander Yarygin)

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
10 years agoperf tools: Improve error reporting
Adrien BAK [Fri, 18 Apr 2014 02:00:43 +0000 (11:00 +0900)]
perf tools: Improve error reporting

In the current version, when using perf record, if something goes
wrong in tools/perf/builtin-record.c:375
  session = perf_session__new(file, false, NULL);

The error message:
"Not enough memory for reading per file header"

is issued. This error message seems to be outdated and is not very
helpful. This patch proposes to replace this error message by
"Perf session creation failed"

I believe this issue has been brought to lkml:
https://lkml.org/lkml/2014/2/24/458
although this patch only tackles a (small) part of the issue.

Additionnaly, this patch improves error reporting in
tools/perf/util/data.c open_file_write.

Currently, if the call to open fails, the user is unaware of it.
This patch logs the error, before returning the error code to
the caller.

Reported-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Adrien BAK <adrien.bak@metascale.org>
Link: http://lkml.kernel.org/r/1397786443.3093.4.camel@beast
[ Reorganize the changelog into paragraphs ]
[ Added empty line after fd declaration in open_file_write ]
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
10 years agoperf tools: Adjust symbols in VDSO
Vladimir Nikulichev [Thu, 17 Apr 2014 15:27:01 +0000 (08:27 -0700)]
perf tools: Adjust symbols in VDSO

pert-report doesn't resolve function names in VDSO:

$ perf report --stdio -g flat,0.0,15,callee --sort pid
...
            8.76%
               0x7fff6b1fe861
               __gettimeofday
               ACE_OS::gettimeofday()
...

In this case symbol values should be adjusted the same way as for executables,
relocatable objects and prelinked libraries.

After fix:

$ perf report --stdio -g flat,0.0,15,callee --sort pid
...
            8.76%
               __vdso_gettimeofday
               __gettimeofday
               ACE_OS::gettimeofday()

Signed-off-by: Vladimir Nikulichev <nvs@tbricks.com>
Tested-by: Namhyung Kim <namhyung@kernel.org>
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Link: http://lkml.kernel.org/r/969812.163009436-sendEmail@nvs
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
10 years agoperf kvm: Fix 'Min time' counting in report command
Alexander Yarygin [Wed, 9 Apr 2014 14:21:59 +0000 (16:21 +0200)]
perf kvm: Fix 'Min time' counting in report command

Every event in the perf-kvm has a 'stats' structure, which contains
max/min/average/etc times of handling this event.
The problem is that the 'perf-kvm stat report' command always shows
that 'min time' is 0us for every event. Example:

 # perf kvm stat report

 Analyze events for all VCPUs:

    VM-EXIT    Samples  Samples%     Time%   Min Time   Max Time Avg time
  [..]
  0xB2 MSCH         12     0.07%     0.00%        0us        8us 7.31us ( +-   2.11% )
  0xB2 CHSC         12     0.07%     0.00%        0us       18us 9.39us ( +-   9.49% )
  0xB2 STPX          8     0.05%     0.00%        0us        2us 1.88us ( +-   7.18% )
  0xB2 STSI          7     0.04%     0.00%        0us       44us 16.49us ( +-  38.20% )
  [..]

This happens because the 'stats' structure is not initialized and
stats->min equals to 0. Lets initialize the structure for every
event after its allocation using init_stats() function. This initializes
stats->min to -1 and makes 'Min time' statistics counting work:

 # perf kvm stat report

 Analyze events for all VCPUs:

    VM-EXIT    Samples  Samples%     Time%   Min Time   Max Time Avg time
  [..]
  0xB2 MSCH         12     0.07%     0.00%        6us        8us 7.31us ( +-   2.11% )
  0xB2 CHSC         12     0.07%     0.00%        7us       18us 9.39us ( +-   9.49% )
  0xB2 STPX          8     0.05%     0.00%        1us        2us 1.88us ( +-   7.18% )
  0xB2 STSI          7     0.04%     0.00%        1us       44us 16.49us ( +-  38.20% )
  [..]

Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Link: http://lkml.kernel.org/r/1397053319-2130-3-git-send-email-borntraeger@de.ibm.com
[ Fixing the perf examples changelog output ]
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
10 years agocoredump: fix va_list corruption
Eric Dumazet [Sat, 19 Apr 2014 17:15:07 +0000 (10:15 -0700)]
coredump: fix va_list corruption

A va_list needs to be copied in case it needs to be used twice.

Thanks to Hugh for debugging this issue, leading to various panics.

Tested:

  lpq84:~# echo "|/foobar12345 %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h" >/proc/sys/kernel/core_pattern

'produce_core' is simply : main() { *(int *)0 = 1;}

  lpq84:~# ./produce_core
  Segmentation fault (core dumped)
  lpq84:~# dmesg | tail -1
  [  614.352947] Core dump to |/foobar12345 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 (null) pipe failed

Notice the last argument was replaced by a NULL (we were lucky enough to
not crash, but do not try this on your production machine !)

After fix :

  lpq83:~# echo "|/foobar12345 %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h" >/proc/sys/kernel/core_pattern
  lpq83:~# ./produce_core
  Segmentation fault
  lpq83:~# dmesg | tail -1
  [  740.800441] Core dump to |/foobar12345 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 pipe failed

Fixes: 5fe9d8ca21cc ("coredump: cn_vprintf() has no reason to call vsnprintf() twice")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Diagnosed-by: Hugh Dickins <hughd@google.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: stable@vger.kernel.org # 3.11+
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>