Commit graph

40180 commits

Author SHA1 Message Date
Florian Westphal 860e9538a9 treewide: replace dev->trans_start update with helper
Replace all trans_start updates with netif_trans_update helper.
change was done via spatch:

struct net_device *d;
@@
- d->trans_start = jiffies
+ netif_trans_update(d)

Compile tested only.

Cc: user-mode-linux-devel@lists.sourceforge.net
Cc: linux-xtensa@linux-xtensa.org
Cc: linux1394-devel@lists.sourceforge.net
Cc: linux-rdma@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: MPT-FusionLinux.pdl@broadcom.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-can@vger.kernel.org
Cc: linux-parisc@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Cc: linux-hams@vger.kernel.org
Cc: linux-usb@vger.kernel.org
Cc: linux-wireless@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Cc: devel@driverdev.osuosl.org
Cc: b.a.t.m.a.n@lists.open-mesh.org
Cc: linux-bluetooth@vger.kernel.org
Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Acked-by: Antonio Quartulli <a@unstable.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-05-04 14:16:49 -04:00
Florian Westphal 4d0e965732 drivers: replace dev->trans_start accesses with dev_trans_start
a trans_start struct member exists twice:
- in struct net_device (legacy)
- in struct netdev_queue

Instead of open-coding dev->trans_start usage to obtain the current
trans_start value, use dev_trans_start() instead.

This is not exactly the same, as dev_trans_start also considers
the trans_start values of the netdev queues owned by the device
and provides the most recent one.

For legacy devices this doesn't matter as dev_trans_start can cope
with netdev trans_start values of 0 (they are ignored).

This is a prerequisite to eventual removal of dev->trans_start.

Cc: linux-rdma@vger.kernel.org
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-05-04 14:16:47 -04:00
Daeseok Youn a0ca97b808 staging: dgnc: Fix a NULL pointer dereference
The error handling for print_drive after calling tty_alloc_driver()
was needed. But there was error handling but too late for this.
Error handling code moved after tty_alloc_driver() call.

Fixes: 60b3109e5e ("staging: dgnc: use tty_alloc_driver instead of kcalloc")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 22:57:14 -07:00
Kangjie Lu d13829686b staging: wilc1000: fix infoleak in wilc_wfi_cfgoperations
"mac" is an array allocated in stack without being initialized,
and will be sent out via "nla_put". The dump_station() is supposed
to initialize the mac address; otherwise, sensitive data in kernel
stack will be leaked. To fix this, copy the mac address to it.

Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 22:57:14 -07:00
David S. Miller cba6532100 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
	net/ipv4/ip_gre.c

Minor conflicts between tunnel bug fixes in net and
ipv6 tunnel cleanups in net-next.

Signed-off-by: David S. Miller <davem@davemloft.net>
2016-05-04 00:52:29 -04:00
H Hartley Sweeten 5c69585837 staging: comedi: mite: tidy up module init/exit
Move the module_init()/module_exit() so they are in the prefered spot
on the line after the function.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:11:15 -07:00
H Hartley Sweeten b21f1fc84c staging: comedi: mite: document the remaining exported functions
For aesthetics, add docbook comments for the exported functions.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:11:15 -07:00
H Hartley Sweeten f5f4f0c7c8 staging: comedi: mite: move the mite dma arm/disarm/reset functions
For aesthetics, move these functions to a more logical spot in the
code and add docbook comments for the exported functions.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:11:15 -07:00
H Hartley Sweeten 71f53ea4ba staging: comedi: mite: move mite_prep_dma()
For aesthetics, move this functions to a more logical spot in the
code and add a docbook comment for the exported function.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:11:15 -07:00
H Hartley Sweeten c3c860b395 staging: comedi: mite: tidy up mite dma channel request/release
For aesthetics, make the actual "request" function static and change
mite_request_channel_in_range() into a wrapper that calls the internal
function. Change the inline function that requests any free channel
into an export that also calls the internal function.

Move the functions to a more logical spot in the code and add docbook
comments for the exported functions.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:11:15 -07:00
H Hartley Sweeten fc53242394 staging: comedi: mite: move the mite ring functions
For aesthetics, move the functions that allocate/free and initialize
the mite dma ring. They are currently kind of scattered around the
code.

Add docbook comments for the exported functions.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:11:15 -07:00
H Hartley Sweeten a2163cc35a staging: comedi: mite: tidy up kernel messages in mite_steup()
The dev_err() messages with pci_ioremap_bar() fails are just noise.
Remove them.

The 'use_win1' and 'fifo_size' dev_info() messages are also noise
but they may be useful when debugging. Change them to dev_dbg().

Absorb dump_chip_signnature() and change the pr_info() messages
to dev_dbg(). These also might be useful when debugging.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:11:15 -07:00
H Hartley Sweeten 48f2c1aecf staging: comedi: mite: do mite_steup() as part of mite_attach()
Currently all the drivers that use the mite driver have to call
mite_setup() after allocating and initializing the mite device
with mite_attach().

Move the mite_setup() call into mite_attach() to simplify the
drivers a bit and remove the need for the additional inline and
exported functions.

For aesthetics, move mite_setup2(), and rename it to mite_setup(),
so it's near mite_attach().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:11:15 -07:00
H Hartley Sweeten 5b329305d2 staging: comedi: mite: document mite_alloc()/mite_detach()
These functions are basically the comedi_driver (*attach)/(*detach)
for this driver.

For aesthetics, rename mite_alloc() to mite_attach() and pass the
comedi_device pointer to it instead of the pci_dev pointer.

Move the functions to the end of the file. This is typically where
a comedi_drivers (*attach)/(*detach) are located.

Add some docbook comments for these exported functions.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:11:15 -07:00
H Hartley Sweeten 0bdb1288fa staging: comedi: mite: use prefered form for passing a struct size
Add a local variable to mite_buf_change() so that the prefered
form of passing a struct size, sizeof(*p), can be used.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:11:15 -07:00
H Hartley Sweeten 9ec148da5f staging: comedi: mite: introduce mite_free_dma_descs()
Introduce a helper function to handle the dma_free_coherent() of
the mite dma descriptors.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:11:15 -07:00
H Hartley Sweeten 48a73aedd7 staging: comedi: mite: remove mite member 'channel_allocated'
An allocated mite_channel will have its 'ring' member initialized
to point to the mite_ring that will be used for DMA. A non-allocated
mite_channel will have a 'ring' member set to NULL, either by a
channel release or due to the initial kzalloc of the 'mite' struct.

