Commit graph

47571 commits

Author SHA1 Message Date
Linus Torvalds 1be627dfa7 Staging/IIO fixes for 4.12-rc6
Here are some small Staging and IIO driver fixes for 4.12-rc6.
 
 Nothing huge, just a few small driver fixes for reported issues.  All
 have been in linux-next with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCWUUGfg8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+yk/DwCeJUyPGQ4tFdiUvxG08bJyRT87B/IAn1jZKka3
 n2+JfDEiNBlq+w2eneXG
 =wXYh
 -----END PGP SIGNATURE-----

Merge tag 'staging-4.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging and IIO fixes from Greg KH:
 "Here are some small staging and IIO driver fixes for 4.12-rc6.

  Nothing huge, just a few small driver fixes for reported issues. All
  have been in linux-next with no reported issues"

* tag 'staging-4.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  Staging: rtl8723bs: fix an error code in isFileReadable()
  iio: buffer-dmaengine: Add missing header buffer_impl.h
  iio: buffer-dma: Add missing header buffer_impl.h
  iio: adc: meson-saradc: fix potential crash in meson_sar_adc_clear_fifo
  iio: adc: mxs-lradc: Fix return value check in mxs_lradc_adc_probe()
  iio: imu: inv_mpu6050: add accel lpf setting for chip >= MPU6500
  staging: iio: ad7152: Fix deadlock in ad7152_write_raw_samp_freq()
2017-06-18 08:36:30 +09:00
Johannes Berg d58ff35122 networking: make skb_push & __skb_push return void pointers
It seems like a historic accident that these return unsigned char *,
and in many places that means casts are required, more often than not.

Make these functions return void * and remove all the casts across
the tree, adding a (u8 *) cast only where the unsigned char pointer
was used directly, all done with the following spatch:

    @@
    expression SKB, LEN;
    typedef u8;
    identifier fn = { skb_push, __skb_push, skb_push_rcsum };
    @@
    - *(fn(SKB, LEN))
    + *(u8 *)fn(SKB, LEN)

    @@
    expression E, SKB, LEN;
    identifier fn = { skb_push, __skb_push, skb_push_rcsum };
    type T;
    @@
    - E = ((T *)(fn(SKB, LEN)))
    + E = fn(SKB, LEN)

    @@
    expression SKB, LEN;
    identifier fn = { skb_push, __skb_push, skb_push_rcsum };
    @@
    - fn(SKB, LEN)[0]
    + *(u8 *)fn(SKB, LEN)

Note that the last part there converts from push(...)[0] to the
more idiomatic *(u8 *)push(...).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-16 11:48:40 -04:00
Johannes Berg 4df864c1d9 networking: make skb_put & friends return void pointers
It seems like a historic accident that these return unsigned char *,
and in many places that means casts are required, more often than not.

Make these functions (skb_put, __skb_put and pskb_put) return void *
and remove all the casts across the tree, adding a (u8 *) cast only
where the unsigned char pointer was used directly, all done with the
following spatch:

    @@
    expression SKB, LEN;
    typedef u8;
    identifier fn = { skb_put, __skb_put };
    @@
    - *(fn(SKB, LEN))
    + *(u8 *)fn(SKB, LEN)

    @@
    expression E, SKB, LEN;
    identifier fn = { skb_put, __skb_put };
    type T;
    @@
    - E = ((T *)(fn(SKB, LEN)))
    + E = fn(SKB, LEN)

which actually doesn't cover pskb_put since there are only three
users overall.

A handful of stragglers were converted manually, notably a macro in
drivers/isdn/i4l/isdn_bsdcomp.c and, oddly enough, one of the many
instances in net/bluetooth/hci_sock.c. In the former file, I also
had to fix one whitespace problem spatch introduced.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-16 11:48:39 -04:00
Johannes Berg 59ae1d127a networking: introduce and use skb_put_data()
A common pattern with skb_put() is to just want to memcpy()
some data into the new space, introduce skb_put_data() for
this.

An spatch similar to the one for skb_put_zero() converts many
of the places using it:

    @@
    identifier p, p2;
    expression len, skb, data;
    type t, t2;
    @@
    (
    -p = skb_put(skb, len);
    +p = skb_put_data(skb, data, len);
    |
    -p = (t)skb_put(skb, len);
    +p = skb_put_data(skb, data, len);
    )
    (
    p2 = (t2)p;
    -memcpy(p2, data, len);
    |
    -memcpy(p, data, len);
    )

    @@
    type t, t2;
    identifier p, p2;
    expression skb, data;
    @@
    t *p;
    ...
    (
    -p = skb_put(skb, sizeof(t));
    +p = skb_put_data(skb, data, sizeof(t));
    |
    -p = (t *)skb_put(skb, sizeof(t));
    +p = skb_put_data(skb, data, sizeof(t));
    )
    (
    p2 = (t2)p;
    -memcpy(p2, data, sizeof(*p));
    |
    -memcpy(p, data, sizeof(*p));
    )

    @@
    expression skb, len, data;
    @@
    -memcpy(skb_put(skb, len), data, len);
    +skb_put_data(skb, data, len);

(again, manually post-processed to retain some comments)

Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-16 11:48:37 -04:00
David S. Miller 0ddead90b2 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
The conflicts were two cases of overlapping changes in
batman-adv and the qed driver.

Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-15 11:59:32 -04:00
Linus Torvalds a090bd4ff8 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller:

 1) The netlink attribute passed in to dev_set_alias() is not
    necessarily NULL terminated, don't use strlcpy() on it. From
    Alexander Potapenko.

 2) Fix implementation of atomics in arm64 bpf JIT, from Daniel
    Borkmann.

 3) Correct the release of netdevs and driver private data in certain
    circumstances.

 4) Sanitize netlink message length properly in decnet, from Mateusz
    Jurczyk.

 5) Don't leak kernel data in rtnl_fill_vfinfo() netlink blobs. From
    Yuval Mintz.

 6) Hash secret is never initialized in ipv6 ILA translation code, from
    Arnd Bergmann. I guess those clang warnings about unused inline
    functions are useful for something!

 7) Fix endian selection in bpf_endian.h, from Daniel Borkmann.

 8) Sanitize sockaddr length before dereferncing any fields in AF_UNIX
    and CAIF. From Mateusz Jurczyk.

 9) Fix timestamping for GMAC3 chips in stmmac driver, from Mario
    Molitor.

10) Do not leak netdev on dev_alloc_name() errors in mac80211, from
    Johannes Berg.

11) Fix locking in sctp_for_each_endpoint(), from Xin Long.

12) Fix wrong memset size on 32-bit in snmp6, from Christian Perle.

13) Fix use after free in ip_mc_clear_src(), from WANG Cong.

14) Fix regressions caused by ICMP rate limiting changes in 4.11, from
    Jesper Dangaard Brouer.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (91 commits)
  i40e: Fix a sleep-in-atomic bug
  net: don't global ICMP rate limit packets originating from loopback
  net/act_pedit: fix an error code
  net: update undefined ->ndo_change_mtu() comment
  net_sched: move tcf_lock down after gen_replace_estimator()
  caif: Add sockaddr length check before accessing sa_family in connect handler
  qed: fix dump of context data
  qmi_wwan: new Telewell and Sierra device IDs
  net: phy: Fix MDIO_THUNDER dependencies
  netconsole: Remove duplicate "netconsole: " logging prefix
  igmp: acquire pmc lock for ip_mc_clear_src()
  r8152: give the device version
  net: rps: fix uninitialized symbol warning
  mac80211: don't send SMPS action frame in AP mode when not needed
  mac80211/wpa: use constant time memory comparison for MACs
  mac80211: set bss_info data before configuring the channel
  mac80211: remove 5/10 MHz rate code from station MLME
  mac80211: Fix incorrect condition when checking rx timestamp
  mac80211: don't look at the PM bit of BAR frames
  i40e: fix handling of HW ATR eviction
  ...
2017-06-15 18:09:47 +09:00
Dan Carpenter ed6456afef Staging: rtl8723bs: fix an error code in isFileReadable()
The caller only cares about zero vs non-zero so this code actually works
fine but we should be returning a negative error code instead of a valid
pointer casted to int.

