platform/kernel/linux-exynos.git
8 years agoStaging: rtl8192u: Replace memset with eth_broadcast_addr
Bhumika Goyal [Tue, 1 Mar 2016 18:48:31 +0000 (00:18 +0530)]
Staging: rtl8192u: Replace memset with eth_broadcast_addr

Use eth_broadcast_addr to assign the broadcast address to the given
address array instead of memset when the second argument is a broacast
address 0xff. ETH_ALEN is a macro with value 6, so 6 is treated as
ETH_ALEN if it is the third argument of memset.

Done using coccinelle.
@@
expression e;
@@
- memset(e,\(0xff\|0xFF\|255\),\(ETH_ALEN\|6\));
+ eth_broadcast_addr(e);

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8192u: ieee80211: Remove unused variables
Bhaktipriya Shridhar [Sun, 28 Feb 2016 12:18:36 +0000 (17:48 +0530)]
staging: rtl8192u: ieee80211: Remove unused variables

The pointer *skb2 is declared 'globally' inside  ifdef NOT_YET.
It's used nowhere in the directory.
Another pointer *skb2 is declared 'locally', again inside another ifdef NOT_YET
in the function ieee80211_rx_frame_mgmt.
Hence, skb2 stays unused and has been removed.

This was done using Coccinelle:

@@ type T; identifier i; constant c; @@
-T i;
<... when != i
-i = c;
...>

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: rtl8192u: Remove debug messages
Bhumika Goyal [Wed, 24 Feb 2016 17:16:00 +0000 (22:46 +0530)]
Staging: rtl8192u: Remove debug messages

As kmalloc generates a backtrace on failure so there is no need of
these debug messages when kmalloc fails. Also remove unwanted {} around if
block after removal of these messages.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: rtl8192u: Clean up tests if NULL returned on failure
Bhumika Goyal [Wed, 24 Feb 2016 10:17:35 +0000 (15:47 +0530)]
Staging: rtl8192u: Clean up tests if NULL returned on failure

Some functions return Null as their return value on failure. !x is
generally preferred over x==NULL or NULL==x. So make use of !x if
the value returned on failure is NULL.
Done using coccinelle:
@@
expression e;
statement S;
@@
e = \(kmalloc\|devm_kzalloc\|kmalloc_array
     \|devm_ioremap\|usb_alloc_urb\|alloc_netdev\)(...);
- if(e==NULL)
+ if(!e)
  S

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8192u: ieee802111: Drop Useless Initialization
Bhaktipriya Shridhar [Tue, 23 Feb 2016 21:27:57 +0000 (02:57 +0530)]
staging: rtl8192u: ieee802111: Drop Useless Initialization

Removed initialisation of a varible if it is immediately reassigned.
Changes were made using Coccinelle.
@bad@
identifier i;
position p;
@@

i =@p <+...i...+>;

@@
type T;
constant C;
expression e;
identifier i;
position p != bad.p;
@@
T i
- = C
;
i =@p e;

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8192u: ieee80211: Use macro DIV_ROUND_UP
Bhaktipriya Shridhar [Sun, 21 Feb 2016 10:13:00 +0000 (15:43 +0530)]
staging: rtl8192u: ieee80211: Use macro DIV_ROUND_UP

The macro DIV_ROUND_UP performs the computation
(((n) + (d) - 1) /(d)). It clarifies the divisor calculations.
This was done using the coccinelle script:
@@
expression e1;
expression e2;
@@
(
- ((e1) + e2 - 1) / (e2)
+ DIV_ROUND_UP(e1,e2)
|
- ((e1) + (e2 - 1)) / (e2)
+ DIV_ROUND_UP(e1,e2)
)

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: goldfish: audio: fix compiliation on arm
Greg Hackmann [Fri, 26 Feb 2016 19:00:18 +0000 (19:00 +0000)]
staging: goldfish: audio: fix compiliation on arm

We do actually need slab.h, by luck we get it on other platforms but not
always on ARM. Include it properly.

Signed-off-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Jin Qian <jinqian@android.com>
Signed-off-by: Alan <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: goldfish: audio: add devicetree bindings
Greg Hackmann [Fri, 26 Feb 2016 19:00:03 +0000 (19:00 +0000)]
staging: goldfish: audio: add devicetree bindings

Introduce devicetree bindings to the Goldfish staging audio driver.

Signed-off-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Jin Qian <jinqian@android.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8192e: rtllib_crypt_tkip: Remove unnecessary else after return
Bhaktipriya Shridhar [Thu, 10 Mar 2016 17:13:34 +0000 (22:43 +0530)]
staging: rtl8192e: rtllib_crypt_tkip: Remove unnecessary else after return

This patch fixes the checkpatch warning that else is not generally
useful after a break or return.

This was done using Coccinelle:
@@
expression e2;
statement s1;
@@
if(e2) { ... return ...; }
-else
         s1

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: rtl8192e: Replace random_ether_addr with eth_random_addr
Bhumika Goyal [Tue, 1 Mar 2016 19:42:03 +0000 (01:12 +0530)]
Staging: rtl8192e: Replace random_ether_addr with eth_random_addr

The macro random_ether_addr is calling the function eth_random_addr.
Therefore, the call to random_ether_addr can be replaced with
eth_random_addr.
Remove the wrapper function rtllib_randomize_cell and replace its
call with eth_random_addr as it is wrapping random_ether_addr.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8192e: Drop cast on void pointer
Janani Ravichandran [Thu, 25 Feb 2016 19:56:33 +0000 (14:56 -0500)]
staging: rtl8192e: Drop cast on void pointer

Void pointers need not be cast to other pointer types.
Semantic patch used:

@r@
expression x;
void *e;
type T;
identifier f;
@@