Refactor the code to use the mite_chan->ring to detect in a channel
is allocated and remove the unnecessary member.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:11:15 -07:00
H Hartley Sweeten ab55b5c9f2 staging: comedi: mite: rename mite member 'mite_io_addr'
Rename this member of struct mite to 'mmio' to help shorten the long lines.

Add a local variable for the mite pointer in the ni_pcimio driver
to clarify and shorten the long lines.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:11:15 -07:00
H Hartley Sweeten 3303410d04 staging: comedi: mite: tidy up mite_init_ring_descriptors()
Use a local variable for the mite_dma_desc pointer to help clarify
this function.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:11:15 -07:00
H Hartley Sweeten b0af848ca3 staging: comedi: mite: rename mite_ring member 'descriptors'
Rename this member of struct mite_ring to 'descs' to help shorten the
long lines.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:11:15 -07:00
H Hartley Sweeten a8b559275e staging: comedi: mite: rename mite_ring member 'descriptors_dma_addr'
Rename this member of struct mite_ring to 'dma_addr' to help shorten the
long lines.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:11:15 -07:00
H Hartley Sweeten 19d9212ef9 staging: comedi: mite: rename 'struct mite_dma_descriptor_ring'
Rename this name to 'mite_ring' to help shorten the long lines.

In the ni_660x driver, also shorten the private data member 'mite_rings'
to simply 'ring'.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:11:15 -07:00
H Hartley Sweeten f5d077cd20 staging: comedi: mite: rename 'struct mite_dma_descriptor'
Rename this struct to 'mite_dma_desc' to help shorten the long lines.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:11:15 -07:00
H Hartley Sweeten 1a8da31b6c staging: comedi: mite: rename 'struct mite_struct'
Rename this struct to simply 'mite'. The current name is a bit redundant.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:11:15 -07:00
Manu Kumar 43bb50ec36 staging: skein: cleanup: align code to parentheses
Align wrapped lines to parentheses (if applicable).

Signed-off-by: Manu Kumar <maraku@gmx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:07:11 -07:00
Manu Kumar e602a80822 staging: skein: cleanup: removed unnecessary cast spaces
Spaces after casts are removed

Signed-off-by: Manu Kumar <maraku@gmx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:07:11 -07:00
Manu Kumar 5b05c1e243 staging: skein: cleanup: Fixed operator whitespace
added operator white space and parentheses for readability

Signed-off-by: Manu Kumar <maraku@gmx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:07:11 -07:00
Manu Kumar a28e32e061 staging: skein: cleanup: fixed new lines
Added lines between functions in skein_block.c and removed unneeded
lines in skein_block.c

Signed-off-by: Manu Kumar <maraku@gmx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:07:11 -07:00
Chaehyun Lim beba2ab84e staging: wilc1000: rename result in handle_get_mac_address
This patch renames result to ret that is used to get return value from
wilc_send_config_pkt. Some handle_*() functions are used as result,
others are used as ret. It will be changed as ret in all handle_*()
functions to match variable name.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:05:59 -07:00
Chaehyun Lim 098bd3fd06 staging: wilc1000: change data type of result in handle_get_mac_address
This patch changes data type of result variable from s32 to int. result
is used to get return value from wilc_send_config_pkt that has return
type of int.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:05:59 -07:00
Chaehyun Lim 93dc5d5583 staging: wilc1000: change handle_get_mac_address's return type to void
When handle_get_mac_address is called in hostIFthread that is a kernel
thread, it is not checked return type of this function. This patch
changes return type to void and removes braces if statement due to have
a single statement.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:05:59 -07:00
Chaehyun Lim abfaf5fcd8 staging: wilc1000: fix comparison style of if statement in handle_get_ip_address
This patch changes conditional comparison of if statement as if (ret)
instead of using if (ret != 0)

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:05:59 -07:00
Chaehyun Lim 6f2f5d5ec1 staging: wilc1000: rename result in handle_get_ip_address
This patch renames result to ret that is used to get return value from
wilc_send_config_pkt. Some handle_*() functions are used as result,
others are used as ret. It will be changed as ret in all handle_*()
functions to match variable name.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:05:59 -07:00
Chaehyun Lim cdc339a29f staging: wilc1000: change data type of result in handle_get_ip_address
This patch changes data type of result variable from s32 to int. result
is used to get return value from wilc_send_config_pkt that has return
type of int.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:05:59 -07:00
Chaehyun Lim 8f9d9e0041 staging: wilc1000: change handle_get_ip_address's return type to void
When handle_get_ip_address is called in hostIFthread that is a kernel
thread, it is not checked return type of this function. This patch
changes return type to void and removes braces if statement due to have
a single statement.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03 14:05:59 -07:00
Al Viro 84695ffee7 Merge getxattr prototype change into work.lookups
The rest of work.xattr stuff isn't needed for this branch
2016-05-02 19:45:47 -04:00
Mauro Carvalho Chehab 68af062b5f Linux 4.6-rc6
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJXJoi6AAoJEHm+PkMAQRiGYKIIAIcocIV48DpGAHXFuSZbzw5D
 rp9EbE5TormtddPz1J1zcqu9tl5H8tfxS+LvHqRaDXqQkbb0BWKttmEpKTm9mrH8
 kfGNW8uwrEgTMMsar54BypAMMhHz4ITsj3VQX5QLSC5j6wixMcOmQ+IqH0Bwt3wr
 Y5JXDtZRysI1GoMkSU7/qsQBjC7aaBa5VzVUiGvhV8DdvPVFQf73P89G1vzMKqb5
 HRWbH4ieu6/mclLvW9N2QKGMHQntlB+9m2kG9nVWWbBSDxpAotwqQZFh3D52MBUy
 6DH/PNgkVyDhX4vfjua0NrmXdwTfKxLWGxe4dZ8Z+JZP5c6pqWlClIPBCkjHj50=
 =KLSM
 -----END PGP SIGNATURE-----

Merge tag 'v4.6-rc6' into patchwork

Linux 4.6-rc6