Fixes: 554c0a3abf ("staging: Add rtl8723bs sdio wifi driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-14 12:43:54 +02:00
Aliaksei Karaliou d567b0fe2d staging: android: ion: Improve memory alloc style
Use variable name instead of structure name to get size
of memory to allocate as proposed by checkpatch.pl

Signed-off-by: Aliaksei Karaliou <akaraliou.dev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-14 12:37:22 +02:00
Roman Storozhenko 1dbc269e95 staging: lustre: llite: Replace the symbolic file permission mode with the numeric one
Replaces S_IRWXUGO with 0777. The reason is that symbolic permissions
considered harmful:
https://lwn.net/Articles/696229/

Signed-off-by: Roman Storozhenko <romeusmeister@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-14 12:37:22 +02:00
Gabriel L. Somlo 1802d96eb6 staging: fsl-mc: fix typo in comment
Resolving checkpatch issue:
CHECK: 'successfuly' may be misspelled - perhaps 'successfully'?

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-14 12:26:42 +02:00
Fabian Wolff 845086076a staging: rtl8723bs: wifi_regd.c: insert blank line after declarations
This patch inserts a missing blank line after variable declarations.

Signed-off-by: Fabian Wolff <fabian.wolff@fau.de>
Signed-off-by: Mate Horvath <horvatmate@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-14 12:26:42 +02:00
Fabian Wolff 2b385530ce staging: rtl8723bs: wifi_regd.c: adjust alignment to match open parenthesis
This patch adjusts the alignment of several lines to match their
respective opening parenthesis.

Signed-off-by: Fabian Wolff <fabian.wolff@fau.de>
Signed-off-by: Mate Horvath <horvatmate@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-14 12:26:42 +02:00
Fabian Wolff 4276cfd3e2 staging: rtl8723bs: wifi_regd.c: remove superfluous spaces from pointer arguments
This patch implements the suggestions of checkpatch.pl to remove
unnecessary spaces before function pointer arguments as well as in
statements of the form "foo * bar" (which should be "foo *bar").

Signed-off-by: Fabian Wolff <fabian.wolff@fau.de>
Signed-off-by: Mate Horvath <horvatmate@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-14 12:26:42 +02:00
Fabian Wolff 7bb619813a staging: rtl8723bs: wifi_regd.c: fix comment formatting
This patch improves the formatting of block comments and removes one
commented-out line of code entirely (keeping it would be redundant
thanks to version control).

Signed-off-by: Fabian Wolff <fabian.wolff@fau.de>
Signed-off-by: Mate Horvath <horvatmate@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-14 12:26:42 +02:00
Fabian Wolff a7941a0851 staging: rtl8723bs: wifi_regd.c: put spaces around binary operators
This patch adds spaces around the binary operators '-' and '+'.

Signed-off-by: Fabian Wolff <fabian.wolff@fau.de>
Signed-off-by: Mate Horvath <horvatmate@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-14 12:26:42 +02:00
Olav Haugan 0a3bbcbdf2 staging: wlan-ng: prism2mib.c: Fix type cast issues
Fix the following sparse warnings:

prism2mib.c:717:45: warning: cast to restricted __le16
prism2mib.c:720:45: warning: incorrect type in assignment (different base types)
prism2mib.c:720:45:    expected unsigned short [unsigned] [addressable] [usertype] datalen
prism2mib.c:720:45:    got restricted __le16 [usertype] <noident>
prism2mib.c:755:22: warning: incorrect type in assignment (different base types)
prism2mib.c:755:22:    expected unsigned short [unsigned] [usertype] len
prism2mib.c:755:22:    got restricted __le16 [usertype] <noident>

Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-14 12:26:41 +02:00
Greg Kroah-Hartman 64c667fe29 Second set of IIO fixes for the 4.12 cycle.
* buffer-dma / buffer-dmaengine
   - Fix missing include of buffer_impl.h after the split of buffer.h.
   No driver in mainline is currently using these buffers so it wasn't
   picked up by automated build tests.
 
 * ad7152
   - Fix a deadlock in ad7152_write_raw_samp_freq as the chip_state lock
     was already held.
 * inv_mpu6050
   - Add low pass filter setting for chips newer than the MPU6500.  None of
     use previously picked up no the fact it was different on these newer
     chips.  It is separately set for the acceleration on these parts.  There
     is no normal reason to set it differently so the userspace interface
     remains the same as for early parts.
 * meson-saradc:
   - Fix a potential crash by NULL pointer dereference in
     meson_sar_adc_clear_fifo.
 * mxs-lradc
   - Fix a return value check where IS_ERR is used on a function that returns
     NULL on error
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAllARKwRHGppYzIzQGtl
 cm5lbC5vcmcACgkQVIU0mcT0FogGDQ/+Px3R3gtIha1velSGg8MU+pjYZpblhEtM
 GVfY+1uN0uEL9KHJqnnAPJHxlpkKr1BUg6fR7/EwJkRULg8YkWbSb2ZKcdZqiE+U
 LyEfLpZrNdw3P5q+u44LkX+HBvhr5QUqlnHj7fG8T7oG2W/mryVZPDTfv/gBXJo3
 SiiCv1HKWvdU99lrcALG1T/CZRx8PDrBKcxHhaTYWGFUmyIS67AGIRV3+khs7m9e
 pWgSd1iV2AUEhWaRQ/KSpbv9c7pvymjEq8AHCqTvXjc0kcwETUkxuiGXh8zI53Nr
 +rOzuB18RO+9o87uWSDBzfqntinMeIQYmgr471UsgpjaB0CDP/V8cGwnmzlf1/39
 gWm2PF5AReagkPaf8cMBUdTJJsUYNcGI9B8w9MNt5DRIxGWPsl/RhP4hd+h9Ncfx
 gHByZYVV3KEt0GCw6JweEmi4P+GgRpoFRAYBwhrlr6a6zau27q9LqjEenj1wNoA1
 VlTluEULB8HPDuDeI9wSFvzX2mOua4Ogo7QvKwDa+6QYukMbuOwaZ+/D7HxrFLzE
 XT7kcbuSXvVSQny+OHTRbYjq7VFMvYBURNkjQiSRL76ADO0VPt3sEafAsoiVVlIm
 C7NG/U8on051scb1VzmnEHeC0S5UkftCiBKrsIrWHU+6CiGpro7Avi9a+iar2hYj
 feFKQwMn978=
 =BU6h
 -----END PGP SIGNATURE-----

Merge tag 'iio-fixes-for-4.12b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus

Jonathan writes:

Second set of IIO fixes for the 4.12 cycle.

* buffer-dma / buffer-dmaengine
  - Fix missing include of buffer_impl.h after the split of buffer.h.
  No driver in mainline is currently using these buffers so it wasn't
  picked up by automated build tests.

* ad7152
  - Fix a deadlock in ad7152_write_raw_samp_freq as the chip_state lock
    was already held.
* inv_mpu6050
  - Add low pass filter setting for chips newer than the MPU6500.  None of
    use previously picked up no the fact it was different on these newer
    chips.  It is separately set for the acceleration on these parts.  There
    is no normal reason to set it differently so the userspace interface
    remains the same as for early parts.
* meson-saradc:
  - Fix a potential crash by NULL pointer dereference in
    meson_sar_adc_clear_fifo.
* mxs-lradc
  - Fix a return value check where IS_ERR is used on a function that returns
    NULL on error
2017-06-14 12:00:41 +02:00
yuval.shaia@oracle.com 5514174fe9 net: phy: Make phy_ethtool_ksettings_get return void
Make return value void since function never return meaningfull value

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-13 12:59:06 -04:00
Fabian Wolff a8e1afccdc staging: rtl8723bs: wifi_regd.c: remove superfluous braces
This patch removes unnecessary braces in an if/else-construct, thereby
fixing both a checkpatch.pl warning about superfluous braces and an
error about an ill-placed closing brace preceding the "else" keyword.

Signed-off-by: Fabian Wolff <fabian.wolff@fau.de>
Signed-off-by: Mate Horvath <horvatmate@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 14:59:38 +02:00
Fabian Wolff dae24da62d staging: rtl8723bs: wifi_regd.c: fix checkpatch.pl warning 'Statements should start on a tabstop'
This patch fixes the checkpatch.pl warning 'Statements should start on
a tabstop' by reformatting the affected lines.

Signed-off-by: Fabian Wolff <fabian.wolff@fau.de>
Signed-off-by: Mate Horvath <horvatmate@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 14:59:30 +02:00
Roman Storozhenko 73905f2a70 staging: lustre: fid: Fixes debug output style problem
Fixes a style problems. Replaces non-standard 'Lx' specifier with a
standard 'llx'.

Signed-off-by: Roman Storozhenko <romeusmeister@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 14:59:30 +02:00
Aviya Erenfeld f8fa77a8bc staging: rtl8188eu: Remove unneeded blank lines
Remove unneeded blank lines

Signed-off-by: Aviya Erenfeld <aviyae42@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 14:59:29 +02:00
Joe Perches 12cc28baef staging: rtl8723bs: Use vsnprintf extensions %pM and %pI4
Convert the uses of MAC_FMT, MAC_ARG and IP_FMT, IP_ARG to the
kernel extensions.

This could eventually be improved with an in-place substitution.

This reduces object code size a bit too.

$ size drivers/staging/rtl8723bs/r8723bs.o*
   text	   data	    bss	    dec	    hex	filename
 672812	  27040	  24232	 724084	  b0c74	drivers/staging/rtl8723bs/r8723bs.o.allyesconfig.new
 676299	  27040	  24232	 727571	  b1a13	drivers/staging/rtl8723bs/r8723bs.o.allyesconfig.old
 430398	  27040	  21528	 478966	  74ef6	drivers/staging/rtl8723bs/r8723bs.o.defconfig.new
 431581	  27040	  21528	 480149	  75395	drivers/staging/rtl8723bs/r8723bs.o.defconfig.old

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 14:59:29 +02:00
Alexandre Ghiti 650b175d63 staging: speakup: Add missing blank line after declaration
This patch fixes checkpatch warnings about adding a blank line after
variable declaration.

Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 14:59:21 +02:00
Laurentiu Tudor 5ebf8d2d87 staging: fsl-mc: add reference to mc-bus DT binding
Update README to reference the mc-bus device tree node binding.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:14:12 +02:00
Laurentiu Tudor 49df58e927 staging: fsl-mc: drop reference to restool
Drop reference to user space restool utility from the README.
It will be added back together with the actual support in the
bus driver.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:14:12 +02:00
Laurentiu Tudor b5d5740a00 staging: fsl-mc: drop unused forward declaration
This forward declaration of "struct fsl_mc_resource" is of no use so
drop it.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:14:12 +02:00
Laurentiu Tudor 6e0556cc93 staging: fsl-mc: remove extra blank line
Remove extra blank line reported by checkpatch.pl.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:14:12 +02:00
Laurentiu Tudor 4506386173 staging: fsl-mc: drop a few useless #includes
Some #includes were needlessly done from header files. Drop them from
there and update the only .c file that implicitly needed one of those
#includes.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:14:12 +02:00
Laurentiu Tudor a042fbed02 staging: fsl-mc: simplify couple of deallocations
Simplify a couple of deallocations code paths. This also fixes these
checkpatch.pl false positives:
 "WARNING: kfree(NULL) is safe and this check is probably not required"

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:14:12 +02:00
Laurentiu Tudor 72f3415f81 staging: fsl-mc: enclose macro params in parens
Several macros didn't had macro params enclosed in parens. Fix them to
avoid precedence issues. Found with checkpatch.pl who was issuing this
message:
    "Macro argument 'id' may be better as '(id)' to avoid precedence
     issues"

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:14:12 +02:00
Aditya Shankar 46949b4856 staging: wilc1000: New cfg packet format in handle_set_wfi_drv_handler
Change the config packet format used in handle_set_wfi_drv_handler()
to align the host driver with the new format used in the wilc firmware.

The change updates the format in which the host driver provides the
firmware with the drv_handler index and also uses two new
fields viz. "mode" and 'name" in the config packet along with this index
to directly provide details about the interface and its mode to the
firmware instead of having multiple if-else statements in the host driver
to decide which interface to configure.

This change requires users to move to the newer version of the wilc
firmware(14.02 or higher) available on the vendor tree on github or on the
linux-firmware project. The existing firmware files on the linux-firmware
project are very old and best not used.

Signed-off-by: Aditya Shankar <aditya.shankar@microchip.com>
Reviewed-by: Arend Van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:06:57 +02:00
Amisha Singh 38d0353c6e Staging: comedi: ni_labpc_regs: fixed a block comment alignment issue
Fixed a coding style issue.

Signed-off-by: Amisha Singh <amisha.sh22@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:06:56 +02:00
Okash Khawaja bbe6fb5b96 staging: speakup: migrate bns to tty
Migration of bns was missed out in the patch
https://patchwork.kernel.org/patch/9727725/. This patch does it by
updating relevant function pointers, just like in the patch linked
above.

Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:06:43 +02:00
Perry Hooker f6e8716a3a staging: ks7010: use little-endian types
This patch fixes a number of sparse warnings of the form:
drivers/staging/ks7010/ks_hostif.c:2187:29:
	warning: incorrect type in assignment (different base types)
generated when storing little-endian data in variables
that do not have a specified endianness.

Signed-off-by: Perry Hooker <perry.hooker@gmail.com>
Reviewed-By: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:06:43 +02:00
Ioana Radulescu bb5b42c0d8 staging: fsl-dpaa2/eth: Update number of netdev queues
Currently, the netdevice is allocated with a default number of Rx/Tx
queues equal to CONFIG_NR_CPUS, meaning the maximum number of cores
supported by the current kernel. The actual number of queues is
reflected by the DPNI object attribute, so update the netdevice
configuration based on that.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:04:38 +02:00
Ioana Radulescu 6ab0086846 staging: fsl-dpaa2/eth: Refactor MAC address setup
The driver logic for allocating a MAC address to a net device
is complicated enough to deserve a function of its own. While
here, cleanup a bit the code comments.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:04:38 +02:00
Ioana Radulescu 39163c0ce0 staging: fsl-dpaa2/eth: Errors checking update
On the egress path, frame errors are reported using both a FD control
field and the frame annotation status. The current code only handles
FAS errors. Update to look at both fields when accounting Tx errors.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:04:38 +02:00
Ioana Radulescu 05fa39c6b9 staging: fsl-dpaa2/eth: Only store bpid in priv struct
We only need to know the buffer pool id, so save exactly
that in the device's private structure, instead of the
entire DPBP attributes struct.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:02:55 +02:00
Ioana Radulescu 50eacbc887 staging: fsl-dpaa2/eth: Remove unused fields from priv struct
Remove the dpni_id and buffer_layout fields from device's
private structure. They're only used at probe so we don't
need to store them for further use.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:02:55 +02:00
Ioana Radulescu d695e764f2 staging: fsl-dpaa2/eth: Add accessor for FAS field
Introduce a helper macro for accessing the frame annotation
status field in a frame buffer.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:02:55 +02:00
Ioana Radulescu 12afee803c staging: fsl-dpaa2/eth: Update ethtool stats names
Add a label to the ethtool statistics counters, to differentiate
between hardware counters and driver specific ones.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:02:55 +02:00
Ioana Radulescu 5206d8d1d3 staging: fsl-dpaa2/eth: Defer probing if no DPIOs found
If the Ethernet driver doesn't find any DPIO devices during probe,
it may be either because there's none available or because they
haven't been probed yet. Request deferred probing in case it's
the latter.

Signed-off-by: Bharat Bhushan <Bharat.Bhushan@nxp.com>
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:02:55 +02:00
Ioana Radulescu d00defe30a staging: fsl-dpaa2/eth: Reset dpbp
Reset the buffer pool object before using it, like we do
for the other DPAA2 objects.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:02:55 +02:00
Ioana Radulescu d4b3763d38 staging: fsl-dpaa2/eth: Always call napi_gro_receive()
The function itself checks whether GRO support is enabled
and acts accordingly, so we don't need to verify it in the
driver as well.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:02:54 +02:00
Ioana Radulescu e40ef9e48f staging: fsl-dpaa2/eth: Don't use GFP_DMA
Don't use GFP_DMA when allocating memory for the hash key,
as we don't actually need to allocate from the lowest zone.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:02:54 +02:00
Ioana Radulescu d87d5baf64 staging: fsl-dpaa2/eth: Minor cleanup in dpaa2_eth_set_hash
We already have a variable for the DMA mapping device,
so use that directly.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:02:54 +02:00
Ioana Radulescu 77160af37c staging: fsl-dpaa2/eth: Add error message newlines
A few error/warning messages lacked a newline at the end
of the text. Add it for improved consistency and cosmetics.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:02:54 +02:00
Ioana Radulescu e202c82c90 staging: fsl-dpaa2/eth: Remove incorrect error path
Not having Rx hashing distribution enabled for an
interface is a valid configuration and shouldn't be
treated as an error.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:02:54 +02:00
Ioana Radulescu c433db403b staging: fsl-dpaa2/eth: Fix return type of ndo_start_xmit
ndo_start_xmit() returns a value of type netdev_tx_t. Update
our ndo function to use the correct type.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:02:54 +02:00
Ioana Radulescu 8dffaf8a17 staging: fsl-dpaa2/eth: Initialize variable before use
In dpni_get_irq_status(), status is both in and out parameter,
so initialize before use.
Issue found through static analysis tool.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:02:53 +02:00
Ioana Radulescu acbff8e31e staging: fsl-dpaa2/eth: Add "static" keyword where needed
Make a couple of locally used functions and structures static.
Issue found through static analysis tool.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-13 12:02:53 +02:00
Greg Kroah-Hartman 7bf1e44f86 Merge 4.12-rc5 into staging-next
We want the IIO fixes and other staging driver fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-12 08:20:47 +02:00
Linus Torvalds 21c9eb7ca3 Staging/IIO fixes for 4.12-rc5
These are mostly all IIO driver fixes, resolving a number of tiny
 issues.  There's also a ccree and lustre fix in here as well, both
 fix problems found in those codebases.
 
 All have been in linux-next with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCWTz0Fg8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+yneTgCgvf05mecm4Hw98dGUXyaRUe0K578An1Ten4bh
 sKVoFoxRlzQVF0KHUkQy
 =pJOF
 -----END PGP SIGNATURE-----

Merge tag 'staging-4.12-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging/IIO fixes from Greg KH:
 "These are mostly all IIO driver fixes, resolving a number of tiny
  issues. There's also a ccree and lustre fix in here as well, both fix
  problems found in those codebases.

  All have been in linux-next with no reported issues"

* tag 'staging-4.12-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  staging: ccree: fix buffer copy
  staging/lustre/lov: remove set_fs() call from lov_getstripe()
  staging: ccree: add CRYPTO dependency
  iio: adc: sun4i-gpadc-iio: fix parent device being used in devm function
  iio: light: ltr501 Fix interchanged als/ps register field
  iio: adc: bcm_iproc_adc: swap primary and secondary isr handler's
  iio: trigger: fix NULL pointer dereference in iio_trigger_write_current()
  iio: adc: max9611: Fix attribute measure unit
  iio: adc: ti_am335x_adc: allocating too much in probe
  iio: adc: sun4i-gpadc-iio: Fix module autoload when OF devices are registered
  iio: adc: sun4i-gpadc-iio: Fix module autoload when PLATFORM devices are registered
  iio: proximity: as3935: fix iio_trigger_poll issue
  iio: proximity: as3935: fix AS3935_INT mask
  iio: adc: Max9611: checking for ERR_PTR instead of NULL in probe
  iio: proximity: as3935: recalibrate RCO after resume
2017-06-11 11:25:51 -07:00
Mauro Carvalho Chehab acc490bbb7 [media] atomisp: use correct dialect to disable warnings
There's a Macro that checks if gcc supports a warning before
disabling it. Use it, in order to avoid warnings when building
with older gcc versions.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-08 14:51:58 -03:00
David S. Miller 0bed865060 net: Fix build regression in rtl8723bs staging driver.
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c: In function ‘rtw_cfg80211_add_monitor_if’:
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:2670:10: error: ‘struct net_device’ has no member named ‘destructor’
  mon_ndev->destructor = rtw_ndev_destructor;
          ^

Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-08 11:51:59 -04:00
Mauro Carvalho Chehab 703ecba4db [media] staging: css2400/Makefile: don't include non-existing files
The atomisp css2400/Makefile includes a Makefile.common:

	include $(srctree)/$(src)/../Makefile.common

Well, this file doesn't exist at the Kernel tree :-)

So, don't include it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-08 12:39:03 -03:00
Dmitry Torokhov d9d2401f59 greybus: hid: remove custom locking from gb_hid_open/close
Now that HID core enforces serialization of transport driver open/close
calls we can remove custom locking from greybus hid driver.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-06-08 13:56:10 +02:00
David S. Miller cf124db566 net: Fix inconsistent teardown and release of private netdev state.
Network devices can allocate reasources and private memory using
netdev_ops->ndo_init().  However, the release of these resources
can occur in one of two different places.

Either netdev_ops->ndo_uninit() or netdev->destructor().

The decision of which operation frees the resources depends upon
whether it is necessary for all netdev refs to be released before it
is safe to perform the freeing.

netdev_ops->ndo_uninit() presumably can occur right after the
NETDEV_UNREGISTER notifier completes and the unicast and multicast
address lists are flushed.

netdev->destructor(), on the other hand, does not run until the
netdev references all go away.

Further complicating the situation is that netdev->destructor()
almost universally does also a free_netdev().

This creates a problem for the logic in register_netdevice().
Because all callers of register_netdevice() manage the freeing
of the netdev, and invoke free_netdev(dev) if register_netdevice()
fails.

If netdev_ops->ndo_init() succeeds, but something else fails inside
of register_netdevice(), it does call ndo_ops->ndo_uninit().  But
it is not able to invoke netdev->destructor().

This is because netdev->destructor() will do a free_netdev() and
then the caller of register_netdevice() will do the same.

However, this means that the resources that would normally be released
by netdev->destructor() will not be.

Over the years drivers have added local hacks to deal with this, by
invoking their destructor parts by hand when register_netdevice()
fails.

Many drivers do not try to deal with this, and instead we have leaks.

Let's close this hole by formalizing the distinction between what
private things need to be freed up by netdev->destructor() and whether
the driver needs unregister_netdevice() to perform the free_netdev().

netdev->priv_destructor() performs all actions to free up the private
resources that used to be freed by netdev->destructor(), except for
free_netdev().

netdev->needs_free_netdev is a boolean that indicates whether
free_netdev() should be done at the end of unregister_netdevice().

Now, register_netdevice() can sanely release all resources after
ndo_ops->ndo_init() succeeds, by invoking both ndo_ops->ndo_uninit()
and netdev->priv_destructor().

And at the end of unregister_netdevice(), we invoke
netdev->priv_destructor() and optionally call free_netdev().

Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-07 15:53:24 -04:00
Hans de Goede af822177d6 [media] staging: atomisp: Fix endless recursion in hmm_init
hmm_init calls hmm_alloc to set dummy_ptr, hmm_alloc calls
hmm_init when dummy_ptr is not yet set, which is the case in
the call from hmm_init, so it calls hmm_init again, this continues
until we have a stack overflow due to the recursion.

This commit fixes this by adding a separate flag for tracking if
hmm_init has been called. Not pretty, but it gets the job done,
eventually we should be able to remove the hmm_init call from
hmm_alloc.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:51:49 -03:00
Chen Guanqiao f1e627a41d [media] staging: atomisp: lm3554: fix sparse warnings(was not declared. Should it be static?)
Fix "symbol 'xxxxxxx' was not declared. Should it be static?" sparse warnings.

Signed-off-by: Chen Guanqiao <chen.chenchacha@foxmail.com>
Reviewed-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:50:22 -03:00
Hans de Goede ef14aa3bc1 [media] staging: atomisp: Make ov2680 driver less chatty
There is no reason for all this printk spamming and certainly
not at an error log level.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:49:56 -03:00
Hans de Goede da3e18059b [media] staging: atomisp: Ignore errors from second gpio in ov2680 driver
As the existing comment in the driver indicates the sensor has only 1 pin,
but some boards may have 2 gpios defined and we toggle both as we we don't
know which one is the right one. However if the ACPI resources table
defines only 1 gpio (as expected) the gpio1_ctrl call will always fail,
causing the probing of the driver to file.

This commit ignore the return value of the gpio1_ctrl call, fixing this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:49:23 -03:00
Hans de Goede 22b2807dae [media] staging: atomisp: Add OVTI2680 ACPI id to ov2680 driver
Add OVTI2680 ACPI id to ov2680 driver

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:48:36 -03:00
Hans de Goede 6706e9008d [media] staging: atomisp: Add INT0310 ACPI id to gc0310 driver
Add INT0310 ACPI id to gc0310 driver

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:48:13 -03:00
Hans de Goede 42c6d864ac [media] staging: atomisp: Set step to 0 for mt9m114 menu control
menu controls are not allowed to have a step size, set step to 0 to
fix an oops from the WARN_ON in v4l2_ctrl_new_custom() triggering
because of this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:47:47 -03:00
Hans de Goede 797f91e641 [media] staging: atomisp: Do not call dev_warn with a NULL device
Do not call dev_warn with a NULL device, this silence the following 2
warnings:

[   14.392194] (NULL device *): Failed to find gmin variable gmin_V2P8GPIO
[   14.392257] (NULL device *): Failed to find gmin variable gmin_V1P8GPIO

We could switch to using pr_warn for dev == NULL instead, but as comments
in the source indicate, the check for these 2 special gmin variables with
a NULL device is a workaround for 2 specific evaluation boards, so
completely silencing the missing warning for these actually is a good
thing.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:47:17 -03:00
Hans de Goede 008d8e1005 [media] staging: atomisp: Fix calling efivar_entry_get() with unaligned arguments
efivar_entry_get has certain alignment requirements and the atomisp
platform code was not honoring these, causing an oops by triggering the
WARN_ON in arch/x86/platform/efi/efi_64.c: virt_to_phys_or_null_size().

This commit fixes this by using the members of the efivar struct embedded
in the efivar_entry struct we kzalloc as arguments to efivar_entry_get(),
which is how all the other callers of efivar_entry_get() do this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:46:46 -03:00
Alan Cox fc99349413 [media] atomisp: de-duplicate sh_css_mmu_set_page_table_base_index
Between the ISP2400 and ISP2401 code base this function moved file. The merge
of the drivers left us with two version in ifdefs. Resolve this down to a
single copy.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:46:00 -03:00
Alan Cox 4950cfecd1 [media] atomisp: remove sh_css_irq - it contains nothing
We won't be adding abstractions or moving them here so kill it.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:45:13 -03:00
Alan Cox 29a323ea90 [media] atomisp: Unify lut free logic
ISP2401 introduced a helper for this which we can use just as well on the
ISP2400 and remove some more noise differences.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:44:39 -03:00
Alan Cox b1c056e05b [media] atomisp: Unify load_preview_binaries for the most part
ISP2401 introduced a rather sensible change to cut through the structure
spaghetti. Adopt that for the ISP2400 as well. It makes no difference to the
actual code other than readability.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:44:09 -03:00
Alan Cox 0ef9e6e555 [media] atomisp: unify sh_css_hmm_buffer_record_acquire
The ISP2401 version of this function returns a pointer to the buffer, whilst
the ISP2400 version returns a boolean if a slot is found. We can trivially
unify the code to use the ISP2401 version.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:43:24 -03:00
Alan Cox 4a2fcc0c91 [media] atomisp: eliminate dead code under HAS_RES_MGR
This define is never set and these code paths are never used so they can go
away.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:42:37 -03:00
Dan Carpenter 9dff81436d [media] atomisp2: off by one in atomisp_s_input()
The isp->inputs[] array has isp->input_cnt elements which have been
initialized so this > should be >=.

This bug is harmless.  The check against ATOM_ISP_MAX_INPUTS prevents us
from reading beyond the end of the array.  The uninitialized elements
are zeroed out so we will end up returning -EINVAL a few lines later
because the .camera pointer is NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:42:03 -03:00
Alan Cox 94e23b6148 [media] atomisp2: tidy up confused ifdefs
The two drivers were machine merged and in this case the machine output was to
say the least not optimal.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:41:40 -03:00
Alan Cox f16595ae20 [media] atomisp2: remove HRT_UNSCHED
HRT_UNSCHED is never defined or set in the driver, so this is dead code that
can be retired, simplifying the code a bit further.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:40:58 -03:00
Alan Cox 2310ae5c12 [media] atomisp: remove NUM_OF_BLS
With the removal of the HAS_BL bootloader code the value of NUM_OF_BLS is an
invariant zero. So let's get rid of it.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:40:10 -03:00
Alan Cox 5c9f9d602e [media] atompisp: HAS_BL is never defined so lose it
Kill off the HAS_BL define and the code and includes it brackets. We never
define HAS_BL or use that functionality.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:39:42 -03:00
Juan Antonio Pedreira Martos 4518c3fe7c [media] staging: media: atomisp: fix non static symbol warnings
Fix a couple of sparse warnings:
drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c:59:14: warning: symbol 'repool_pgnr' was not declared. Should it be static?
drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c:387:6: warning: symbol 'punit_ddr_dvfs_enable' was not declared. Should it be static?

Mark these symbols as static, so they are no longer incorrectly exported.

Signed-off-by: Juan Antonio Pedreira Martos <juanpm1@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:39:12 -03:00
Paolo Cretaro e1b28f1326 [media] atomisp: use NULL instead of 0 for pointers
Fix warning issued by sparse: Using plain integer as NULL pointer

Signed-off-by: Paolo Cretaro <melko@frugalware.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:38:44 -03:00
Christoph Fanelsa 74058c596b [media] staging: media: cxd2099: Fix checkpatch issues
Fix checkpatch warnings of prefered using '%s..", __func__' as function
name in a string

Signed-off-by: Christoph Fanelsa <eddi1983@gmx.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 12:33:41 -03:00
Mauro Carvalho Chehab 42654ebad0 media fixes for v4.12-rc4
-----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJZNnBiAAoJEAhfPr2O5OEV9bwP/1bus9tAw3AT+HxRSIaFFX8+
 DMDmJ6nZ4WQJ4fI04tKkUjpl+G2ImDGshdGgLht/YpaJRd6KgPqV+zWrAVX5/0e1
 mLyhjaALuk5M//JbkxEP95SWBOZ6SCIWlV/5oQRTNI86kO0gISxoCAsbumKlSSUC
 qTFmbmPp9siFpS43eZjVcgYIbwFx75qvLTc1+JRvxa2VhtMB5d4xYnXSpxlCvduj
 NN14KiphBgCOvyMQsi4q3H6ma8EL0sEtaukqPzXOnz6GGAIUUbDA23APM5H0LIIZ
 kYhO9ooez4dz1094ex1zSS/uQq2ogCTv7ShQseddNbHhOFG7Aq30AXLMEWeHaNp1
 fFb28CY3CBpNaYfjePbqIs8KKg3JxmJGmCGgW65p40UGUo1Itbpci5MqN8BjQAI8
 Ks1rf+V4iYQTr4QmQJQqCyJCljrsQbGMKZ9I67pmqfbqDunlH43Zr88DEWPv3rbW
 qac6U1vh108UHE/1KRZFjzvo31ToP+f+AwyVTXVeIi6vba2gvC8ASCJnZ/nGtO74
 Eb/GR0DtqvYGE6sXohbMywZ+8wRR6CdRVDC4YotQwaoghwnH10WPLg3JahECVMu7
 MbDtVvUHjbJ18cqwCW+J01gcuQxH/8Lx07T9T+pUFFanPBT7phPiQ/UAEPL1e3XO
 e4nFwX9h78wISBdy8Yx7
 =+jBV
 -----END PGP SIGNATURE-----

Merge tag 'media/v4.12-2' into patchwork

media fixes for v4.12-rc4

* tag 'media/v4.12-2': (598 commits)
  [media] rc-core: race condition during ir_raw_event_register()
  [media] cec: drop MEDIA_CEC_DEBUG
  [media] cec: rename MEDIA_CEC_NOTIFIER to CEC_NOTIFIER
  [media] cec: select CEC_CORE instead of depend on it
  [media] rainshadow-cec: ensure exit_loop is intialized
  [media] atomisp: don't treat warnings as errors
  Linux 4.12-rc3
  x86/ftrace: Make sure that ftrace trampolines are not RWX
  x86/mm/ftrace: Do not bug in early boot on irqs_disabled in cpu_flush_range()
  selftests/ftrace: Add a testcase for many kprobe events
  kprobes/x86: Fix to set RWX bits correctly before releasing trampoline
  ftrace: Fix memory leak in ftrace_graph_release()
  ipv4: add reference counting to metrics
  net: ethernet: ax88796: don't call free_irq without request_irq first
  ip6_tunnel, ip6_gre: fix setting of DSCP on encapsulated packets
  sctp: fix ICMP processing if skb is non-linear
  net: llc: add lock_sock in llc_ui_bind to avoid a race condition
  PCI/msi: fix the pci_alloc_irq_vectors_affinity stub
  blk-mq: Only register debugfs attributes for blk-mq queues
  x86/timers: Move simple_udelay_calibration past init_hypervisor_platform
  ...

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07 07:50:49 -03:00
Takashi Iwai 4c7aba46c9 Merge branch 'for-linus' into for-next
For applying more ALSA timer cleanups.
2017-06-07 10:25:30 +02:00
Gilad Ben-Yossef 26f4b1f7a8 staging: ccree: fix buffer copy
Fix a bug where the copying of scatterlist buffers incorrectly
ignored bytes to skip in a scatterlist and ended 1 byte short.

This fixes testmgr hmac and hash test failures currently obscured
by hash import/export not being supported.

Fixes: abefd6741d ("staging: ccree: introduce CryptoCell HW driver").

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-06 16:23:27 +02:00
Bo YU e5770b7bdb staging: speakup: alignment match open parens
I have aligned argument with parenthesis, so checkpatch no check also.

Signed-off-by: Bo YU <tsu.yubo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-06 16:17:31 +02:00
Bo YU 1f10145646 staging: speakup: in serialio.c no over 80 chars long
Fixed the checkpatch.pl warning:

WARNING: line over 80 characters

Signed-off-by: Bo YU <tsu.yubo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-06 16:17:30 +02:00
Bo YU 79de2d0e8d staging: speakup: add a space around '|'
Add a space around logical symbol '|' to wipe out checkpatch check

Signed-off-by: Bo YU <tsu.yubo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-06 16:17:30 +02:00
Bo YU f6089ae42f staging: speakup: add a missing blank line after declaration
Fixed checkpatch warning by adding a blank line after declare
expression

Signed-off-by: Bo YU <tsu.yubo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-06 16:17:30 +02:00
Daniel Micay 88a5b39b69 staging/rts5208: Fix read overflow in memcpy
Noticed by FORTIFY_SOURCE, this swaps memcpy() for strncpy() to zero-value
fill the end of the buffer instead of over-reading a string from .rodata.

Signed-off-by: Daniel Micay <danielmicay@gmail.com>
[kees: wrote commit log]
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Wayne Porter <wporter82@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-06 16:16:10 +02:00
Colin Ian King 372bd1eb84 staging: rtl8723bs: fix a couple of spelling mistakes
Replace cant with cannot, argumetns with arguments and
add line break to overly long DBG_871X statement.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-06 16:16:10 +02:00
Jia-Ju Bai 498c4b4e9c staging: rt5208: Fix a sleep-in-atomic bug in xd_copy_page
The driver may sleep under a spin lock, and the function call path is:
rtsx_exclusive_enter_ss (acquire the lock by spin_lock)
  rtsx_enter_ss
    rtsx_power_off_card
      xd_cleanup_work
        xd_delay_write
          xd_finish_write
            xd_copy_page
              wait_timeout
                schedule_timeout --> may sleep

To fix it, "wait_timeout" is replaced with mdelay in xd_copy_page.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-06 16:16:10 +02:00
Sudip Mukherjee ac66925108 staging: sm750fb: change default screen resolution
Update the default screen resolution and also use 24bpp for a better
screen performance.

Tested-by: Teddy Wang <teddy.wang@siliconmotion.com>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-06 16:16:10 +02:00
Adrian Stanciu 97b30bad76 staging: comedi: ni_labpc_isadma: fixed a comment coding style issue
Fixed a BLOCK_COMMENT_STYLE warning reported by checkpatch.pl script.

Signed-off-by: Adrian Stanciu <adrian.stanciu.pub@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-06 16:16:09 +02:00
Sean Young 614d651e1a [media] staging: remove todo and replace with lirc_zilog todo
The lirc_zilog driver is the last remaining lirc driver, so the existing
todo is no longer relevant.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-06 09:18:08 -03:00
Ricardo Silva da731edb5b [media] lirc_zilog: Fix unbalanced braces around if/else
Fix all checkpatch reported issues for:

 * CHECK: "braces {} should be used on all arms of this statement".
 * CHECK: "Unbalanced braces around else statement".

Make sure all if/else statements are balanced in terms of braces. Most
cases in code are, but a few were left unbalanced, so put them all
consistent with the recommended style.

Signed-off-by: Ricardo Silva <rjpdasilva@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-06 09:13:06 -03:00
Ricardo Silva d44e07c752 [media] lirc_zilog: Use sizeof(*p) instead of sizeof(struct P)
Fix all checkpatch reported issues for "CHECK: Prefer
kzalloc(sizeof(*<p>)...) over kzalloc(sizeof(struct <P>)...)".

Other similar case in the code already using recommended style, so make
it all consistent with the recommended practice.

Signed-off-by: Ricardo Silva <rjpdasilva@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-06 09:12:13 -03:00
Ricardo Silva 41a603f8d9 [media] lirc_zilog: Use __func__ for logging function name
Fix all checkpatch reported issues for "CHECK: Prefer using '"%s...",
__func__' to using '<func_name>', ..."

Use recommended style. Additionally, __func__ was already used in
similar cases throughout the code, so make it all consistent.

Signed-off-by: Ricardo Silva <rjpdasilva@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-06 09:11:48 -03:00
Ricardo Silva 28b671b4ba [media] lirc_zilog: Fix NULL comparisons style
Fix all checkpatch reported issues for "CHECK: Comparison to NULL could
be written...".

Do these comparisons using the recommended coding style and consistent
with other similar cases in the file, which already used the recommended
way.

Signed-off-by: Ricardo Silva <rjpdasilva@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-06 09:11:13 -03:00
Ricardo Silva 32ddcbb5b8 [media] lirc_zilog: Fix whitespace style checks
Fix style issues reported by checkpatch, affecting whitespace only:

 * CHECK: "Please don't use multiple blank lines".
   Two of these still triggering and left untouched because used for
   separating logical blocks (vars from functions, etc.).

 * CHECK: "spaces preferred around that '<operator>'".
   All fixed.

 * CHECK: "Alignment should match open parenthesis".
   All fixed except one on line 1161, left untouched for readability.

Move towards recommended coding style without compromising readability.

Signed-off-by: Ricardo Silva <rjpdasilva@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-06 09:10:46 -03:00
David Härdeman bd16168da8 [media] lirc_zilog: remove module parameter minor
Always let the kernel decide what minor the lirc chardev gets.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-06 09:03:39 -03:00
David Härdeman c3104e1b42 [media] lirc_dev: remove sampling kthread
There are no drivers which use this functionality.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-06 09:00:56 -03:00
David Härdeman 52e809f9fe [media] lirc_dev: remove pointless functions
drv->set_use_inc and drv->set_use_dec are already optional so we can
remove all dummy functions.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-06 08:59:28 -03:00
Mauro Carvalho Chehab f224c5768c [media] atomisp: don't treat warnings as errors
Several atomisp files use:
	 ccflags-y += -Werror

As, on media, our usual procedure is to use W=1, and atomisp
has *a lot* of warnings with such flag enabled,like:

./drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/system_local.h:62:26: warning: 'DDR_BASE' defined but not used [-Wunused-const-variable=]

At the end, it causes our build to fail, impacting our workflow.

So, remove this crap. If one wants to force -Werror, he
can still build with it enabled by passing a parameter to
make.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-04 15:23:32 -03:00
Richard Porter 9f98c6e67f staging: ks7010: use le16_to_cpu() to access __le16 field
Fixes sparse warning:
drivers/staging/ks7010/ks_hostif.c:959:24: warning: restricted __le16
degrades to integer

Signed-off-by: Richard Porter <dick@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 16:54:19 +02:00
Colin Ian King 1d80d1bd17 staging: ccree: fix spelling mistake: "chanined" -> "chained"
Trivial fix to spelling mistake in SSI_LOG_ERR message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 10:17:42 +02:00
Colin Ian King 54f6f4deed staging: rtl8723bs: fix another spelling mistake
I found one more spelling mistake in a DBG_8192C debug message,
replace "avaliable" with "available", add some spacing between
text and a number and split overly long line

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 10:17:42 +02:00
Konrad Malkowski 66cd04714b staging: rtl8192e: all lines in dot11d.h are less than 80 chars long
This patch fixes the checkpoint.pl warning:

WARNING: line over 80 characters

Signed-off-by: Konrad Malkowski <konrad.malkowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 10:17:42 +02:00
edcarter 3137139a65 Staging: comedi: s626.c: fixed trailing */ style issue
Fixed coding style issue where trailing */ in block comments
were not on separate lines.

Signed-off-by: Elias Carter <edcarter@ualberta.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 10:17:42 +02:00
Gilad Ben-Yossef b52fb14072 staging: ccree: remove descriptor context definitions
Remove definitions of descriptor context which are not used
in the driver.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 10:16:26 +02:00
Gilad Ben-Yossef da38a83ba7 staging: ccree: remove last remnants of sblkcipher
The cipher code had some left overs of an attempt to support
synch. cipher API with the HW. Remove the code handling this.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 10:16:26 +02:00
Gilad Ben-Yossef d3eff5722c staging: ccree: remove last remnants of sash algo
The hash code had some left overs from a misguided attempt
to support shash API with the HW. Remove the code handling
this.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 10:16:26 +02:00
Gilad Ben-Yossef 087fabd1cd staging: ccree: fix wrong whitespace usage
Some of the register definition files had none
kernel coding style usage of tabs vs. spaces in macro
definitions. This patch fixes them.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 10:16:26 +02:00
Gilad Ben-Yossef ee15d16946 staging: ccree: remove spurious blank line
Remove spurious blank line from cc_regs.h

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 10:16:26 +02:00
Gilad Ben-Yossef 1c0cccd9aa staging: ccree: remove dead code
Remove some unused macro definitions from hash definitions.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 10:16:25 +02:00
Gilad Ben-Yossef ef78342266 staging: ccree: drop no longer used macro
MSB64 macro is no longer used or needed. Drop it.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 10:16:25 +02:00
Gilad Ben-Yossef 84d69a7b03 staging: ccree: use snake_case for hash enums
Hash enum were named using CamelCase, move over to snake_case.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 10:16:25 +02:00
Gilad Ben-Yossef c928f1d7cb staging: ccree: remove unused struct
struct SepHashPrivateContext is not used anywhere in the code.
Remove it.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 10:16:25 +02:00
Gilad Ben-Yossef ed7443911e staging: ccree: remove custom bitfield macros
With all users removed or re-factored to use the standard
kernel bit fields ops we can now drop the custom
bit field macros.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 10:16:25 +02:00
Gilad Ben-Yossef 37a99c9831 staging: ccree: move request_mgr to generic bitfield ops
request_mgr was using custom bit field macros. move over to
standard kernel bitfield ops.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 10:16:25 +02:00
Gilad Ben-Yossef 7f821f0c6f staging: ccree: remove cycle count debug support
The ccree driver had support for rough performance debugging
via cycle counting which has bit rotted and can easily be
replcaed with perf. Remove it from the driver.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 10:16:25 +02:00
Gilad Ben-Yossef 841d1d806c staging: ccree: remove unused debug macros
The DUMP_SGL() and DUMP_MLLI_TABLE() debug macros were
defined but not used anywhere and the difference of their
definitions for debug vs. none debug indicated this has
not being used in a while.

Remove the dead code.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 10:16:25 +02:00
Gilad Ben-Yossef b953295421 staging: ccree: move M/LLI defines to header file
A bunch of macros used to define M/LLI descriptors where
being defined in the C file. Move them over to private
include file where other relevant definitions are stored.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 10:16:25 +02:00
Gilad Ben-Yossef c6f7f2f459 staging: ccree: refactor LLI access macros
The Linked List Item descriptors were being programmed via
a set of macros which suffer a few problems:
- Use of macros rather than inline leaves out parameter type
  checking and risks multiple macro parameter evaluation side
  effects.
- Implemented via hand rolled versions of bitfield operations.

This patch refactors LLI programming into a set of
of inline functions using generic kernel bitfield access
infrastructure, thus resolving the above issues and opening
the way later on to drop the hand rolled bitfield macros
once additional users are dropped in later patches in the
series.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 10:16:25 +02:00
Gilad Ben-Yossef 13ddf62156 staging: ccree: remove 48 bit dma addr sim
Remove no longer needed code used to simulate 48 bit dma addresses
on 32 bit platforms for development purposes.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 10:16:25 +02:00
Gilad Ben-Yossef 8b64e512de staging: ccree: refactor HW command FIFO access
The programming of the HW command FIFO in ccree was done via
a set of macros which suffer a few problems:
- Use of macros rather than inline leaves out parameter type
  checking and risks multiple macro parameter evaluation side
  effects.
- Implemented via hand rolled versions of bitfield operations.

This patch refactors the HW command queue access into a set
of inline functions using generic kernel bitfield access
infrastructure, thus resolving the above issues and opening
the way later on to drop the hand rolled bitfield macros
once additional users are dropped in later patches in the
series.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 10:16:25 +02:00
Gilad Ben-Yossef 6562e7db13 staging: ccree: replace bit shift with BIT macro
CC_CTX_SIZE was being defined using a hand rolled bit shift operation.
Replace with use of BIT macro.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04 10:16:25 +02:00
Derek Robson ed5210cb07 Drivers: ccree: cc_hw_queue_defs.h - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:53:19 +09:00
Derek Robson f6858e91ee Drivers: ccree: cc_regs.h - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:53:18 +09:00
Derek Robson ebe22ecce1 Drivers: ccree: hash_defs.h - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:53:18 +09:00
Derek Robson f4e929bbd8 Drivers: ccree: ssi_aead.c - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:53:18 +09:00
Derek Robson f5bd89b893 Drivers: ccree: ssi_aead.h - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:53:18 +09:00
Derek Robson 2686444e5f Drivers: ccree: ssi_buffer_mgr.c - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:53:18 +09:00
Derek Robson 84e8a6cf4c Drivers: ccree: ssi_buffer_mgr.h - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:53:18 +09:00
Derek Robson ef5d7bd9a9 Drivers: ccree: ssi_cipher.h - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:53:18 +09:00
Derek Robson f892b06826 Drivers: ccree: ssi_config.h - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:53:18 +09:00
Derek Robson 250a00a7fc Drivers: ccree: ssi_driver.h - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:53:18 +09:00
Derek Robson 3a82eb631f Drivers: ccree: ssi_fips.c - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:53:18 +09:00
Derek Robson cbff760259 Drivers: ccree: ssi_fips.h - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:53:18 +09:00
Derek Robson 7c3a293d43 Drivers: ccree: ssi_fips_data.h - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:53:18 +09:00
Derek Robson f77aa70be3 Drivers: ccree: ssi_fips_ext.c - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:53:18 +09:00
Derek Robson 161d6dd8c8 Drivers: ccree: ssi_fips_ll.c - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:53:18 +09:00
Jia-Ju Bai ed99f0141b rts5208: Fix a sleep-in-atomic bug in rtsx_exclusive_enter_ss
The driver may sleep under a spin lock, and the function call path is:
rtsx_exclusive_enter_ss (acquire the lock by spin_lock)
  rtsx_enter_ss
    rtsx_power_off_card
      sd_cleanup_work
        sd_stop_seq_mode
          sd_switch_clock
            sd_ddr_tuning
              sd_ddr_pre_tuning_tx
                sd_change_phase
                  wait_timeout
                    schedule_timeout --> may sleep

To fix it, "wait_timeout" is replaced with mdelay in sd_change_phase.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:52:00 +09:00
Jia-Ju Bai 385cab7c71 rts5208: Fix a sleep-in-atomic bug in sd_power_off_card3v3
The driver may sleep under a spin lock, and the function call path is:
rtsx_exclusive_enter_ss (acquire the lock by spin_lock)
  rtsx_enter_ss
    rtsx_power_off_card
      sd_power_off_card3v3
        wait_timeout
          schedule_timeout --> may sleep

To fix it, "wait_timeout" is replaced with mdelay in sd_power_off_card3v3.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:52:00 +09:00
Gilad Ben-Yossef a0eee1b6da staging: ccree: add parentheses to macro argument
Add parentheses around macro argument to guard against precedence
issues.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:45:06 +09:00
Gilad Ben-Yossef 33c73ae72e staging: ccree: fix comments formatting
A few of the comments in cc_crypto_ctx.h where not formatted
correctly. Format according to coding style guidelines.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:45:06 +09:00
Gilad Ben-Yossef 3e008c1744 staging: ccree: fix longer than 80 chars lines
Clip longer than 80 chars lines in header files worked
on in the patch set.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:45:04 +09:00
Gilad Ben-Yossef f9f28369a7 staging: ccree: remove spurious blank lines
Remove spurious blanks lines from cc_crypto_ctx.h file

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:45:00 +09:00
Mart Lubbers 9f5c6b7258 Staging: gdm724x: Change spaces to tabs
This patch fixes the following checkpatch.pl warning in gdm_usb.c:
WARNING: suspect code indent for conditional statements (8, 12)

Signed-off-by: Mart Lubbers <mart@martlubbers.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:38:26 +09:00
Gleb Fotengauer-Malinovskiy f7a320ffeb staging: android: uapi: drop definitions of removed ION_IOC_{FREE,SHARE} ioctls
This problem was found by strace ioctl list generator.

Fixes: 15c6098cfe ("staging: android: ion: Remove ion_handle and ion_client")
Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
Acked-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:38:26 +09:00
Okash Khawaja 349190d56b staging: speakup: remove unused code
In spk_ttyio_release we read tty's index but never do anything with it.
The patch removes this dead code.

Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:38:25 +09:00
Okash Khawaja 011cca558b staging: speakup: check for null before calling TTY's flush_buffer
We should check the flush_buffer method of a tty for null before
invoking it. Some drivers such as usbserial don't implement
flush_buffer. This will be required for upcoming patches where we expand
spk_ttyio to support more than just ttyS*.

Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:38:25 +09:00
Nikola Jelic d0b112ac2a staging: lustre: in-place endianness functions
lib-move.c file has a lot of expressions in the form of:
v = le[32|64]_to_cpu(v);
This caused a lot of sparse warnings.
Replaced with:
le[32|64]_to_cpus(&v);

Signed-off-by: Nikola Jelic <nikola.jelic83@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:32:41 +09:00
Nikola Jelic e4e5f9c6c7 staging: lustre: changed __u32 to __be32
Temporary variable is used only as __be32, for both assignments and reads,
but the type is inconsistent (__u32).

Signed-off-by: Nikola Jelic <nikola.jelic83@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:32:41 +09:00
Nikola Jelic 78c486189d lustre: ko2iblnd: removed forced u32 casts after htonl
sockaddr_in.sin_addr.s_addr is __be32 integral type, so the (__force u32)
cast after the htonl call is unnecessary, and also detected by sparse:
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c:2309:33: warning: incorrect type in assignment (different base types)
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c:2381:30: warning: incorrect type in assignment (different base types)

Signed-off-by: Nikola Jelic <nikola.jelic83@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:32:41 +09:00
Valentin Vidic 135e55f1d7 staging: lustre: cleanup le32 assignment to ldp_flags
Introduces a local var to collect flags and convert
them to le32.

Fixes the following sparse warnings:

drivers/staging/lustre/lustre/lmv/lmv_obd.c:2305:23: warning: invalid assignment: |=
drivers/staging/lustre/lustre/lmv/lmv_obd.c:2305:23:    left side has type restricted __le32
drivers/staging/lustre/lustre/lmv/lmv_obd.c:2305:23:    right side has type int
drivers/staging/lustre/lustre/lmv/lmv_obd.c:2383:39: warning: invalid assignment: |=
drivers/staging/lustre/lustre/lmv/lmv_obd.c:2383:39:    left side has type restricted __le32
drivers/staging/lustre/lustre/lmv/lmv_obd.c:2383:39:    right side has type int

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:32:41 +09:00
Mathias Rav 82a52f8ee0 staging: lustre: lprocfs: Use seq_puts instead of seq_printf
Reported by checkpatch.pl: "WARNING: Prefer seq_puts to seq_printf".

Signed-off-by: Mathias Rav <mathiasrav@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:32:41 +09:00
Mathias Rav 8b23093269 staging: lustre: Use kstrtouint_from_user in ldlm_rw_uint
Clean up the helper functions used to implement "dump_granted_max" in
debugfs.

Replace the lprocfs_rd_uint() and lprocfs_wr_uint() generic callbacks
with a simpler, more direct implementation of ldlm_rw_uint_fops.

There's a slight change in lustre debugfs write semantics: Using kstrtox
causes EINVAL when the written number is followed by other (garbage)
characters, whereas previously the garbage would be ignored and such a
write would succeed.

Signed-off-by: Mathias Rav <mathiasrav@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:32:41 +09:00
Konrad Malkowski 93e7ea8ca0 staging: lustre: Replace printk_ratelimited with pr_warn_ratelimited
This patch fixes the checkpoint.pl warning:

WARNING: Prefer printk_ratelimited or pr_<level>_ratelimited to
printk_ratelimit

Signed-off-by: Konrad Malkowski <konrad.malkowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:32:41 +09:00
Oleg Drokin 0a33252e06 staging/lustre/lov: remove set_fs() call from lov_getstripe()
lov_getstripe() calls set_fs(KERNEL_DS) so that it can handle a struct
lov_user_md pointer from user- or kernel-space.  This changes the
behavior of copy_from_user() on SPARC and may result in a misaligned
access exception which in turn oopses the kernel.  In fact the
relevant argument to lov_getstripe() is never called with a
kernel-space pointer and so changing the address limits is unnecessary
and so we remove the calls to save, set, and restore the address
limits.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Reviewed-on: http://review.whamcloud.com/6150
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3221
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Li Wei <wei.g.li@intel.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-03 17:17:19 +09:00
Boris Brezillon 4a78cc644e mtd: nand: Make sure drivers not supporting SET/GET_FEATURES return -ENOTSUPP
A lot of drivers are providing their own ->cmdfunc(), and most of the
time this implementation does not support all possible NAND operations.
But since ->cmdfunc() cannot return an error code, the core has no way
to know that the operation it requested is not supported.

This is a problem we cannot address for all kind of operations with the
current design, but we can prevent these silent failures for the
GET/SET FEATURES operation by overloading the default
->onfi_{set,get}_features() methods with one returning -ENOTSUPP.

Reported-by: Chris Packham <Chris.Packham@alliedtelesis.co.nz>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Tested-by: Chris Packham <Chris.Packham@alliedtelesis.co.nz>
2017-05-30 08:59:26 +02:00
Stefan Wahren 57d14635f9 staging: vchiq_core: Replace remaining BUG_ON with WARN_ON
This replaces all remaining BUG_ON with WARN_ON. So in case of
a VCHIQ bug the system is still usable.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 17:04:13 +02:00
Stefan Wahren d1eab9dec6 staging: vchiq_core: Bail out in case of invalid tx_pos
Properly handle the error case in case of an invalid tx_pos.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 17:04:13 +02:00
Stefan Wahren 6f2370d260 staging: vchiq_core: Don't BUG if process is unexpected
Bail out properly if the process index doesn't match the remote insert.
We also drop the BUG in case the process index is at local insert,
so we can trigger the WARN_ON again some steps later.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 17:04:13 +02:00
Stefan Wahren 5d1a94bb28 staging: vchiq_core: Bail out if ref_count is unexpected
If the ref counter of service has an unexpected value then we better
bail out.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 17:04:13 +02:00
Stefan Wahren 6b8db0bce3 staging: vchiq_core: Bail out if service is NULL
In the unlikely case that service is NULL we should bail out instead
of calling BUG_ON(). The other BUG_ON calls will be fixed in separate
patches.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 17:04:13 +02:00
Stefan Wahren 00b9d0f560 staging: vchiq_core: Don't BUG if sending RESUME fails
VCHIQ suspend and resume isn't implemented, but even it was
there is no need to call BUG().

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 17:04:13 +02:00
Stefan Wahren 359afaccd9 staging: vchiq_core: Bailout if VCHIQ state is already initialized
In case VCHIQ state is already initialized we need to bailout
in order to aovid a memory leak.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 17:04:12 +02:00
Stefan Wahren 7c35c6af0c staging: vchiq_core: Simplify VCHIQ init
Since the ARM side of VCHIQ support only 1 state, we could simplify
the init code. This makes it possible to avoid BUG_ON and a theoretical
overflow of id.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 17:02:30 +02:00
Stefan Wahren 244156ca90 staging: vchiq_2835_arm: Use PAGE_MASK macro
Use the PAGE_MASK instead of open code it.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 17:02:30 +02:00
Stefan Wahren 025f69ade9 staging: vchiq_2835_arm: Handle vmalloc_to_page error case
In case vmalloc_to_page returns NULL create_pagelist must abort
imediatly.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 17:02:30 +02:00
Stefan Wahren 804980adb9 staging: vchiq_2835_arm: Fix function name cleaup_pagelistinfo
Assuming the intension of the function is to clean up, so fix the function
name accordingly.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 17:02:29 +02:00
Stefan Wahren b322396ce8 staging: vchiq_arm: Avoid multiline dereference
Reduce the indentation within vchiq_dump_service_use_state in order
to avoid a multiline derefernce.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 17:02:29 +02:00
Stefan Wahren 42a6bd8f77 staging: vchiq_arm: Fix variable names in comment
This comment was apparently forgotten in the correction of CamelCase.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 17:02:29 +02:00
Stefan Wahren 76262b2951 staging: vchiq_2835_arm: Remove unnecessary assignment to slot_mem_size
The variable slot_mem_size is assigned a value which is never used.
This issue has been found by CppCheck.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 17:02:29 +02:00
Stefan Wahren 158ef80a87 staging: vchiq_2835_arm: Reduce scope of i in free_pagelist
We can reduce the scope of the counting variable i. This has
been found by CppCheck.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 17:02:29 +02:00
Stefan Wahren d3de2bb882 staging: vchiq_core: Use return value of mutex_lock_killable directly
Instead of saving the return value of mutex_lock_killable in a
local variable we could use the value directly.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 17:02:29 +02:00
Juliana Rodrigues 5b29aaaa1e staging: rtl8188eu: removes comparison to null
This patch fixes multiple comparison to NULL checkpatch errors by
rewriting the conditional as a negation.

Signed-off-by: Juliana Rodrigues <juliana.orod@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:59:32 +02:00
Juliana Rodrigues b2f98d02c7 staging: rtl8188eu: removed unnecessary blank lines
Removes numerous unnecessary blank lines in order to fix
checkpatch styling issues.

Signed-off-by: Juliana Rodrigues <juliana.orod@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:59:32 +02:00
Juliana Rodrigues 3e63e934f7 staging: rtl8188eu: removed unnecessary parentheses
This patch removes numerous unnecessary parentheses in order
to fix checkpatch styling issues.

Signed-off-by: Juliana Rodrigues <juliana.orod@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:59:32 +02:00
Juliana Rodrigues f6da172f21 staging: rtl8188eu: removed function names from strings
This patch fixes a checkpatch issue caused by using function
names inside strings. Those function names were replaced by
__func__.

Signed-off-by: Juliana Rodrigues <juliana.orod@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:59:32 +02:00
Juliana Rodrigues ae94127b01 staging: rtl8188eu: add spaces around character
This patch solves a checkpatch issue caused by not using spaces
around an OR sign.

Signed-off-by: Juliana Rodrigues <juliana.orod@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:59:32 +02:00
Juliana Rodrigues 31e6de0048 staging: rtl8188eu: fixes block comments subsequent lines
This patch adds * on block comments subsequent lines, which were
causing a checkpatch styling warning.

Signed-off-by: Juliana Rodrigues <juliana.orod@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:57:21 +02:00
Juliana Rodrigues 74e1e498e8 staging: rtl8188eu: fix comments with lines over 80 characters
This patch fixes some checkpatch errors in which comments go over
80 characters per line.

Signed-off-by: Juliana Rodrigues <juliana.orod@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:57:20 +02:00
Szilveszter Székely 9415b671a9 staging: rtl8192u: swap comparison to constant
Comparisons should place the constant on the right side of the test

This patch fixes coding style issues as reported by checkpatch.

Signed-off-by: Szilveszter Székely <szekelyszilv@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:57:20 +02:00
Ioana Radulescu 1e5fa9e260 staging: fsl-dpaa2/eth: Map Tx buffers as bidirectional
WRIOP hardware may need to write to the hardware annotation
area of Tx buffers (e.g. frame status bits) and also to
the data area (e.g. L4 checksum in frame header).

Map these buffers as DMA_BIDIRECTIONAL, otherwise the
write transaction through SMMU will not be allowed.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:57:20 +02:00
Ioana Radulescu 08eb23974e staging: fsl-dpaa2/eth: Fix address translations
Use the correct mechanisms for translating a DMA-mapped IOVA
address into a virtual one. Without this fix, once SMMU is
enabled on Layerscape platforms, the Ethernet driver throws
IOMMU translation faults.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:57:20 +02:00
Derek Robson 3ddf70e15d Drivers: ccree: ssi_fips_local.c - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:53:43 +02:00
Derek Robson 1a3a8d2e86 Drivers: ccree: ssi_hash.c - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:53:43 +02:00
Derek Robson 77f34fc3f5 Drivers: ccree: ssi_hash.h - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:53:43 +02:00
Derek Robson fc3d47b3ec Drivers: ccree: ssi_ivgen.c - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:53:43 +02:00
Derek Robson 3dc178b164 Drivers: ccree: ssi_pm.h - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:53:43 +02:00
Derek Robson ff7c2e41d4 Drivers: ccree: ssi_pm_ext.c - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:53:43 +02:00
Derek Robson 5d19caf6e9 Drivers: ccree: ssi_pm_ext.h - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:53:42 +02:00
Derek Robson 1010faa482 Drivers: ccree: ssi_request_mgr.c - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:53:42 +02:00
Derek Robson 2f930981b8 Drivers: ccree: ssi_request_mgr.h - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:53:42 +02:00
Derek Robson 6dbd671c07 Drivers: ccree: ssi_sysfs.c - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:53:42 +02:00
Derek Robson d057b3b78d Drivers: ccree: ssi_sysfs.h - align block comments
Fixed block comment alignment, Style fix only
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:49:56 +02:00
Gennadii Altukhov ba3937d6a6 staging: ccree: fix cc_crypto_ctx.h white spaces
Fix checkpatch.pl reported checks: spaces preferred around '/' and '<<' in cc_crypto_ctx.h

Signed-off-by: Gennadii Altukhov <grinrag@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:49:56 +02:00
Marko Stankovic a135c4f6b5 staging: wilc1000: add missing blank line after struct declaration
Fix a missing blank line issue reported by checkpatch.pl

Signed-off-by: Marko Stankovic <dartnorris@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-29 16:41:38 +02:00