(
  *((T *)e)
|
  ((T *)x) [...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8192e: rtl8192e: Remove create_workqueue()
Amitoj Kaur Chawla [Thu, 25 Feb 2016 03:53:31 +0000 (09:23 +0530)]
staging: rtl8192e: rtl8192e: Remove create_workqueue()

With conccurency managed workqueues, use of dedicated workqueues can
be replaced by system_wq. Drop priv_wq by using system_wq.

Since there are multiple work items per priv but they do not need
to be ordered, increase of concurrency by switching to system_wq
should not break anything.

All work items are sync canceled on so it is guaranteed that
no work is running when rtl92e_suspend function is called.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agodrivers: staging: rtl8192e: rtllib_rx.c: Fix blank lines before a close brace
Tapan Prakash T [Wed, 24 Feb 2016 17:36:12 +0000 (23:06 +0530)]
drivers: staging: rtl8192e: rtllib_rx.c: Fix blank lines before a close brace

Fixed checkpatch.pl issue 'Blank lines aren't necessary before a close
brace'

Signed-off-by: Tapan Prakash T <tapanprakasht@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agodrivers: staging: rtl8192e: rtllib_rx.c: Fix code indent for conditional statement
Tapan Prakash T [Wed, 24 Feb 2016 17:17:47 +0000 (22:47 +0530)]
drivers: staging: rtl8192e: rtllib_rx.c: Fix code indent for conditional statement

Fixed checkpatch.pl warning 'suspect code indent for conditional
statements'

Signed-off-by: Tapan Prakash T <tapanprakasht@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8192e: Prefer using macro DIV_ROUND_UP
Bhaktipriya Shridhar [Tue, 8 Mar 2016 17:59:37 +0000 (23:29 +0530)]
staging: rtl8192e: Prefer using macro DIV_ROUND_UP

The macro DIV_ROUND_UP performs the computation
(((n) + (d) - 1) /(d)). It clarifies the divisor calculations.
This was done using the coccinelle script:
@@
expression e1;
expression e2;
@@
(
- ((e1) + e2 - 1) / (e2)
+ DIV_ROUND_UP(e1,e2)
|
- ((e1) + (e2 - 1)) / (e2)
+ DIV_ROUND_UP(e1,e2)
)

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8192e: Remove create_workqueue()
Amitoj Kaur Chawla [Sat, 20 Feb 2016 10:06:26 +0000 (15:36 +0530)]
staging: rtl8192e: Remove create_workqueue()

With conccurency managed workqueues, use of dedicated workqueues can
be replaced by system_wq. Drop wq by using system_wq.

Since there are multiple work items per rtllib but they do not need to
be ordered, increase of concurrency by switching to system_wq should
not break anything.

All work items are sync canceled on rtllib_stop_protocol() so it is
guaranteed that no work is running when rtl92e_disable/reset/restart
functions are called.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: Possible unnecessary 'out of memory' message
Anchal Jain [Fri, 11 Mar 2016 14:19:50 +0000 (19:49 +0530)]
staging: wilc1000: Possible unnecessary 'out of memory' message

Remove unnnecessary debug message.
Problem detected by checkpatch.

Signed-off-by: Anchal Jain <anchalj109@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: use mutex instead of semaphore sem_cfg_values
Chaehyun Lim [Tue, 8 Mar 2016 01:04:32 +0000 (10:04 +0900)]
staging: wilc1000: use mutex instead of semaphore sem_cfg_values

This patch replaces struct semaphore sem_cfg_values with struct mutex
cfg_values_lock. It is better to use mutex than semaphore.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: lustre: Use list_{next/prev}_entry instead of list_entry
Bhumika Goyal [Sun, 6 Mar 2016 14:56:58 +0000 (20:26 +0530)]
Staging: lustre: Use list_{next/prev}_entry instead of list_entry

This patch replace list_entry with list_{next/prev}_entry as it makes
the code more clear to read.
Done using coccinelle:

@@
expression e1;
identifier e3;
type t;
@@
(
- list_entry(e1->e3.next,t,e3)
+ list_next_entry(e1,e3)
|
- list_entry(e1->e3.prev,t,e3)
+ list_prev_entry(e1,e3)
)

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: lustre: lnet: Use list_first_entry_or_null
Bhumika Goyal [Sun, 6 Mar 2016 14:38:44 +0000 (20:08 +0530)]
Staging: lustre: lnet: Use list_first_entry_or_null

This patch replaces list_empty and list_entry with
list_first_entry_or_null.
Done using coccinelle:

@@
expression e1,e2;
statement S;
@@
- if(!list_empty(...)){
  e2=
- list_entry(e1.next,
+ list_first_entry_or_null(&e1,
  ...);
+ if(e2){
...
}

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8723au: hal: Remove useless return variables
Bhaktipriya Shridhar [Thu, 25 Feb 2016 12:04:43 +0000 (17:34 +0530)]
staging: rtl8723au: hal: Remove useless return variables

This patch removes unnecessary return variables and compresses the
return logic.
The coccinelle script that finds and fixes this issue is:
@@ type T; identifier i,f; constant C; @@
- T i;
...when != i
when strict
( return -C;
|
- i =
+ return
f(...);
- return i;
)

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: rtl8723au: Remove debug messages
Bhumika Goyal [Wed, 24 Feb 2016 17:04:31 +0000 (22:34 +0530)]
Staging: rtl8723au: Remove debug messages

As kmalloc generates a backtrace on failure so there is no need of these
debug messages when kmalloc fails. Also remove unwanted {} around if block
after removal of these messages.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: rtl8723au: Clean up tests if NULL returned on failure
Bhumika Goyal [Wed, 24 Feb 2016 10:23:57 +0000 (15:53 +0530)]
Staging: rtl8723au: Clean up tests if NULL returned on failure

Some functions like kmalloc/usb_alloc_urb returns Null as their return
value on failure. !x is generally preferred over x==NULL or NULL==x. So
make use of !x if the value returned on failure by these functions is NULL.
Done using coccinelle:

@@
expression e;
statement S;
@@
e = \(kmalloc\|devm_kzalloc\|kmalloc_array
     \|devm_ioremap\|usb_alloc_urb\|alloc_netdev\)(...);
- if(e==NULL)
+ if(!e)
  S

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8723au: Remove unnecessary parantheses
Bhaktipriya Shridhar [Mon, 22 Feb 2016 17:07:00 +0000 (22:37 +0530)]
staging: rtl8723au: Remove unnecessary parantheses

Removed parantheses on the right hand side of assignments as they are
not needed.

This was done with Coccinelle:

@@ expression a, b; @@

a =
- (
b
- )
;

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8723au: core: rtw_recv: use list_first_entry()
Geliang Tang [Tue, 1 Mar 2016 15:35:33 +0000 (23:35 +0800)]
staging: rtl8723au: core: rtw_recv: use list_first_entry()

Use list_first_entry() instead of container_of() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8723au: core: rtw_xmit: use list_first_entry_or_null()
Geliang Tang [Tue, 1 Mar 2016 15:35:32 +0000 (23:35 +0800)]
staging: rtl8723au: core: rtw_xmit: use list_first_entry_or_null()

Use list_first_entry_or_null() instead of list_empty() + container_of()
to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8723au: core: rtw_recv: use list_first_entry_or_null()
Geliang Tang [Tue, 1 Mar 2016 15:35:31 +0000 (23:35 +0800)]
staging: rtl8723au: core: rtw_recv: use list_first_entry_or_null()

Use list_first_entry_or_null() instead of list_empty() + container_of()
to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoRevert "staging: comedi: drivers: Remove unneeded NULL check before kfree()"
Greg Kroah-Hartman [Fri, 11 Mar 2016 03:35:54 +0000 (19:35 -0800)]
Revert "staging: comedi: drivers: Remove unneeded NULL check before kfree()"

This reverts commit 3545bee9b8ec00ba733e17363f494c8761fb5e49.

It's not correct.

Reported-by: Hartley Sweeten <HartleyS@visionengravers.com>
Cc: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_pcidio.c: Prefer using macro DIV_ROUND_UP
Bhaktipriya Shridhar [Wed, 9 Mar 2016 19:04:44 +0000 (00:34 +0530)]
staging: comedi: ni_pcidio.c: Prefer using macro DIV_ROUND_UP

The macro DIV_ROUND_UP performs the computation
(((n) + (d) - 1) /(d)). It clarifies the divisor calculations.
This was done using the coccinelle script:
@@
expression e1;
expression e2;
@@
(
- ((e1) + e2 - 1) / (e2)
+ DIV_ROUND_UP(e1,e2)
|
- ((e1) + (e2 - 1)) / (e2)
+ DIV_ROUND_UP(e1,e2)
)

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: dt282x: Prefer using macro DIV_ROUND_UP
Bhaktipriya Shridhar [Wed, 9 Mar 2016 18:54:49 +0000 (00:24 +0530)]
staging: comedi: dt282x: Prefer using macro DIV_ROUND_UP

The macro DIV_ROUND_UP performs the computation
(((n) + (d) - 1) /(d)). It clarifies the divisor calculations.
This was done using the coccinelle script:
@@
expression e1;
expression e2;
@@
(
- ((e1) + e2 - 1) / (e2)
+ DIV_ROUND_UP(e1,e2)
|
- ((e1) + (e2 - 1)) / (e2)
+ DIV_ROUND_UP(e1,e2)
)

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: rtd520: Prefer using macro DIV_ROUND_UP
Bhaktipriya Shridhar [Wed, 9 Mar 2016 18:49:38 +0000 (00:19 +0530)]
staging: comedi: rtd520: Prefer using macro DIV_ROUND_UP

The macro DIV_ROUND_UP performs the computation
(((n) + (d) - 1) /(d)). It clarifies the divisor calculations.
This was done using the coccinelle script:
@@
expression e1;
expression e2;
@@
(
- ((e1) + e2 - 1) / (e2)
+ DIV_ROUND_UP(e1,e2)
|
- ((e1) + (e2 - 1)) / (e2)
+ DIV_ROUND_UP(e1,e2)
)

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: drivers: ni_mio_common: Prefer using macro DIV_ROUND_UP
Bhaktipriya Shridhar [Wed, 9 Mar 2016 18:35:16 +0000 (00:05 +0530)]
staging: comedi: drivers: ni_mio_common: Prefer using macro DIV_ROUND_UP

The macro DIV_ROUND_UP performs the computation
(((n) + (d) - 1) /(d)). It clarifies the divisor calculations.
This was done using the coccinelle script:
@@
expression e1;
expression e2;
@@
(
- ((e1) + e2 - 1) / (e2)
+ DIV_ROUND_UP(e1,e2)
|
- ((e1) + (e2 - 1)) / (e2)
+ DIV_ROUND_UP(e1,e2)
)

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: drivers: amplc_pci230: Prefer using macro DIV_ROUND_UP
Bhaktipriya Shridhar [Wed, 9 Mar 2016 18:33:49 +0000 (00:03 +0530)]
staging: comedi: drivers: amplc_pci230: Prefer using macro DIV_ROUND_UP

The macro DIV_ROUND_UP performs the computation
(((n) + (d) - 1) /(d)). It clarifies the divisor calculations.
This was done using the coccinelle script:
@@
expression e1;
expression e2;
@@
(
- ((e1) + e2 - 1) / (e2)
+ DIV_ROUND_UP(e1,e2)
|
- ((e1) + (e2 - 1)) / (e2)
+ DIV_ROUND_UP(e1,e2)
)

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: comedi: Use predefined macro offset_in_page() instead of (addr & ~PAGE_MASK).
Sandhya Bankar [Sun, 6 Mar 2016 07:05:29 +0000 (12:35 +0530)]
Staging: comedi: Use predefined macro offset_in_page() instead of (addr & ~PAGE_MASK).

Use predefined macro offset_in_page() instead of (addr & ~PAGE_MASK).

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: drivers: gsc_hpdi: Remove use of deprecated pci API
Amitoj Kaur Chawla [Sun, 6 Mar 2016 00:21:52 +0000 (05:51 +0530)]
staging: comedi: drivers: gsc_hpdi: Remove use of deprecated pci API

Replace pci_[alloc|free]_consistent occurences with
dma_[alloc|free]_coherent.

The Coccinelle semantic patch that was used to make some of these
changes is as follows:
@deprecated@
idexpression id;
position p;
@@

(
  pci_dma_supported@p ( id, ...)
|
  pci_alloc_consistent@p ( id, ...)
)

@bad1@
idexpression id;
position deprecated.p;
@@
...when != &id->dev
   when != pci_get_drvdata ( id )
   when != pci_enable_device ( id )
(
  pci_dma_supported@p ( id, ...)
|
  pci_alloc_consistent@p ( id, ...)
)

@depends on !bad1@
idexpression id;
expression direction;
position deprecated.p;
@@

(
- pci_dma_supported@p ( id,
+ dma_supported ( &id->dev,
...
+ , GFP_KERNEL
  )
|
- pci_alloc_consistent@p ( id,
+ dma_alloc_coherent ( &id->dev,
...
+ , GFP_KERNEL
  )
)

gsc_hpdi_auto_attach does not affect interrupt status but contains a
call to comedi_alloc_devpriv() which calls kzalloc with GFP_KERNEL flag.
Thus, there seems to be no danger that dma_alloc_coherent can be called
with interrupts turned off, and GFP_KERNEL can be used.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: visornic: Remove unnecessary else after return
Bhaktipriya Shridhar [Thu, 10 Mar 2016 17:39:14 +0000 (23:09 +0530)]
staging: unisys: visornic: Remove unnecessary else after return

This patch fixes the checkpatch warning that else is not generally
useful after a break or return.

This was done using Coccinelle:
@@
expression e2;
statement s1;
@@
if(e2) { ... return ...; }
-else
         s

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: visorbus: clean up visorchannel_clear
David Kershner [Wed, 9 Mar 2016 02:28:28 +0000 (21:28 -0500)]
staging: unisys: visorbus: clean up visorchannel_clear

Goto label was ambiguous change to out_free_page to signify that
we will always go through the path even on success.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Timothy Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: visorbus: cleanup gotos in visorchannel_create_guts
David Kershner [Wed, 9 Mar 2016 02:28:27 +0000 (21:28 -0500)]
staging: unisys: visorbus: cleanup gotos in visorchannel_create_guts

Away label is ambiguous change to it err_destroy_channel to make it
clear this is an error path.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Timothy Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: most: Use usb_endpoint_dir_in(endpoint) instead of (endpoint->bEndpointAddre...
Sandhya Bankar [Sun, 6 Mar 2016 10:20:35 +0000 (15:50 +0530)]
Staging: most: Use usb_endpoint_dir_in(endpoint) instead of (endpoint->bEndpointAddress & USB_DIR_IN).

Use usb_endpoint_dir_in(endpoint) instead of (endpoint->bEndpointAddress & USB_DIR_IN) to check if the endpoint has IN direction.
This correction is based on following semantic patch,

@@
struct usb_endpoint_descriptor *endpoint;
expression E;
@@

(
- endpoint->bEndpointAddress & USB_DIR_IN
+ usb_endpoint_dir_in(endpoint)
|
- endpoint->bEndpointAddress == USB_DIR_IN
+ usb_endpoint_dir_in(endpoint)
|
- (endpoint->bEndpointAddress & E) == USB_DIR_IN
+ usb_endpoint_dir_in(endpoint)
)

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: most: Use list_first_entry instead of list_entry
Bhumika Goyal [Sun, 6 Mar 2016 15:36:47 +0000 (21:06 +0530)]
Staging: most: Use list_first_entry instead of list_entry

This patch replaces list_entry with list_first_entry as it makes the
code more clear.
Done using coccinelle:

@@
expression e;
@@
(
- list_entry(e->next,
+ list_first_entry(e,
  ...)
|
- list_entry(e->prev,
+ list_last_entry(e,
  ...)
)

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: visorinput: convert pr_err() to dev_err()
Eva Rachel Retuya [Sat, 5 Mar 2016 15:16:17 +0000 (23:16 +0800)]
staging: unisys: visorinput: convert pr_err() to dev_err()

Replace pr_err() calls with respective dev_err() counterpart.
Semantic patch used to detect and apply the transformation:

@r exists@
identifier f,s,i;
position p;
@@

f(...,struct s *i,...) {
  <+...
  pr_err@p(...)
  ...+>
}

@s@
identifier r.s, dev;
@@

struct s {
...
struct device dev;
...
};

@t@
identifier r.i, s.dev;
expression fmt;
position r.p;
@@

- pr_err@p(
+ dev_err(&i->dev,
fmt, ...);

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: most: Replace pr_err with dev_err
Bhumika Goyal [Sat, 5 Mar 2016 13:46:40 +0000 (19:16 +0530)]
Staging: most: Replace pr_err with dev_err

All devm functions has a device structure as the first argument which is
required by dev_{err,info,dbg} printing functions.
This patch converts pr_err to dev_err as dev_* is preferred after calls
to devm functions.

Done using coccinelle:

@r1 exists@
expression e,e1;
identifier f =~ "^devm_";
identifier g =~ "^pcim_";
identifier h =~ "^dmam_";
@@
e=\(f\|g\|h\)(e1,...);
<+...
(
- pr_info(
+ dev_info(e1,
   ...);
|
- pr_err(
+ dev_err(e1,
  ...);
|
- pr_debug(
+ dev_dbg(e1,
  ...);
)
...+>

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: visorbus: variable adjustment should be a u64
David Kershner [Thu, 3 Mar 2016 18:00:38 +0000 (13:00 -0500)]
staging: unisys: visorbus: variable adjustment should be a u64

This patch fixes the smatch error:

drivers/staging/unisys/visorbus/visorchipset.c:2217 visorchipset_ioctl()
warn: user controlled 'adjustment' cast to postive rl = 's64min-s64max'

This is because we read a s64 and pass it to a function as u64.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: vt6655: Remove & from function name.
Sandhya Bankar [Sun, 6 Mar 2016 07:13:27 +0000 (12:43 +0530)]
Staging: vt6655: Remove & from function name.

Remove & from function name,when function name passed as an argument to another function.
Function name is used as pointer without &.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: vt6655: remove unnecessary blank lines from card.c
Ben Marsh [Tue, 1 Mar 2016 18:45:09 +0000 (19:45 +0100)]
Staging: vt6655: remove unnecessary blank lines from card.c

This a patch to card.c to remove unnecessary blank lines in order to
remove a checkpatch.pl warning.

Signed-off-by: Ben Marsh <bmarsh94@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: vt6656: Remove unnecessary parentheses
Rehas Sachdeva [Fri, 26 Feb 2016 12:57:05 +0000 (18:27 +0530)]
staging: vt6656: Remove unnecessary parentheses

This patch removes the following checkpatch.pl warnings:
Unnecessary parentheses around al7230_init_table_amode[0][0]
Unnecessary parentheses around al7230_channel_table2[0][0]

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: vt6655: mac.c replace dwData with data.
Malcolm Priestley [Sun, 6 Mar 2016 12:57:12 +0000 (12:57 +0000)]
staging: vt6655: mac.c replace dwData with data.

Removing camel case and type prefix.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: vt6655: mac.c replace wOffset with offset.
Malcolm Priestley [Sun, 6 Mar 2016 12:57:11 +0000 (12:57 +0000)]
staging: vt6655: mac.c replace wOffset with offset.

Removing camel case and type prefix.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: vt6655: mac.c replace byOrgDMACtl with org_dma_ctl
Malcolm Priestley [Sun, 6 Mar 2016 12:57:10 +0000 (12:57 +0000)]
staging: vt6655: mac.c replace byOrgDMACtl with org_dma_ctl

Removing camel case and type prefix.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: vt6655: mac Replace dwCurrDescAddr with curr_desc_addr.
Malcolm Priestley [Sun, 6 Mar 2016 12:57:09 +0000 (12:57 +0000)]
staging: vt6655: mac Replace dwCurrDescAddr with curr_desc_addr.

Removing camel case and type prefix.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: vt6655: mac.c replace VNSvInPortB with ioread8
Malcolm Priestley [Sun, 6 Mar 2016 12:57:08 +0000 (12:57 +0000)]
staging: vt6655: mac.c replace VNSvInPortB with ioread8

Removing the macro from functions.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: vt6655: MACvSetLoopbackMode replace byOrgValue with ioread8
Malcolm Priestley [Sun, 6 Mar 2016 12:57:07 +0000 (12:57 +0000)]
staging: vt6655: MACvSetLoopbackMode replace byOrgValue with ioread8

Removing VNSvInPortB and nesting inside iowrite8.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: vt6655: MACbPSWakeup replace VNSvInPortB byOrgValue with ioread8
Malcolm Priestley [Sun, 6 Mar 2016 12:57:06 +0000 (12:57 +0000)]
staging: vt6655: MACbPSWakeup replace VNSvInPortB byOrgValue with ioread8

removing byOrgValue variable.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: vt6655: mac.c replace VNSvOutPortB with iowrite8
Malcolm Priestley [Sun, 6 Mar 2016 12:57:05 +0000 (12:57 +0000)]
staging: vt6655: mac.c replace VNSvOutPortB with iowrite8

removing macro from functions

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: vt6655: mac.c replace VNSvOutPortW with iowrite16
Malcolm Priestley [Sun, 6 Mar 2016 12:57:04 +0000 (12:57 +0000)]
staging: vt6655: mac.c replace VNSvOutPortW with iowrite16

removig macro from functions.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: vt6655: mac.c replace VNSvOutPortD with iowrite32.
Malcolm Priestley [Sun, 6 Mar 2016 12:57:03 +0000 (12:57 +0000)]
staging: vt6655: mac.c replace VNSvOutPortD with iowrite32.

Removing the macro from functions.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: vt6655: mac.c/h resize all unsigned long to u32
Malcolm Priestley [Sun, 6 Mar 2016 12:57:02 +0000 (12:57 +0000)]
staging: vt6655: mac.c/h resize all unsigned long to u32

All addressing is limited to 32 bits match this to all
functions and port out functions.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: vt6655: MACvRestoreContext replace for loops with memcpy_toio.
Malcolm Priestley [Sun, 6 Mar 2016 12:57:01 +0000 (12:57 +0000)]
staging: vt6655: MACvRestoreContext replace for loops with memcpy_toio.

Removing the need for variable ii.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: vt6655: mac.c rename pbyCxtBuf to cxt_buf
Malcolm Priestley [Sun, 6 Mar 2016 12:57:00 +0000 (12:57 +0000)]
staging: vt6655: mac.c rename pbyCxtBuf to cxt_buf

Removing camel case and type prefix.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: vt6655: MACvSaveContext use memcpy_fromio to read context.
Malcolm Priestley [Sun, 28 Feb 2016 19:02:57 +0000 (19:02 +0000)]
staging: vt6655: MACvSaveContext use memcpy_fromio to read context.

Use memcpy_fromio to store data removing the need for local count.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: vt6655: replace VNSvInPortD dwData reads with ioread32
Malcolm Priestley [Sun, 28 Feb 2016 19:02:56 +0000 (19:02 +0000)]
staging: vt6655: replace VNSvInPortD dwData reads with ioread32

Removing dwData variable altogether.

The reads are always 32 bit insize.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: vt6655: mac.c Replace VNSvInPortB byData reads with ioread8.
Malcolm Priestley [Sun, 28 Feb 2016 19:02:55 +0000 (19:02 +0000)]
staging: vt6655: mac.c Replace VNSvInPortB byData reads with ioread8.

Removing byData variable altogether.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: vt6655: mac.c rename dwIoBase to io_base
Malcolm Priestley [Sun, 28 Feb 2016 19:02:54 +0000 (19:02 +0000)]
staging: vt6655: mac.c rename dwIoBase to io_base

Removing camel case.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: make lustre dependent on LNet
James Simmons [Tue, 8 Mar 2016 22:35:29 +0000 (17:35 -0500)]
staging: lustre: make lustre dependent on LNet

In the case of lustre routers you only need a functioning
LNet stack. Especially since often the routers are very
light weight and want to avoid any addition software that
would create additional pressures on the system.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: add help section of Kconfig config LNET
James Simmons [Tue, 8 Mar 2016 22:35:28 +0000 (17:35 -0500)]
staging: lustre: add help section of Kconfig config LNET

Include a help section for Kconfig LNET.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: fixup kernel Kconfig option LNET_MAX_PAYLOAD
James Simmons [Tue, 8 Mar 2016 22:35:27 +0000 (17:35 -0500)]
staging: lustre: fixup kernel Kconfig option LNET_MAX_PAYLOAD

A few errors exist for the Kconfig option LNET_MAX_PAYLOAD. First
mistake is the default size is 1MB not 2MB as it is shown to the
person configuring the kernel. Second the LNET_MAX_PAYLOAD option
is more closely related to LNET than the LUSTRE_FS option.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: move libcfs to lnet layer
James Simmons [Tue, 8 Mar 2016 22:35:26 +0000 (17:35 -0500)]
staging: lustre: move libcfs to lnet layer

The lustre file system has a layered architecture with
libcfs as the lowest layer and LNet layered on top. Then
on top of LNet we run the lustre client. This patch moves
the libcfs module code out of lustre into the lnet tree.
This fits into the long term goal of eventually merging
libcfs into LNet.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: make LNet use lprocfs_call_handler
James Simmons [Mon, 7 Mar 2016 23:10:24 +0000 (18:10 -0500)]
staging: lustre: make LNet use lprocfs_call_handler

Sometime ago a patch was submitted to duplicate the
proc_call_handler code in the LNet layer. This was
due to the thinking libcfs was not used by the LNet
layer. This was a wrong assumption so lets make LNet
use the lprocfs_call_handler from the libcfs layer.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: rename proc_call_handler to lprocfs_call_handler
James Simmons [Mon, 7 Mar 2016 23:10:23 +0000 (18:10 -0500)]
staging: lustre: rename proc_call_handler to lprocfs_call_handler

Using proc_call_handler as a function name is way too generic.
Rename to lprocfs_call_handler to avoid possible collisions.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: change test to assert in LNetGetId
James Simmons [Mon, 7 Mar 2016 23:10:22 +0000 (18:10 -0500)]
staging: lustre: change test to assert in LNetGetId

The ln_refcount test was changed into an assert.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: Correct missing newline
James Nunez [Mon, 7 Mar 2016 23:10:21 +0000 (18:10 -0500)]
staging: lustre: Correct missing newline

Several error messages are missing newline characters
at the end of the message. Newlines are added where
necessary and other minor corrections; no punctuation
at the end of an error message, add a return code to
the end of error messages, device name at the beginning,
etc.

There are just a couple of places where newlines are
removed and this is only in LDLM_DEBUG_NOLOCK. The definition
of LDLM_DEBUG_NOLOCK already has a newline in it and
resulted in double newlines printed.

Signed-off-by: James Nunez <james.a.nunez@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4871
Reviewed-on: http://review.whamcloud.com/10000
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Cliff White <cliff.white@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: fix 'data race condition' issue in framework.c
Sebastien Buisson [Mon, 7 Mar 2016 23:10:20 +0000 (18:10 -0500)]
staging: lustre: fix 'data race condition' issue in framework.c

Fix 'data race condition' defects found by Coverity version 6.5.0:
Data race condition (MISSING_LOCK)
Accessing variable without holding lock. Elsewhere,
this variable is accessed with lock held.

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2744
Reviewed-on: http://review.whamcloud.com/6568
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: fix 'NULL pointer dereference' errors
Sebastien Buisson [Mon, 7 Mar 2016 23:10:19 +0000 (18:10 -0500)]
staging: lustre: fix 'NULL pointer dereference' errors

Fix 'NULL pointer dereference' defects found by Coverity version
6.5.3:
Dereference after null check (FORWARD_NULL)
For instance, Passing null pointer to a function which dereferences
it.
Dereference before null check (REVERSE_INULL)
Null-checking variable suggests that it may be null, but it has
already been dereferenced on all paths leading to the check.
Dereference null return value (NULL_RETURNS)

The following fixes for the LNet layer are broken out of patch
http://review.whamcloud.com/4720.

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2217
Reviewed-on: http://review.whamcloud.com/4720
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: fix 'data race condition' issue in conrpc.c
Sebastien Buisson [Mon, 7 Mar 2016 23:10:18 +0000 (18:10 -0500)]
staging: lustre: fix 'data race condition' issue in conrpc.c

Fix 'data race condition' defects found by Coverity version 6.5.0:
Data race condition (MISSING_LOCK)
Accessing variable without holding lock. Elsewhere,
this variable is accessed with lock held.

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2744
Reviewed-on: http://review.whamcloud.com/6567
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: LNet network latency simulation
Liang Zhen [Mon, 7 Mar 2016 23:10:17 +0000 (18:10 -0500)]
staging: lustre: LNet network latency simulation

Incoming lnet message can be delayed for seconds if it can match
any of LNet Delay Rules.

User can add/remove/list Delay Rule by lctl commands:
- lctl net_delay_add
  Add a new Delay Rule to LNet, options
  <-s | --source SRC_NID>
  <-d | --dest DST_NID>
  <<-r | --rate RATE_NUMBER>
  <-i | --interlval SECONDS>>
  <-l | --latency DELAY_LATENCY>

- lctl net_delay_del
  Remove matched Delay Rule from LNet, options:
  <[-a | --all] |
  <-s | --source SRC_NID>
  <-d | --dest DST_NID>>

- lctl net_delay_list
  List all Delay Rules in LNet

- lctl net_delay_reset
  Reset statistic counters for all Delay Rules

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435
Reviewed-on: http://review.whamcloud.com/11409
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: LNet drop rule implementation
Liang Zhen [Mon, 7 Mar 2016 23:10:16 +0000 (18:10 -0500)]
staging: lustre: LNet drop rule implementation

This is implementation of LNet Drop Rule, which can randomly drop
LNet messages at specified rate.

LNet Drop Rule can only be applied to receive side of message. User
can add drop_rule either on end point of cluster (client/server) or
on LNet routers.

Here are lctl command to control LNet Drop Rules:
 - net_drop_add -s SRC_NID -d DEST_NID --rate VALUE
   drop 1/@VALUE of messages from @SRC_NID to @DEST_NID

 - net_drop_del -s SRC_NID -d DEST_NID
   remove all drop rules from @SRC_NID to @DEST_NID

 - net_drop_list
   list all drop rules on current node

 Examples:
 - lctl net_drop_add -s *@o2ib0 -d 192.168.1.102@tcp 1000
   add new drop rule, it will drop 1/1000 messages from network o2ib0
   to 192.168.1.102@tcp

 - lctl net_drop_add -s 10.8.6.123@o2ib1 -d * 500
   add new drop rule, it will drop 1/500 messages from 10.8.6.123@o2ib1
   to all nodes

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435
Reviewed-on: http://review.whamcloud.com/11314
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoisdn: i4l: move active-isdn drivers to staging
Arnd Bergmann [Wed, 2 Mar 2016 19:06:46 +0000 (20:06 +0100)]
isdn: i4l: move active-isdn drivers to staging

The icn, act2000 and pcbit drivers are all for very old hardware,
and it is highly unlikely that anyone is actually still using them
on modern kernels, if at all.

All three drivers apparently are for hardware that predates PCI
being the common connector, as they are ISA-only and active
PCI ISDN cards were widely available in the 1990s.

Looking through the git logs, it I cannot find any indication of a
patch to any of these drivers that has been tested on real hardware,
only cleanups or global API changes.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Karsten Keil <isdn@linux-pingi.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoisdn: icn: remove a #warning
Arnd Bergmann [Wed, 2 Mar 2016 19:06:45 +0000 (20:06 +0100)]
isdn: icn: remove a #warning

The icn driver currently produces an unconditional #warning whenever
we build it, introduced by Karsten Keil back in 2003:

 #warning TODO test headroom or use skb->nb to flag ACK

Karsten's original commit (from BitKeeper) contains this description:

    - here are lot of bugs left, so ISDN is not stable yet but
      I think it's really time to fix it, even if it need some cycles
      to get it right (normally I'm only send patches if it works 100% for
      me).
    - I add some additional #warnings to address places which need fixing
      (I hope that some of the other ISDN developer jump in)

Apparently this has not happened, and it is unlikely that it ever will,
given that the driver doesn't seem to work. No substantial bug fixes
other than janitorial cleanups have happened in the driver since then,
and I see no indication that anyone who patched it had the hardware.

We should probably either remove the driver, or remove all of i4l,
but for now, this shuts up the distracting #warning by turning it
into a comment.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: http://git.meleeweb.net/linux.git/commit/?id=b0deac0886b0056765afd149e9834373b38e096b
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: comedi.h: Fix comment for struct comedi_krange
Ian Abbott [Wed, 2 Mar 2016 14:27:38 +0000 (14:27 +0000)]
staging: comedi: comedi.h: Fix comment for struct comedi_krange

The kernel-doc comment for `struct comedi_krange` refers to the macro
constant `RF_external`.  It should be `RF_EXTERNAL`, so fix it.  It also
documents the value of the constant as `(1 << 8)`, but the macro now
expands to the hexadecimal constant `0x100`, so use that as the
documented value.

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>
8 years agostaging: comedi: comedi.h: Do not use BIT macro
Ian Abbott [Wed, 2 Mar 2016 14:27:37 +0000 (14:27 +0000)]
staging: comedi: comedi.h: Do not use BIT macro

The "comedi.h" file is part of the user API for COMEDI devices, and is
intended to be migrated to "include/uapi/linux".  The `BIT` macro from
"include/linux/bitops.h" should not be used there.

Replace the use of the `BIT` macro with hexadecimal constants of the
same value.  The `BIT` macro replaced expressions of the form `(1 << N)`
in this file originally, but reverting back to that form would encourage
patches changing them back to use the `BIT` macro.

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>
8 years agostaging: comedi: cb_pcimdda: Fix long lines in comments
Rasmus Linusson [Sun, 28 Feb 2016 15:38:12 +0000 (16:38 +0100)]
staging: comedi: cb_pcimdda: Fix long lines in comments

Reorder comments to keep 80 character limit

Signed-off-by: Rasmus Linusson <rasmus@linusson.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: cb_pcimdda: Fix multi-line comments
Rasmus Linusson [Sun, 28 Feb 2016 15:38:11 +0000 (16:38 +0100)]
staging: comedi: cb_pcimdda: Fix multi-line comments

Add asterisks to multi-line comments currently missing them

Signed-off-by: Rasmus Linusson <rasmus@linusson.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: comedi: s626.c: Remove unused functions
Bhumika Goyal [Sun, 28 Feb 2016 07:58:47 +0000 (13:28 +0530)]
Staging: comedi: s626.c: Remove unused functions

The functions s626_get_clk_mult, s626_get_clk_mult, s626_get_enc_mode,
s626_set_index_pol are not used anywhere in the kernel so they can be
removed. This also cleans the code. Grepped to find the occurences.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: drivers: Remove use of deprecated pci API
Amitoj Kaur Chawla [Wed, 24 Feb 2016 11:15:34 +0000 (16:45 +0530)]
staging: comedi: drivers: Remove use of deprecated pci API

Replace pci_[alloc|free]_consistent occurences with
dma_[alloc|free]_coherent.

The Coccinelle semantic patch that was used to make some of these
changes is as follows:
@deprecated@
idexpression id;
position p;
@@

(
  pci_dma_supported@p ( id, ...)
|
  pci_alloc_consistent@p ( id, ...)
)

@bad1@
idexpression id;
position deprecated.p;
@@
...when != &id->dev
   when != pci_get_drvdata ( id )
   when != pci_enable_device ( id )
(
  pci_dma_supported@p ( id, ...)
|
  pci_alloc_consistent@p ( id, ...)
)

@depends on !bad1@
idexpression id;
expression direction;
position deprecated.p;
@@

(
- pci_dma_supported@p ( id,
+ dma_supported ( &id->dev,
...
+ , GFP_KERNEL
  )
|
- pci_alloc_consistent@p ( id,
+ dma_alloc_coherent ( &id->dev,
...
+ , GFP_KERNEL
  )
)

alloc_and_init_dma_members does not affect the interrupt status and is
only called by auto_attach, which also does not affect the interrupt
status. auto_attach() also contains a call to comedi_alloc_devpriv()
which calls kzalloc with GFP_KERNEL flag.  Thus, there seems to be no
danger that dma_alloc_coherent can be called with interrupts turned
off, and GFP_KERNEL can be used.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: drivers: Remove unneeded NULL check before kfree()
Janani Ravichandran [Wed, 24 Feb 2016 00:36:04 +0000 (19:36 -0500)]
staging: comedi: drivers: Remove unneeded NULL check before kfree()

Remove NULL check before kfree as it is not needed.

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: comedi: contec_pci_dio: fixed comment blocks coding style issues
Philippe Loctaux [Mon, 22 Feb 2016 23:47:59 +0000 (00:47 +0100)]
Staging: comedi: contec_pci_dio: fixed comment blocks coding style issues

Makes the comment blocks start with /* on separate lines, and end
with */ on separate lines as well,
starting with * for each comment lines.

Signed-off-by: Philippe Loctaux <phil@philippeloctaux.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: Use macro DIV_ROUND_CLOSEST
Bhaktipriya Shridhar [Sun, 21 Feb 2016 10:43:01 +0000 (16:13 +0530)]
staging: comedi: Use macro DIV_ROUND_CLOSEST

Occurences of the computation (x +d/2)/d can be replaced with
the macro DIV_ROUND_CLOSEST.

This was detected by the following Coccinelle script.

@@
expression e1,e2;
@@
(
- ((e1) + e2/2) / (e2)
+ DIV_ROUND_CLOSEST(e1,e2)
|
- ((e1) + (e2/2)) / (e2)
+ DIV_ROUND_CLOSEST(e1,e2)
)

Since some lines exceeded the 80 character limit,
some changes were made by hand.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agocomedi: note a coverity discovered hole that needs fixing
Alan [Mon, 15 Feb 2016 18:59:06 +0000 (18:59 +0000)]
comedi: note a coverity discovered hole that needs fixing

It's not trivial to just post up a fix, so add it to the TODO list and
ensure it doesn't get lost.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: gdm724x: Replace random_ether_addr with eth_random_addr
Bhumika Goyal [Tue, 1 Mar 2016 19:43:22 +0000 (01:13 +0530)]
Staging: gdm724x: Replace random_ether_addr with eth_random_addr

The macro random_ether_addr is calling the function eth_random_addr.
Therefore, the call to random_ether_addr can be replaced with
eth_random_addr.
Done using coccinelle:

@@
expression addr;
@@
- random_ether_addr(addr);
+ eth_random_addr(addr);

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: gdm724x: Use min instead of ternary operator
Bhumika Goyal [Fri, 26 Feb 2016 10:04:32 +0000 (15:34 +0530)]
Staging: gdm724x: Use min instead of ternary operator

This patch replaces ternary operator with macro min as it shorter and
thus increases code readability. Macro min return the minimum of the
two compared values.
Made a semantic patch for changes:

@@
type T;
T x;
T y;
@@
(
- x < y ? x : y
+ min(x,y)
|
- x > y ? x : y
+ max(x,y)
)

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: gdm724x: gdm_usb: Remove create_workqueue()
Amitoj Kaur Chawla [Sun, 28 Feb 2016 14:24:41 +0000 (19:54 +0530)]
staging: gdm724x: gdm_usb: Remove create_workqueue()

With concurrency managed workqueues, use of dedicated workqueues
can be replaced by using system_wq. Drop usb_tx_wq and usb_rx_wq
by using system_wq.

Since there are multiple work items per udev but different udevs
do not need to be ordered, increase of concurrency level by
switching to system_wq should not break anything.

cancel_work_sync() is used to ensure that work is not pending or
executing on any CPU.

Lastly, since all devices are suspended, which shutdowns the work
items before the driver can be unregistered, it is guaranteed
that no work item is pending or executing by the time exit path
runs.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: gdm72xx: remove duplicate condition
Dan Carpenter [Mon, 22 Feb 2016 19:33:33 +0000 (22:33 +0300)]
Staging: gdm72xx: remove duplicate condition

We know "len" is not zero because we tested for that at the beginning of
the function so this test can be removed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: gdm72xx: underflow bug in gdm_wimax_ioctl_get_data()
Dan Carpenter [Mon, 22 Feb 2016 19:33:09 +0000 (22:33 +0300)]
Staging: gdm72xx: underflow bug in gdm_wimax_ioctl_get_data()

"size" here should be unsigned, otherwise we might end up trying to copy
negative bytes in gdm_wimax_ioctl_get_data() resulting in an information
leak.

Reported-by: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: gdm72xx: zero out padding
Dan Carpenter [Mon, 22 Feb 2016 19:32:38 +0000 (22:32 +0300)]
staging: gdm72xx: zero out padding

We pad the start of this buffer with 256 bytes of padding.   It's not
clear to me exactly what's going on or how it's used but let's zero it
out.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: gdm72xx: make "len" unsigned
Dan Carpenter [Mon, 22 Feb 2016 19:32:21 +0000 (22:32 +0300)]
Staging: gdm72xx: make "len" unsigned

We had an underflow bug here and I think I fixed it but we may as
well be proactive and make "len" unsigned to be double sure.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: gdm72xx: silence underflow warning in netlink_send()
Dan Carpenter [Mon, 22 Feb 2016 19:31:31 +0000 (22:31 +0300)]
Staging: gdm72xx: silence underflow warning in netlink_send()

The value of "group" comes from "idx" in __gdm_wimax_event_send():

if (sscanf(e->dev->name, "wm%d", &idx) == 1)

Smatch marks sscanf values as user controlled.  It's supposed to be a
number in 0-30 range.  We cap the upper bound but allow negatives.  Fix
this by making it type u16 instead.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: gdm72xx: underflow in netlink_rcv_cb()
Dan Carpenter [Mon, 22 Feb 2016 19:30:46 +0000 (22:30 +0300)]
staging: gdm72xx: underflow in netlink_rcv_cb()

If nlh->nlmsg_len is less than ND_IFINDEX_LEN we end up trying to memcpy
a negative size.  I also re-ordered slighty the condition to make it
more uniform.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agodrivers: staging: rtl8712: rtl871x_xmit.c: Fix Comparisons should place the constant...
Tapan Prakash T [Tue, 23 Feb 2016 17:15:48 +0000 (22:45 +0530)]
drivers: staging: rtl8712: rtl871x_xmit.c: Fix Comparisons should place the constant on the right side of the test warning

Fixed checkpatch.pl warning 'Comparisons should place the constant on the
right side of the test'

Signed-off-by: Tapan Prakash T <tapanprakasht@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agortl871x: avoid running off end of buffer
Alan [Mon, 15 Feb 2016 18:58:10 +0000 (18:58 +0000)]
rtl871x: avoid running off end of buffer

If 32 bytes of non zero are passed in pdata->pointer then the mac_pton
function will run off the end of the buffer. Make sure we always have a
terminated string kernel side.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: speakup: Remove unnecessary test in if condition
Amitoj Kaur Chawla [Wed, 24 Feb 2016 15:24:28 +0000 (20:54 +0530)]
staging: speakup: Remove unnecessary test in if condition

Remove unnecessary test on synth->alive since it has already been
tested previously.

This fixes the following smatch warning:
drivers/staging/speakup/synth.c:182 spk_synth_is_alive_restart() warn:
we tested 'synth->alive' before and it was 'false'

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>