* tag 'v4.6-rc6': (762 commits)
  Linux 4.6-rc6
  EDAC: i7core, sb_edac: Don't return NOTIFY_BAD from mce_decoder callback
  Documentation/sysctl/vm.txt: update numa_zonelist_order description
  lib/stackdepot.c: allow the stack trace hash to be zero
  rapidio: fix potential NULL pointer dereference
  mm/memory-failure: fix race with compound page split/merge
  ocfs2/dlm: return zero if deref_done message is successfully handled
  Ananth has moved
  kcov: don't profile branches in kcov
  kcov: don't trace the code coverage code
  mm: wake kcompactd before kswapd's short sleep
  .mailmap: add Frank Rowand
  mm/hwpoison: fix wrong num_poisoned_pages accounting
  mm: call swap_slot_free_notify() with page lock held
  mm: vmscan: reclaim highmem zone if buffer_heads is over limit
  numa: fix /proc/<pid>/numa_maps for THP
  mm/huge_memory: replace VM_NO_THP VM_BUG_ON with actual VMA check
  mailmap: fix Krzysztof Kozlowski's misspelled name
  thp: keep huge zero page pinned until tlb flush
  mm: exclude HugeTLB pages from THP page_mapped() logic
  ...
2016-05-02 07:48:23 -03:00
Christoph Hellwig c8b8e32d70 direct-io: eliminate the offset argument to ->direct_IO
Including blkdev_direct_IO and dax_do_io.  It has to be ki_pos to actually
work, so eliminate the superflous argument.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2016-05-01 19:58:39 -04:00
Jacky Boen 99aded71b5 Staging: drivers: rtl8188eu: use sizeof(*ptr) instead of sizeof(struct)
Fix coding style issue

Signed-off-by: Jacky Boen <aqiank@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:34:53 -07:00
Jacky Boen 9cb2dbf316 Staging: drivers: rtl8188eu: fixed extraneous spaces
Fix coding style issue

Signed-off-by: Jacky Boen <aqiank@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:34:50 -07:00
Jacky Boen d5fdbca674 Staging: drivers: rtl8188eu: fixed extraneous parentheses
Fix coding style issue

Signed-off-by: Jacky Boen <aqiank@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:34:50 -07:00
Jacky Boen a305990d38 Staging: drivers: rtl8188eu: fixed extraneous indentation
Fixed coding style issue

Signed-off-by: Jacky Boen <aqiank@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:34:50 -07:00
Jacky Boen a634696eb4 Staging: drivers: rtl8188eu: fixed unnecessary else branch
Fixed coding style issue

Signed-off-by: Jacky Boen <aqiank@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:34:50 -07:00
Jacky Boen a48d498b15 Staging: drivers: rtl8188eu: fixed brace style
Fixed coding style issue

Signed-off-by: Jacky Boen <aqiank@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:34:50 -07:00
Jacky Boen 99f8adc450 Staging: drivers: rtl8188eu: fixed newlines style
Fixed coding style issue

Signed-off-by: Jacky Boen <aqiank@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:34:50 -07:00
Jacky Boen 637642e2a3 Staging: drivers: rtl8188eu: fixed block comments style
Fixed coding style issue

Signed-off-by: Jacky Boen <aqiank@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:34:50 -07:00
Jacky Boen f43534b97a Staging: drivers: rtl8188eu: fixed typo
Fixed typo

Signed-off-by: Jacky Boen <aqiank@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:34:50 -07:00
Jacky Boen ffc9b27571 Staging: drivers: rtl8188eu: move constants to the right in comparisons
Fixed coding style issue

Signed-off-by: Jacky Boen <aqiank@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:34:50 -07:00
Sudip Mukherjee 78481742be staging: i4l: act2000: remove extra space
It is not kernel coding style to give an extra space after a cast.
We get warned about it by checkpatch.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:33:34 -07:00
Sudip Mukherjee fdf94a00e3 staging: i4l: act2000: remove blank line after brace
checkpatch complains about an extra blank line after an opening brace.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:33:34 -07:00
Sudip Mukherjee 360a63c850 staging: i4l: act2000: do not assign in if
It is not the kernel coding style to assign values to some variable in
if statement. Split them up into different statements.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:33:34 -07:00
Sudip Mukherjee 2c78f701a4 staging: i4l: act2000: fix use of return
checkpatch warns that return is not a function and as such the brace
after it is not required.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 14:33:34 -07:00
Parth Sane e7d992d8b6 rtl8712: Fixed alignment to match open parenthesis
Fixed alignment to match open parenthesis.

Signed-off-by: Parth Sane <laerdevstudios@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-01 13:57:12 -07:00
Peter Hurley 97ef38b821 tty: Replace TTY_THROTTLED bit tests with tty_throttled()
Abstract TTY_THROTTLED bit tests with tty_throttled().

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-30 09:26:55 -07:00
Peter Hurley 18900ca65a tty: Replace TTY_IO_ERROR bit tests with tty_io_error()
Abstract TTY_IO_ERROR status test treewide with tty_io_error().
NB: tty->flags uses atomic bit ops; replace non-atomic bit test
with test_bit().

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-30 09:26:55 -07:00
Matthias Brugger 33ea58a910 staging: fsl-mc: bus: Drop warning
When updating the irq_chip and msi_domain_ops, the code checkes for
already present functions.
When more then one ITS controller are present in the system,
irq_chip and msi_domain_ops got already set and a warning is invoked.

This patch deletes the warning, as the funtions are just already set to
the needed callbacks.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:02:23 -07:00
Horia Geantă 633440505f staging: fsl-mc: return -EINVAL for all fsl_mc_portal_allocate() failures
There are some error paths that allow for a NULL new_mc_io and err = 0
return code. Return -EINVAL instead.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Itai Katz 01f9330846 staging: fsl-mc: add dpmcp version check
The dpmcp driver supports dpmcp version 3.0 and above.
This patch adds the code to check the version.

Signed-off-by: Itai Katz <itai.katz@nxp.com>
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>

 drivers/staging/fsl-mc/bus/dpmcp-cmd.h    |    6 +++---
 drivers/staging/fsl-mc/bus/mc-allocator.c |   11 +++++++++++
 2 files changed, 14 insertions(+), 3 deletions(-)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Horia Geanta ae014c23d5 staging: fsl-mc: add quirk handling for dpseci objects < 4.0
dpseci objects < 4.0 are not coherent-- in spite of the fact
that the MC reports them to be coherent in certain versions.
Add a special case to set the no shareability flag for dpseci
objects < 4.0.

Signed-off-by: Horia Geanta <horia.geanta@nxp.com>
(Stuart: reworded commit message, updated comment in patch)
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Itai Katz 1716cb4c65 staging: fsl-mc: add dprc version check
The dprc driver supports dprc version 5.0 and above.
This patch adds the code to check the version.

Signed-off-by: Itai Katz <itai.katz@nxp.com>
(Stuart: resolved merge conflicts, split dpseci quirk into separate patch)
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Itai Katz 9529d166f3 staging: fsl-mc: get version of root dprc from MC hardware
The root dprc is discovered as a platform device in the device tree.  The
version of that dprc was previously set using hardcoded values from the API
header in the kernel).  This patch removes the use of the hardcoded version
numbers and instead reads the actual dprc version from the hardware.

Signed-off-by: Itai Katz <itai.katz@nxp.com>
(Stuart: resolved merge conflict, updated commit subject/log)
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Itai Katz b3721fc1e0 staging: fsl-mc: set cacheable flag for added devices if applicable
Some DPAA2 devices have mmio regions that should be mapped as
cacheable by drivers.  Set IORESOURCE_CACHEABLE in the region's
flags if applicable.

Signed-off-by: Itai Katz <itai.katz@nxp.com>
[Stuart: update subject and commit message]
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Stuart Yoder 0f90f25b8f staging: fsl-mc: set up coherent dma ops for added devices
Unless discovered devices have the no shareability flag set,
set up coherent dma ops for them.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Itai Katz 9787d4e05e staging: fsl-mc: don't use object versions to make binding decisions
Up until now if the object version expected by a driver (in the API header
file) did not match the actual object version in the MC hardware the bus
driver refused to bind the object to the driver or printed out WARN_ON
dumps.

This patch removes those checks, and the responsibility of object version
checking should now be done in the object drivers themselves.  If the actual
version discovered is not supported, the driver's probe function should fail.
Drivers should use version checks to support new features and provide
backwards compatibility if at all possible.

This patch also removes the checks that caused bus driver probing to fail
if the overall MC version discovered did not match the firmware version
from the API header...this was too strict.  The overall MC version is
informational like a release number, and continues to be printed in the
boot log.

Signed-off-by: Itai Katz <itai.katz@nxp.com>
(Stuart: reworded commit log)
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Stuart Yoder ac0619981d staging: fsl-mc: update dprc binary interface to v5.1
The meaning of the "status" parameter in dprc_get_irq_status
has changed, and this patch updates the flib and caller
of the API.

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Stuart Yoder 6606c073a5 staging: fsl-mc: update dpbp binary interface to v2.2
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Stuart Yoder f8274454bc staging: fsl-mc: update dpmcp binary interface to v3.0
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Stuart Yoder 7dc0818367 staging: fsl-mc: DPAA2 overview readme update
incorporated feedback from review comments, other misc cleanup/tweaks

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Stuart Yoder 71bd14e3ec staging: fsl-mc: TODO updates
remove 3 of the remaining TODO items:

   -multiple root fsl-mc buses-- done in patch series starting with
    commit 14f928054a ("staging: fsl-mc: abstract test for existence
    of fsl-mc bus")

   -interrupt support-- done in patch series starting with
    commit 9b1b282ccd ("irqdomain: Added domain bus token
    DOMAIN_BUS_FSL_MC_MSI")

   -MC command serialization-- done in commit 63f2be5c3b ("staging:
    fsl-mc: Added serialization to mc_send_command()")

Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Acked-by: German Rivera <german.rivera@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 18:00:45 -07:00
Nikita Eshkeev d6a1b8d9db staging: board: line over 80 characters
This patch fixes the checkpatch.pl warning:

WARNING: line over 80 characters
+   .domain         = "/system-controller@e6180000/pm-domains/c5/a4lc@1"

Signed-off-by: Nikita Eshkeev <kastolom@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:58:02 -07:00
han tai 5678824069 staging: vt6656: Add space to align functions
Issue found by checkpatch.pl
CHECK: Alignment should match open parenthesis

Signed-off-by: han tai <hantai1248@hotmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:58:02 -07:00
Clifton Barnes d37912dd29 staging: slicoss: fix missing blank line
fix checkpatch.pl warning about 'Missing a blank line after
declarations'

Signed-off-by: Clifton Barnes <clifton.a.barnes@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:58:02 -07:00
Clifton Barnes f2fe1bc900 staging: slicoss: fix bare use of 'unsigned'
fix checkpatch.pl warning about 'Prefer 'unsigned int' to bare use of
'unsigned''

Signed-off-by: Clifton Barnes <clifton.a.barnes@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:58:02 -07:00
Manav Batra e0ab2c8ef5 staging: rts5208: alignment to match open paranthesis
Fixes CHECK: Alignment should match open parenthesis

Signed-off-by: Manav Batra <batmanav10@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:58:02 -07:00
Nicholas Sim 649b55b426 staging: rts5208: ensure braces on all arms of if stmt
Added braces on if arm of if statement where else arm already needs
braces as suggested for clarity in Documentation/CodingStyle (several)

Signed-off-by: Nicholas Sim <nicholassimws@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:58:02 -07:00
Dan Carpenter ae25d43c59 staging: lowmemorykiller: remove bogus NULL check
The NULL checking here doesn't make sense, so it causes a static checker
warning.  It turns out that p->mm can't be NULL so the inconsistency is
harmless and we should just remove the check.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:58:02 -07:00
Cihangir Akturk 6ffdc7b954 staging: fsl-mc: get rid of mutex_locked variables
Remove mutex_locked variables which are used to determine whether mutex is
locked, instead add another label to unlock mutex on premature exits due to
an error.

This patch also addresses the folowing warnings reported by coccinelle:

drivers/staging/fsl-mc/bus/mc-allocator.c:237:1-7: preceding lock on line 204
drivers/staging/fsl-mc/bus/mc-allocator.c:89:1-7: preceding lock on line 57
drivers/staging/fsl-mc/bus/mc-allocator.c:157:1-7: preceding lock on line 124

Signed-off-by: Cihangir Akturk <cakturk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:55:54 -07:00
Ben Hutchings c3f463484b staging: rtl8192u: Fix crash due to pointers being "confusing"
There's no net_device stashed in skb->cb, there's a net_device * there.

To make it *really* clear, also change the write of the dev pointer
into skb->cb from a memcpy() to an assignment.

Fixes: 3fe5632493 ("staging: rtl8192u: r8192U_core.c: Cleaning up ...")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:53:47 -07:00
Nicholas Sim b8a99fb513 staging: rtl8192u: rewrite NULL comparison for pointers
When testing pointers, it is not necessary to explicitly compare to
NULL. Rewrite if condition as (!ptr) or (ptr) as suggested in
Documentation/CodingStyle

Signed-off-by: Nicholas Sim <nicholassimws@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:53:47 -07:00
Nicholas Sim b7141cbaf9 staging: rtl8192u: add blank line after declarations
Add a blank line after function/struct/union/enum declarations for
readability, as suggested in Documentation/CodingStyle

Signed-off-by: Nicholas Sim <nicholassimws@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:53:47 -07:00
Nicholas Sim 345c32ab9b staging: rtl8192u: remove blank lines after braces (opening)
Remove unneeded blank lines appearing after opening braces as suggested
by checkpatch.pl

Signed-off-by: Nicholas Sim <nicholassimws@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:53:47 -07:00
Nicholas Sim 708075cf1b staging: rtl8192u: remove blank lines before braces (closing)
Remove unneeded blank lines occuring before closing braces

Signed-off-by: Nicholas Sim <nicholassimws@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:53:47 -07:00
Geliang Tang fcc2cf12a3 staging: rtl8712: use container_of() instead of LIST_CONTAINOR()
This patch drops the local definition of LIST_CONTAINOR(), and uses
container_of() instead of it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:53:47 -07:00
Manu Kumar 3faa966bfb staging: skein: cleanup: align parentheses
Aligned parentheses to conform to the coding style.

Signed-off-by: Manu Kumar <maraku@gmx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:51:10 -07:00
Manu Kumar 78930e7c3c staging: skein: cleanup: add operator white space
Added white space between operators and operands. Because this sometimes
maxed out the column width, some expressions were broken up into multiple
lines, and comments were moved appropriately.

Signed-off-by: Manu Kumar <maraku@gmx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:51:06 -07:00
Daeseok Youn 60b3109e5e staging: dgnc: use tty_alloc_driver instead of kcalloc
The tty_alloc_driver() can allocate memory for ttys and termios.
And also allocated memory will be released easily with
put_tty_driver() call.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:46:00 -07:00
Daeseok Youn e47e7379ce staging: dgnc: remove redundant NULL check in
There were already checking NULL about channel_t / un_t
before calling dgnc_maxcps_room().

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:46:00 -07:00
Daeseok Youn 16f10a825d staging: dgnc: return -ENOMEM when kzalloc failed
The kzalloc can be failed when memory is not enough
to allocate. When kzalloc failed, it need to return
error code with ENOMEM

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:46:00 -07:00
Daeseok Youn 6b3752d8ce staging: dgnc: remove blank line
fix checkpatch.pl warning:
Blank lines aren't necessary after an open brace '{'

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:46:00 -07:00
Daeseok Youn ea753f2a59 staging: dgnc: remove parenthesis around the CONST |
remove parenthesis around the CONST | CONST.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:46:00 -07:00
Juanma de Hoyos 24039c589b drivers/staging/dgnc: Added spaces around a bitwise OR.
Coding rules request placing bitwise OR operators between empty spaces
for better readibility. This patch applies this format to a line in
dgnc_tty.c file.

Signed-off-by: Juanma de Hoyos <juanmahv@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:46:00 -07:00
Claudiu Beznea e26eaf4579 Staging: wlan-ng: memory allocated inside mkimage() is not freed if subsequent calls fails.
This patch frees memory allocated inside mkimage() in case mkimage()
or any other subsequent calls inside prism2_fwapply() from prism2fw.c
file fails. To fix this I introduces goto labels where the free
operation is done in case some operations fails. After the introduction
of goto labels has been done, in order to use the same return path,
"return x" instuctions were replaced with "goto" instuctions.

Signed-off-by: Claudiu Beznea <claudiu.beznea@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:43:15 -07:00
Nicholas Sim 02e020480d staging: wlan-ng: rewrite NULL comparison
It is not necessary to compare explicitly to NULL. Rewrite if condition
as (!dev) or (dev) as suggested in Documentation/CodingStyle

Signed-off-by: Nicholas Sim <nicholassimws@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:43:15 -07:00
Sudip Mukherjee 9f563f1a2a staging: android: ion: dummy: fix dereference of ERR_PTR
ion_device_create() can fail and if it fails then it returns the error
value in ERR_PTR.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Reviewed-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:40:50 -07:00
Ben Marsh 3229ff343c Staging: android: modify memory allocation style in ion_chunk_heap.c
Modify memory allocation style in order to silence a checkpatch.pl
warning.

Signed-off-by: Ben Marsh <bmarsh94@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:40:50 -07:00
Ben Marsh 9fea19a9a4 Staging: android: modify memory allocation style in ion_test.c
Modifies the memory allocation style ion_test.c in order to remove a
checkpatch.pl warning

Signed-off-by: Ben Marsh <bmarsh94@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:40:50 -07:00
Markus Böhme 0045c8ddd6 staging: android: ion: make locally used functions static
Functions ion_handle_put and ion_handle_get_by_id are only used locally
in ion.c, so they should be made static as they used to be before
9590232b ("staging/android/ion : fix a race condition in the ion driver").

Signed-off-by: Markus Böhme <markus.boehme@mailbox.org>
Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org>
Reviewed-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:39:35 -07:00
Gustavo Padovan 62304fb1fc dma-buf/sync_file: de-stage sync_file
sync_file is useful to connect one or more fences to the file. The file is
used by userspace to track fences between drivers that share DMA bufs.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:37:10 -07:00
Gustavo Padovan 460bfc41fd dma-buf/sync_file: de-stage sync_file headers
Move sync_file headers file to include/ dir.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:37:10 -07:00
Gustavo Padovan 92e06213f1 staging/android: style fix: alignment to match the open parenthesis
Fix checks reported by checkpatch.pl.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:37:10 -07:00
Gustavo Padovan c240a714a6 staging/android: improve documentation for sync_file
num_fences was missing a colon mark and sync_file_create() now have
better description.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:37:10 -07:00
Gustavo Padovan d4cab38e15 staging/android: prepare sync_file for de-staging
Move its functions and structs to their own file. Also moves function's
docs to the .c file.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:37:10 -07:00
Gustavo Padovan d7c3110c28 staging/android: remove name arg from sync_file_create()
Simplifies the API to only receive the fence it needs to add to the
sync and create a name for the sync_file based on the fence context and
seqno.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:37:10 -07:00
Gustavo Padovan 10e362c387 staging/android: make sync_file_fdget() static
There is no plan in the near future to use this function outside of this
file so keep it as static.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:37:10 -07:00
Gustavo Padovan 4dff14e88e staging/android: make sync_file_merge() static
There is no plan in the near future to use this function outside of this
file so keep it as static.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:37:10 -07:00
Gustavo Padovan 696f74cf54 staging/android: move sync_file functions comments to sync.c
To keep comments in line with drivers/dma-buf/ move all sync_file comments
to sync.c.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:37:10 -07:00
Gustavo Padovan 2a7c1db557 staging/android: drop sync_file_install() and sync_file_put()
These two functions are just wrappers for one line functions, they
call fd_install() and fput() respectively, so just get rid of them
and use fd_install() and fput() directly for more simplicity.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:37:10 -07:00
Gustavo Padovan a64d6a6866 staging/android: remove redundant comments on sync_merge_data
struct sync_merge_data already have documentation on top of the
struct definition. No need to duplicate it.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:37:10 -07:00
Linus Torvalds 925d96a0c9 Final set of -rc fixes for 4.6
- A number of collected fixes for oopses, memory corruptions, deadlocks,
   etc.  All of these fixes are small (many only 5-10 lines), obvious,
   and tested.
 - Fix for the security issue related to the use of write for
   bi-directional communications.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXIrZVAAoJELgmozMOVy/d/XEP/1A4Ohm7WiZMN09wvlFGSgLe
 2z2tY9ILvFuiAF++VZRfYyRmHorVKHYB1tk0JTsW1Ts1DrkjExgr4LS1/YDLOC42
 q8YlBZw2x7pdnD5W1MJm+HK6oNj7aZVVjEHG7QnfLUIXr57a2rBQIeeWLx24M+OS
 j1yvaY/v39qvf7dwHwVjs07rh2WW9QCZn2c/552G4xz1YDdTkYBTc2WNnl0eng1f
 1NqqMXhnajmNyR+Q+0+Vbcp4YWv551l5E6j9M+5nebehNtPSRb0GEIjxT3KnSGEg
 AjFev3XwnRF9EkQOwgbsg7a784+UHXe15vbr1MvbzGygcQeq4NVzLl04WEHExQe1
 Om0ES/i8zfRs6d5XYB5zMY8pJbdjSVM/20d+h21SQs//4JXXJrN35WVAyy8lgwrX
 M3oY4t21eBQlV7oezfEZQgEEbdtccr8LILfZZmRUWPHd2ymaTWg6e4pZwtn45rlD
 O/Gb11G/UT7SXgw+XiPLBj5xlQk7nRn0kGuaStR7PonkLQ9Zy1wSSptvJeGj0VWE
 W6TEJnIqtv0aiJLhIQn8Ee1pCxE/ds7UPW6wT5O9R8ccEdDeIB3BDgskTNg1xPuS
 I8e1o7iA9752YS3wMDhLA8PifwbmVbkGHxJUQecOBPiDcdukkM0q4/YoNYqXKLCc
 nLDv3fMztpinG1L1T2LM
 =MFdC
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma

Pull rdma fixes from Doug Ledford:
 "Final set of -rc fixes for 4.6.

  I've collected up a number of patches that are all pretty small with
  the exception of only a couple.  The hfi1 driver has a number of
  important patches, and it is what really drives the line count of this
  pull request up.  These are all small and I've got this kernel built
  and running in the test lab (I have most of the hardware, I think nes
  is the only thing in this patch set that I can't say I've personally
  tested and have up and running).

  Summary:

   - A number of collected fixes for oopses, memory corruptions,
     deadlocks, etc.  All of these fixes are small (many only 5-10
     lines), obvious, and tested.

   - Fix for the security issue related to the use of write for
     bi-directional communications"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma:
  RDMA/nes: don't leak skb if carrier down
  IB/security: Restrict use of the write() interface
  IB/hfi1: Use kernel default llseek for ui device
  IB/hfi1: Don't attempt to free resources if initialization failed
  IB/hfi1: Fix missing lock/unlock in verbs drain callback
  IB/rdmavt: Fix send scheduling
  IB/hfi1: Prevent unpinning of wrong pages
  IB/hfi1: Fix deadlock caused by locking with wrong scope
  IB/hfi1: Prevent NULL pointer deferences in caching code
  MAINTAINERS: Update iser/isert maintainer contact info
  IB/mlx5: Expose correct max_sge_rd limit
  RDMA/iw_cxgb4: Fix bar2 virt addr calculation for T4 chips
  iw_cxgb4: handle draining an idle qp
  iw_cxgb3: initialize ibdev.iwcm->ifname for port mapping
  iw_cxgb4: initialize ibdev.iwcm->ifname for port mapping
  IB/core: Don't drain non-existent rq queue-pair
  IB/core: Fix oops in ib_cache_gid_set_default_gid
2016-04-29 17:07:54 -07:00
Gustavo Padovan 2d75c88fef staging/android: refactor SYNC IOCTLs
Change SYNC_IOC_FILE_INFO (former SYNC_IOC_FENCE_INFO) behaviour to avoid
future API breaks and optimize buffer allocation.

Now num_fences can be filled by the caller to inform how many fences it
wants to retrieve from the kernel. If the num_fences passed is greater
than zero info->sync_fence_info should point to a buffer with enough space
to fit all fences.

However if num_fences passed to the kernel is 0, the kernel will reply
with number of fences of the sync_file.

Sending first an ioctl with num_fences = 0 can optimize buffer allocation,
in a first call with num_fences = 0 userspace will receive the actual
number of fences in the num_fences filed.

Then it can allocate a buffer with the correct size on sync_fence_info and
call SYNC_IOC_FILE_INFO again, but now with the actual value of num_fences
in the sync_file.

info->sync_fence_info was converted to __u64 pointer to prevent 32bit
compatibility issues. And a flags member was added.

An example userspace code for the later would be:

	struct sync_file_info *info;
	int err, size, num_fences;

	info = malloc(sizeof(*info));

	info.flags = 0;
	err = ioctl(fd, SYNC_IOC_FILE_INFO, info);
	num_fences = info->num_fences;

	if (num_fences) {
		info.flags = 0;
		size = sizeof(struct sync_fence_info) * num_fences;
		info->num_fences = num_fences;
		info->sync_fence_info = (uint64_t) calloc(num_fences,
							  sizeof(struct sync_fence_info));

		err = ioctl(fd, SYNC_IOC_FILE_INFO, info);
	}

Finally the IOCTLs numbers were changed to avoid any potential old
userspace running the old API to get weird errors. Changing the opcodes
will make them fail right away. This is just a precaution, there no
upstream users of these interfaces yet and the only user is Android, but
we don't expect anyone trying to run android userspace and all it
dependencies on top of upstream kernels.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Greg Hackmann <ghackmann@google.com>
Acked-by: Rob Clark <robdclark@gmail.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:03:49 -07:00
Leo Sperling b5b7fe8666 staging: android: Fix grammar error in Kconfig file
Remove the "s" from kills so that the help message is easier to understand

Signed-off-by: Leo Sperling <leosperling97@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 17:03:07 -07:00
Jes Sorensen af4981fc59 staging: rtl8723au: Add warning about this driver being deprecated
This driver is deprecated and superseded by rtl8xxxu. It will be
removed in a future kernel release.

Add a warning to Kconfig and at device init time to notify users and
allow them time to switch over.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29 10:38:23 -07:00
H Hartley Sweeten 6c3b78aa6e staging: comedi: mite: don't expose CHSR_* bit defines
These bit defines are only used in the mite driver. Move them so they
are not needlessly exposed.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:19:49 -07:00
H Hartley Sweeten 0c912e5c9c staging: comedi: mite: return void from mite_ack_linkc()
Currently this function returns the value read from the mite channel
status register. None of the callers use, or need, the returned value.

For aesthetics, change the return to void.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:19:49 -07:00
H Hartley Sweeten f7d005c33c staging: comedi: mite: make mite_ack_linkc() handle mite_sync_dma()
The mite dma is always synced on a LINKC status. Some of the mite users
sync the dma regadless of the status.

Add a 'sync' parameter to mite_ack_linkc() to force a dma sync. Then do
the dma sync as needed.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:19:49 -07:00
H Hartley Sweeten 3da088cae2 staging: comedi: ni_mio_common: handle_a_interrupt() does not need ai_mite_status
This function only handles the analog input interrupts, the dma was already
handled.

Remove the unecessary parameter and fix ni_E_interrupts() so that the comedi
events are properly handled.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:19:49 -07:00
H Hartley Sweeten 7101711ee4 staging: comedi: ni_mio_common: simplify AI LINKC handling
Simplfy the LINKC handing for the analog input dma by moving it into
the main interrupt handler. This function already hold the spinlock
mite_channel_lock so call mite_sync_dma() directly instead of using
the helper function.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:19:49 -07:00
H Hartley Sweeten ba5c0da886 staging: comedi: ni_mio_common: fix interrupt handler for dev->read_subdev
There may not be a dev->read_subdev, i.e. an analog input subdevice, that
supports async commands. If it doesn't exist the interrupt/dma will never
be enabled.  Fix ni_E_interrupt() so that the analog input subdevice is
only handled if it exists.

This also fixes minor NULL dereference issue in handle_a_interrupt().
If the dev->read_subdev is NULL the comedi_async pointer (s->async) will
not be allocated by the device postconfig so there is no way to get a
valid comedi_cmd (&s->async->cmd).

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:19:49 -07:00
H Hartley Sweeten 4b2d73898f staging: comedi: ni_mio_common: handle_b_interrupt() does not need ao_mite_status
This function only handles the analog input interrupts, the dma was already
handled.

Remove the unecessary parameter and fix ni_E_interrupts() so that the comedi
events are properly handled.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:19:49 -07:00
H Hartley Sweeten 7ef1745f29 staging: comedi: ni_mio_common: fix interrupt handler for dev->write_subdev
There may not be a dev->write_subdev, i.e. an analog output subdevice, that
supports async commands. If it doesn't exist the interrupt/dma will never
be enabled.  Fix ni_E_interrupt() so that the analog output subdevice is
only handled if it exists.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:19:49 -07:00
H Hartley Sweeten 72639a1670 staging: comedi: ni_mio_common: absorb mite_handle_b_linkc()
Simplfy the LINKC handing by removing the helper function and moving
the mite_sync_dma() into the main interrupt handler.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:19:49 -07:00
H Hartley Sweeten cc38da7287 staging: comedi: mite: check for transfer errors in mite_ack_linkc()
Currently only some of the users of mite dma check for transfer errors.

The ni_mio_common code does the check for the analog input and analog
output subdevices. The m-series digital I/O subdevice and the counter
subdevices (handled by ni_tiocmd) do not check.

The ni_pcidio driver checks for the digital input subdevice.

The ni_660x driver counter subdevices (handled by ni_tiocmd) also do
not check.

Move the transfer error checking into mite_ack_linkc() so that the
drivers that use mite don't have to deal with it. This also makes
sure that all the subdevices that use mite for dma will cancel the
async command if a transfer error is detected.

Simplfy the transfer error check by just checking the CHSR_XFERR bit.
This bit will be set if one or more transfer processes terminated with
an error. The actual error is determined by the LERR, MERR, and DERR
bits.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:19:49 -07:00
H Hartley Sweeten 21e871fef7 staging: comedi: mite: cleanup remaining mite register/bits
For aesthetics, convert the register/bit enums into defines and
use the BIT() macro to define the bits.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten 7024cc88bf staging: comedi: mite: remove BUG_ON() in MITE_IODWBSR_1_WSIZE_bits()
Prior to calling this function pci_ioremap_bar() is called. If the
pci_resource_len(), i.e. the 'size', was 0 the ioremap would fail
so this function would never be called. So the first BUG_ON() can
never occur.

The 'order' returned by ilog2() will always be > 0 so the second
BUG_ON() will also never occur.

Remove the unnecessary BUG_ON() checks and tidy up the function.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten 43d667243c staging: comedi: mite: document the mite_struct spinlock_t
Add a comment to fix the checkpatch.pl issue:
CHECK: spinlock_t definition without comment

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten 268bc9cd3a staging: comedi: mite: rename CamelCase CHSR bit enums
Rename the CamelCase symbols to fix the checkpatch.pl issues.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten 51d430056c staging: comedi: mite: introduce mite_sync_dma()
The struct mite_channel 'dir' member specifies if the dma is input
or output. Wrap the mite_sync_input_dma() and mite_sync_output_dma()
functions with a single mite_sync_dma() so that the drivers don't
have to worry about the sync direction.

The functions that actually sync the input/output dma currently return
-1 if an overflow/underrun is detected otherwise they return 0. If an
overflow/underrun is detected the async->event COMEDI_CB_OVERFLOW is
also set.

The callers never check the return value anyway so just make the
functions return void. The async->event can be checked if necessary
to detect any errors.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten 33b0b6913d staging: comedi: mite: don't expose unnecessary register/bit info
Most of the mite registers are only accessed by the mite driver.
There is no reason to expose the register/bit info. Remove this
info from the header.

For aesthetics, convert the bit info enums into defines and use
the BIT() macro to define them. Tidy up the inline functions for
the retry limit and drq reqs bits in the config registers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten 4d88096df9 staging: comedi: mite: introduce mite_ack_linkc()
Introduce a helper function to handle the ack of a LINKC interrupt.
Tidy up the drivers that use the new helper.

The extra check for CHSR_INT in the ni_pcidio driver is not necessary.
This bit will be set if any of the interrupt sources, including CHSR_LINKC,
have generated an interrupt. Remove the extra check.

The mite_get_status() function is now only used by the mite driver.
Make it static and remove the export.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten 96f3153000 staging: comedi: mite: don't expose mite_dma_reset()
This function is only called by the mite driver. Remove the inline
function from the header and make it static in the driver.

Use the function in mite_prep_dma() instead of duplicating the code.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten eecbadef12 staging: comedi: ni_pcidio: remove redundant mite disarm/reset
The mite_release_channel() will disarm and reset the mite channel.
Remove the redundant calls in ni_pcidio_release_di_mite_channel().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten ef81f55b07 staging: comedi: mite: remove mite_struct member 'daq_phys_addr'
This member of mite_struct is only used to map the mite I/O window.
For aesthetics, remove it and use a local variable instead.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten 0db6624ae0 staging: comedi: mite: remove mite_struct member 'mite_phys_addr'
This member of mite_struct is set but never used. Just remove it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten 0d9bfc2412 staging: comedi: mite: don't export internal functions
The functions that get the number of bytes written to and read from
memory are only used internally by the mite driver when syncing the
dma channel. Make them static and remove the exports.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten a2a9d1b4c5 staging: comedi: mite: remove mite_dma_tcr()
This exported function is not used by any of the comedi drivers. The
only call point in mite.c is commented out. Remove the unused function
and the export.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten ace613ee7c staging: comedi: mite: remove TOP_OF_PAGE() macro
This macro is not used. Remove it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten aac00ea22c staging: comedi: mite: Prefer 'unsigned int' to bare use of 'unsigned'
Fix the checkpatch.pl issues.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:18:51 -07:00
H Hartley Sweeten 6f7fa70464 staging: comedi: ni_mio_common: introduce NI_STC_DMA_CHAN_SEL()
The inline helper ni_stc_dma_channel_select_bitfield() returns the
bits needed to select a MITE channel to use for DMA. The MITE code
is setup to handle up to 8 channels but in reality only channels 0
to 3 are used by most of the drivers. The PCI-6032E and PCI-6033E
boards can also use channels 4 and 5.

For aesthetics, convert this inline function into a macro and
remove the BUG() which will never occur.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten bbd962206c staging: comedi: mite.h: rename CHSR_LxERR_mask
Fix the checkpatch.pl issue:
CHECK: Avoid CamelCase: <CHSR_LxERR_mask>

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten b24a3ecd46 staging: comedi: ni_mio_common: fix CamelCase in ni_serial_hw_readwrite8()
Fix the checkpatch.pl issue:
CHECK: Avoid CamelCase: <Error>

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten 68556ffc95 staging: comedi: ni_mio_common: remove 'fudge_factor_80_to_20Mhz'
For aesthetics, remove this local variable to fix the checkpatch.pl issue:
CHECK: Avoid CamelCase: <fudge_factor_80_to_20Mhz>

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten 8a5b817ff7 staging: comedi: ni_mio_common: usleep_range is preferred over udelay
Fix the checkpatch.pl issues.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten 2e2f7b7037 staging: comedi: ni_mio_common: tidy up ni_gpct_write_register()
The 'bits' value passed to this function is properly set by the callers
so the BUG_ON() can never occur when writing to the NITIO_G[01]_INT_ENA
and NITIO_G01_RESET registers. Remove the BUG_ON() checks.

For aesthetic, also remove the static const variables. They don't add
any additional clarity.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten 1392dccbbd staging: comedi: ni_mio_common: tidy up AO scan begin
The (*do_cmdtest) validates that the cmd->scan_begin_src will only be
TRIG_TIMER or TRIG_EXT. Refactor ni_ao_cmd_set_update() and remove the
BUG() which can never occur.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten 55f9e7d9d3 staging: comedi: ni_mio_common: tidy up AO trigger selection
The AO subdevice (*cancel), ni_ao_reset(), always sets the private
data 'ao_trigger_select' to 0. So when a command is started the
'trigsel' value in ni_ao_cmd_set_trigger() will always start as 0.
Remove the unnecessary member from the private data.

The (*do_cmdtest) validates that the cmd->start_src will only be
TRIG_INT or TRIG_EXT. Refactor ni_ao_cmd_set_trigger() and remove
the BUG() which can never occur.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten 0b235d5ce4 staging: comedi: ni_mio_common: convert NI_GPCT_SUBDEV to a macro
The 'counter_index' is always in range (0 to < NUM_GPCT, which is 2).

For aesthetics, convert this inline function into a macro and remove
the BUG() which can never occur.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten 73894987d6 staging: comedi: ni_mio_common: fix logical continuations
Fix the checkpatch.pl issues:
CHECK: Logical continuations should be on the previous line

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten beb1cc1b02 staging: comedi: ni_mio_common: multiple assignments should be avoided
Fix the checkpatch.pl issues.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten b6a0e5b32a staging: comedi: ni_mio_common: fix lines over 80 characters
Fix the checkpatch.pl issues.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:17:28 -07:00
H Hartley Sweeten bd474a02d3 staging: comedi: ni_mio_common: tidy up block comments
Fix the checkpatch.pl issues.
WARNING: Block comments use * on subsequent lines

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-28 22:17:28 -07:00