platform/kernel/linux-rpi.git
6 years agostaging: rtl8192e: Correct indentation of switch statements - coding style
John Whitmore [Sat, 26 May 2018 08:10:17 +0000 (09:10 +0100)]
staging: rtl8192e: Correct indentation of switch statements - coding style

Two switch statements had wrong indentation of 'case' options

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192e: correct position of '{', '}', '(' and ')' - coding style
John Whitmore [Sat, 26 May 2018 08:10:16 +0000 (09:10 +0100)]
staging: rtl8192e: correct position of '{', '}', '(' and ')' - coding style

Correct the coding style of parenthesis and braces in various code blocks

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192e: Add spaces where required by coding standard
John Whitmore [Sat, 26 May 2018 08:10:15 +0000 (09:10 +0100)]
staging: rtl8192e: Add spaces where required by coding standard

There were numerous coding syle errors in this file where spaces were required
around operators.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: get rid of ldebugfs_remove()
Greg Kroah-Hartman [Tue, 29 May 2018 14:29:47 +0000 (16:29 +0200)]
staging: lustre: get rid of ldebugfs_remove()

It was just a dumb wrapper around debugfs_remove_recursive() so just
call the function properly.  Also, there is no need to set the dentry to
NULL, it's gone, who cares about it anymore...

Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: James Simmons <jsimmons@infradead.org>
Cc: NeilBrown <neilb@suse.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Roman Storozhenko <romeusmeister@gmail.com>
Cc: Aastha Gupta <aastha.gupta4104@gmail.com>
Cc: Ben Evans <bevans@cray.com>
Cc: Quentin Bouget <quentin.bouget@cea.fr>
Cc: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: Arushi Singhal <arushisinghal19971997@gmail.com>
Cc: Patrick Farrell <paf@cray.com>
Cc: Aliaksei Karaliou <akaraliou.dev@gmail.com>
Cc: Mathias Rav <mathiasrav@gmail.com>
Cc: Andriy Skulysh <andriy.skulysh@seagate.com>
Cc: Dafna Hirschfeld <dafna3@gmail.com>
Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Cc: Bob Glosman <bob.glossman@intel.com>
Cc: lustre-devel@lists.lustre.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: make ldebugfs_add_vars a void function
Greg Kroah-Hartman [Tue, 29 May 2018 14:29:46 +0000 (16:29 +0200)]
staging: lustre: make ldebugfs_add_vars a void function

The call to ldebugfs_add_vars() can not really fail, so have it just
return nothing, which allows us to clean up a lot of unused error
handling code.

Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: James Simmons <jsimmons@infradead.org>
Cc: NeilBrown <neilb@suse.com>
Cc: Roman Storozhenko <romeusmeister@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Quentin Bouget <quentin.bouget@cea.fr>
Cc: Aastha Gupta <aastha.gupta4104@gmail.com>
Cc: Ben Evans <bevans@cray.com>
Cc: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: Arushi Singhal <arushisinghal19971997@gmail.com>
Cc: Frank Zago <fzago@cray.com>
Cc: Patrick Farrell <paf@cray.com>
Cc: Simo Koskinen <koskisoft@gmail.com>
Cc: Andriy Skulysh <andriy.skulysh@seagate.com>
Cc: "John L. Hammond" <john.hammond@intel.com>
Cc: Mathias Rav <mathiasrav@gmail.com>
Cc: Dafna Hirschfeld <dafna3@gmail.com>
Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Cc: lustre-devel@lists.lustre.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: remove last two users of ldebugfs_register()
Greg Kroah-Hartman [Tue, 29 May 2018 14:29:45 +0000 (16:29 +0200)]
staging: lustre: remove last two users of ldebugfs_register()

ldebugfs_register() is just a call to debugfs_create_dir() and
ldebugfs_add_vars() if the list option is set.  Fix up the last two
users of this function to just call these two functions instead, and
delete the now unused ldebugfs_register() call.

This ends up cleaning up more code and making things smaller, always a
good thing.

Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: James Simmons <jsimmons@infradead.org>
Cc: NeilBrown <neilb@suse.com>
Cc: Ben Evans <bevans@cray.com>
Cc: Quentin Bouget <quentin.bouget@cea.fr>
Cc: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: Arushi Singhal <arushisinghal19971997@gmail.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>
Cc: Mathias Rav <mathiasrav@gmail.com>
Cc: Dafna Hirschfeld <dafna3@gmail.com>
Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Cc: Patrick Farrell <paf@cray.com>
Cc: Nadav Amit <namit@vmware.com>
Cc: lustre-devel@lists.lustre.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: unwrap some ldebugfs_register() calls
Greg Kroah-Hartman [Tue, 29 May 2018 14:29:44 +0000 (16:29 +0200)]
staging: lustre: unwrap some ldebugfs_register() calls

When the third option (list) to ldebugfs_register() is NULL, it's the
same as just calling debugfs_create_dir().  So unwind this and call
debugfs_create_dir() directly.

This ends up saving lots of code as we do not need to do any error
checking of the return value (because it does not matter).

The ldebugfs_register() call will be removed in a later patch when it is
fully removed, right now there are 2 outstanding users of it in the
tree.

Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: James Simmons <jsimmons@infradead.org>
Cc: NeilBrown <neilb@suse.com>
Cc: Aastha Gupta <aastha.gupta4104@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Quentin Bouget <quentin.bouget@cea.fr>
Cc: Patrick Farrell <paf@cray.com>
Cc: Aliaksei Karaliou <akaraliou.dev@gmail.com>
Cc: "John L. Hammond" <john.hammond@intel.com>
Cc: Mathias Rav <mathiasrav@gmail.com>
Cc: Andriy Skulysh <andriy.skulysh@seagate.com>
Cc: Ben Evans <bevans@cray.com>
Cc: Bob Glosman <bob.glossman@intel.com>
Cc: lustre-devel@lists.lustre.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: remove ldebugfs_obd_seq_create() wrapper function
Greg Kroah-Hartman [Tue, 29 May 2018 14:29:43 +0000 (16:29 +0200)]
staging: lustre: remove ldebugfs_obd_seq_create() wrapper function

It was just calling debugfs_create_file() so unwind things and just call
the real function instead.  This ends up saving a number of lines as
there was never any error handling happening anyway, so that all can be
removed as well.

Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: James Simmons <jsimmons@infradead.org>
Cc: Quentin Bouget <quentin.bouget@cea.fr>
Cc: Ben Evans <bevans@cray.com>
Cc: NeilBrown <neilb@suse.com>
Cc: Arushi Singhal <arushisinghal19971997@gmail.com>
Cc: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>
Cc: Dafna Hirschfeld <dafna3@gmail.com>
Cc: Mathias Rav <mathiasrav@gmail.com>
Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Cc: Roman Storozhenko <romeusmeister@gmail.com>
Cc: lustre-devel@lists.lustre.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: remove ldebugfs_seq_create() wrapper function
Greg Kroah-Hartman [Tue, 29 May 2018 14:29:42 +0000 (16:29 +0200)]
staging: lustre: remove ldebugfs_seq_create() wrapper function

It was just calling debugfs_create_file() so unwind things and just call
the real function instead.  This ends up saving a number of lines as
there was never any error handling happening anyway, so that all can be
removed as well.

Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: James Simmons <jsimmons@infradead.org>
Cc: Quentin Bouget <quentin.bouget@cea.fr>
Cc: NeilBrown <neilb@suse.com>
Cc: Ben Evans <bevans@cray.com>
Cc: Arushi Singhal <arushisinghal19971997@gmail.com>
Cc: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: "John L. Hammond" <john.hammond@intel.com>
Cc: Vitaly Fertman <vitaly.fertman@seagate.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>
Cc: Dafna Hirschfeld <dafna3@gmail.com>
Cc: Mathias Rav <mathiasrav@gmail.com>
Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Cc: Bob Glosman <bob.glossman@intel.com>
Cc: lustre-devel@lists.lustre.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: remove ldebugfs_register_stats() wrapper function
Greg Kroah-Hartman [Tue, 29 May 2018 14:29:41 +0000 (16:29 +0200)]
staging: lustre: remove ldebugfs_register_stats() wrapper function

It was just calling debugfs_create_file() so unwind things and just call
the real function instead.  This ends up saving a number of lines as
there was never any error handling happening anyway, so that all can be
removed as well.

Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: James Simmons <jsimmons@infradead.org>
Cc: Ben Evans <bevans@cray.com>
Cc: Quentin Bouget <quentin.bouget@cea.fr>
Cc: NeilBrown <neilb@suse.com>
Cc: Arushi Singhal <arushisinghal19971997@gmail.com>
Cc: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: Patrick Farrell <paf@cray.com>
Cc: Aliaksei Karaliou <akaraliou.dev@gmail.com>
Cc: Aastha Gupta <aastha.gupta4104@gmail.com>
Cc: Dafna Hirschfeld <dafna3@gmail.com>
Cc: Mathias Rav <mathiasrav@gmail.com>
Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Cc: Bob Glosman <bob.glossman@intel.com>
Cc: lustre-devel@lists.lustre.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: remove ldebugfs_add_simple() wrapper
Greg Kroah-Hartman [Tue, 29 May 2018 14:29:40 +0000 (16:29 +0200)]
staging: lustre: remove ldebugfs_add_simple() wrapper

It was only being called in one place, and is an unneeded wrapper
function around debugfs_create_file() so just call the real debugfs
function instead.  This ends up cleaning up some unneeded error handling
logic that was never needed as well.

Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: James Simmons <jsimmons@infradead.org>
Cc: Quentin Bouget <quentin.bouget@cea.fr>
Cc: Ben Evans <bevans@cray.com>
Cc: NeilBrown <neilb@suse.com>
Cc: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: Arushi Singhal <arushisinghal19971997@gmail.com>
Cc: Dafna Hirschfeld <dafna3@gmail.com>
Cc: Mathias Rav <mathiasrav@gmail.com>
Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Cc: lustre-devel@lists.lustre.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: no need to check debugfs return values
Greg Kroah-Hartman [Tue, 29 May 2018 14:29:39 +0000 (16:29 +0200)]
staging: lustre: no need to check debugfs return values

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Clean up the lustre core code by not caring about the value of debugfs
calls.  This ends up removing a number of lines of code that are not
needed.

Note, more work is needed to remove the unneeded debugfs wrapper
functions in the future.

Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: James Simmons <jsimmons@infradead.org>
Cc: NeilBrown <neilb@suse.com>
Cc: Ben Evans <bevans@cray.com>
Cc: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: "John L. Hammond" <john.hammond@intel.com>
Cc: Dafna Hirschfeld <dafna3@gmail.com>
Cc: Mathias Rav <mathiasrav@gmail.com>
Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Cc: lustre-devel@lists.lustre.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: unisys: visornic: no need to check debugfs return values
Greg Kroah-Hartman [Tue, 29 May 2018 14:29:37 +0000 (16:29 +0200)]
staging: unisys: visornic: no need to check debugfs return values

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Clean up the visornic driver code by not caring about the value of
debugfs calls.  This ends up removing a number of lines of code that are
not needed.

Cc: David Kershner <david.kershner@unisys.com>
Cc: Tim Sell <timothy.sell@unisys.com>
Cc: David Binder <david.binder@unisys.com>
Cc: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Cc: Charles Daniels <cdaniels@fastmail.com>
Cc: sparmaintainer@unisys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtlwifi: don't check the return value of debugfs_create_file
Greg Kroah-Hartman [Tue, 29 May 2018 14:29:36 +0000 (16:29 +0200)]
staging: rtlwifi: don't check the return value of debugfs_create_file

We never did anything with the return value, and it does not matter if
the call succeeds or not (it's just debugging code), so don't even check
it.

Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Colin Ian King <colin.king@canonical.com>
Cc: "Frank A. Cancio Bello" <frank@generalsoftwareinc.com>
Cc: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: greybus: camera: no need to check debugfs return values
Greg Kroah-Hartman [Tue, 29 May 2018 14:29:35 +0000 (16:29 +0200)]
staging: greybus: camera: no need to check debugfs return values

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Clean up the greybus camera driver by not caring about the value of
debugfs calls.  This ends up removing a number of lines of code that
are not needed.

Cc: Alex Elder <elder@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: greybus-dev@lists.linaro.org
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoStaging:rtl888eu:include Fix CamelCase issue
Janani Sankara Babu [Tue, 29 May 2018 22:02:49 +0000 (18:02 -0400)]
Staging:rtl888eu:include Fix CamelCase issue

This patch is created to solve the CamelCase issue. The members 'IEs'
and 'IELength' of struct wlan_bssid_ex are being modified to 'ie' and
'ie_length' to solve the issue. And the places where these variables
are referenced inside rtl8188eu driver are also changed.

Signed-off-by: Janani Sankara Babu <jananis37@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: include linux/highmem.h when needed
Arnd Bergmann [Wed, 30 May 2018 21:38:48 +0000 (23:38 +0200)]
staging: lustre: include linux/highmem.h when needed

Something in recent linux-next kernels caused linux/highmem.h to
no longer be included implicitly from o2iblnd_cb.c, causing a build
failure:

drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c: In function 'kiblnd_kvaddr_to_page':
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:549:15: error: 'PKMAP_BASE' undeclared (first use in this function); did you mean 'RTM_BASE'?
  if (vaddr >= PKMAP_BASE &&
               ^~~~~~~~~~
               RTM_BASE
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:549:15: note: each undeclared identifier is reported only once for each function it appears in
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c:550:28: error: 'LAST_PKMAP' undeclared (first use in this function); did you mean 'AT_HWCAP'?
      vaddr < (PKMAP_BASE + LAST_PKMAP * PAGE_SIZE)) {
                            ^~~~~~~~~~
                            AT_HWCAP

This adds back an explicit include for the header.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: comedi: comedi_usb.h: SPDX License Identifier is added in the first line
Bhanusree Pola [Tue, 29 May 2018 18:09:32 +0000 (23:39 +0530)]
staging: comedi: comedi_usb.h: SPDX License Identifier is added in the first line

SPDX License Identifier is added in form of a comment.

Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-pci: Fix line size exceeding 80 columns.
Sankalp Negi [Sun, 27 May 2018 13:12:15 +0000 (18:42 +0530)]
staging: mt7621-pci: Fix line size exceeding 80 columns.

This patch fixes the checkpatch.pl warning:

WARNING: line over 80 characters

Signed-off-by: Sankalp Negi <sankalpnegi2310@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtlwifi: use single_open and single_release properly
Tiezhu Yang [Sat, 26 May 2018 14:46:22 +0000 (22:46 +0800)]
staging: rtlwifi: use single_open and single_release properly

single_open() returns -ENOMEM when malloc failed, so the caller function
rtl_debugfs_open_rw() should not always return 0. In addition, when using
single_open(), we should use single_release() instead of seq_release() in
the file_operations structure to avoid a memory leak.

Signed-off-by: Tiezhu Yang <kernelpatch@126.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wlan-ng: remove unused declarations from p80211types.h
Tim Collier [Fri, 25 May 2018 17:40:40 +0000 (18:40 +0100)]
staging: wlan-ng: remove unused declarations from p80211types.h

A number of extern struct declarations in p80211types.h were causing
checkpatch warnings: "extern prototypes should be avoided in .h files"
and "function definition argument 'xxxxxx' should also have an
identifier name".

This appears to be a result of using a macro to form the declarations
and checkpatch consequently misinterpreting the declarations as
function prototypes.

On checking, the declarations have no corresponding definition in the
driver and are not used, so they are removed along with the macro used
to construct them, which is not needed elsewhere. After this change,
checkpatch reports that p80211types.h has no obvious issues.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: mdc: excessive memory consumption by the xattr cache
Andrew Perepechko [Tue, 29 May 2018 14:21:44 +0000 (10:21 -0400)]
staging: lustre: mdc: excessive memory consumption by the xattr cache

The refill operation of the xattr cache does not know the
reply size in advance, so it makes a guess based on
the maxeasize value returned by the MDS.

In practice, it allocates 16 KiB for the common case and
4 MiB for the large xattr case. However, a typical reply
is just a few hundred bytes.

If we follow the conservative approach, we can prepare a
single memory page for the reply. It is large enough for
any reasonable xattr set and, at the same time, it does
not require multiple page memory reclaim, which can be
costly.

If, for a specific file, the reply is larger than a single
page, the client is prepared to handle that and will fall back
to non-cached xattr code. Indeed, if this happens often and
xattrs are often used to store large values, it makes sense to
disable the xattr cache at all since it wasn't designed for
such [mis]use.

Signed-off-by: Andrew Perepechko <c17827@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9417
Reviewed-on: https://review.whamcloud.com/26887
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: acl: increase ACL entries limitation
Fan Yong [Tue, 29 May 2018 14:21:43 +0000 (10:21 -0400)]
staging: lustre: acl: increase ACL entries limitation

Originally, the limitation of ACL entries is 32, that is not
enough for some use cases. In fact, restricting ACL entries
count is mainly for preparing the RPC reply buffer to receive
the ACL data. So we cannot make the ACL entries count to be
unlimited. But we can enlarge the RPC reply buffer to hold
more ACL entries. On the other hand, MDT backend filesystem
has its own EA size limitation. For example, for ldiskfs case,
if large EA enable, then the max ACL size is 1048492 bytes;
otherwise, it is 4012 bytes. For ZFS backend, such value is
32768 bytes. With such hard limitation, we can calculate how
many ACL entries we can have at most. This patch increases
the RPC reply buffer to match such hard limitation. For old
client, to avoid buffer overflow because of large ACL data
(more than 32 ACL entries), the MDT will forbid the old client
to access the file with large ACL data. As for how to know
whether it is old client or new, a new connection flag
OBD_CONNECT_LARGE_ACL is used for that.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7473
Reviewed-on: https://review.whamcloud.com/19790
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: llite: remove unused parameters from md_{get, set}xattr()
John L. Hammond [Tue, 29 May 2018 14:21:42 +0000 (10:21 -0400)]
staging: lustre: llite: remove unused parameters from md_{get, set}xattr()

md_getxattr() and md_setxattr() each have several unused
parameters. Remove them and improve the naming or remaining
parameters.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-10792
Reviewed-on: https://review.whamcloud.com/
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: llite: add support set_acl method in inode operations
Dmitry Eremin [Tue, 29 May 2018 14:21:41 +0000 (10:21 -0400)]
staging: lustre: llite: add support set_acl method in inode operations

Linux kernel v3.14 adds set_acl method to inode operations.
This patch adds support to Lustre for proper acl management.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9183
Reviewed-on: https://review.whamcloud.com/25965
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-10541
Reviewed-on: https://review.whamcloud.com/31588
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-10926
Reviewed-on: https://review.whamcloud.com/32045
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: llite: create acl.c file
James Simmons [Tue, 29 May 2018 14:21:40 +0000 (10:21 -0400)]
staging: lustre: llite: create acl.c file

Move ll_get_acl() to its own file acl.c just like all the other
linux file systems do.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: fix more build errors in errno.c
Greg Kroah-Hartman [Sat, 26 May 2018 09:34:25 +0000 (11:34 +0200)]
staging: lustre: fix more build errors in errno.c

And we need even more .h files to be included to build this file.  So
add kernel.h and module.h, and hopefully that's enough...

Reported-by: kbuild test robot <lkp@intel.com>
Fixes: 0922c0084b91 ("staging: lustre: remove libcfs_all from ptlrpc")
Cc: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: fix build error in errno.c
Greg Kroah-Hartman [Sat, 26 May 2018 07:01:03 +0000 (09:01 +0200)]
staging: lustre: fix build error in errno.c

Turns out we need some more .h files to build properly on all arches.
Specifically errno.h for this file.

Reported-by: kbuild test robot <lkp@intel.com>
Fixes: 0922c0084b91 ("staging: lustre: remove libcfs_all from ptlrpc")
Cc: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: fix build error in mdc_request.c
Greg Kroah-Hartman [Sat, 26 May 2018 06:57:25 +0000 (08:57 +0200)]
staging: lustre: fix build error in mdc_request.c

Turns out we need some more .h files to build properly on all arches.
Specifically prefetch.h for this file.

Reported-by: kbuild test robot <lkp@intel.com>
Fixes: 73d65c8d1a85 ("staging: lustre: remove libcfs_all.h from lustre/include/*.h")
Cc: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-gpio: update TODO file
Sergio Paracuellos [Sun, 20 May 2018 13:00:27 +0000 (15:00 +0200)]
staging: mt7621-gpio: update TODO file

update TODO file accordly to last changes.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-gpio: use MTK_BANK_WIDTH instead of magic number
Sergio Paracuellos [Sun, 20 May 2018 13:00:26 +0000 (15:00 +0200)]
staging: mt7621-gpio: use MTK_BANK_WIDTH instead of magic number

There are some places where magic number '32' is being used to get
the gpio bank. There already exist a definition MTK_BANK_WIDTH
with this value, so just use it instead.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-gpio: use ternary operator in return in mediatek_gpio_get_direction
Sergio Paracuellos [Sun, 20 May 2018 13:00:25 +0000 (15:00 +0200)]
staging: mt7621-gpio: use ternary operator in return in mediatek_gpio_get_direction

This commits replaces if statement and two returns in favour
of a only one return using a ternary operator.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-gpio: avoid devm_kzalloc() hidden inside declarations and refactor...
Sergio Paracuellos [Sun, 20 May 2018 13:00:24 +0000 (15:00 +0200)]
staging: mt7621-gpio: avoid devm_kzalloc() hidden inside declarations and refactor function a bit

Driver probe function includes an allocation using devm_kzalloc
which is "hidden" a bit inside the declarations. Extract this
to a better place to increase readability. Also because we are
allocating zeroed memory 'memset' statement is not needed at all.
Condition for checking for a valid gpio id is wrong and it should
be greater or equal instead of only greater so update to be the
good one.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-gpio: dt-bindings: add interrupt nodes to bindings doc
Sergio Paracuellos [Sun, 20 May 2018 13:00:23 +0000 (15:00 +0200)]
staging: mt7621-gpio: dt-bindings: add interrupt nodes to bindings doc

Interrupt related stuff for gpio controller in mt7621 was missing
in device tree documentation. Add it to complete documentation for
this driver.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-dts: add interrupt device tree nodes for the gpio controller
Sergio Paracuellos [Sun, 20 May 2018 13:00:22 +0000 (15:00 +0200)]
staging: mt7621-dts: add interrupt device tree nodes for the gpio controller

The GPIO controller of mt7621 can receive interrupts on any
of the GPIOs, either edge or level. It then interrupts the CPU using
GIC INT12. Update device tree accordly.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-gpio: avoid use of globals and use platform_data instead
Sergio Paracuellos [Sun, 20 May 2018 13:00:21 +0000 (15:00 +0200)]
staging: mt7621-gpio: avoid use of globals and use platform_data instead

Gpio driver have a some globals which can be avoided just
using platform_data in a proper form. This commit adds a new
struct mtk_data which includes all of those globals setting them
using platform_set_drvdata and devm_gpiochip_add_data functions.
With this properly set we are able to retrieve driver data along
the code using kernel api's so globals are not needed anymore.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-gpio: replace 'mtk' to use correct one 'mediatek'
Sergio Paracuellos [Sun, 20 May 2018 13:00:20 +0000 (15:00 +0200)]
staging: mt7621-gpio: replace 'mtk' to use correct one 'mediatek'

Gpio driver is using mtk and there is already 'mediatek' binding
defined for this maker. Update driver to use it instead the custom
one 'mtk'.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-dts: update gpios related entries to use 'mediatek'
Sergio Paracuellos [Sun, 20 May 2018 13:00:19 +0000 (15:00 +0200)]
staging: mt7621-dts: update gpios related entries to use 'mediatek'

Gpio driver for mt7621 is using 'mtk' as binding but in the kernel
is already defined one for this maker which is 'mediatek'. Update
device tree to use the correct one.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-gpio: dt-bindings: add documentation for mt7621-gpio
Sergio Paracuellos [Sun, 20 May 2018 13:00:18 +0000 (15:00 +0200)]
staging: mt7621-gpio: dt-bindings: add documentation for mt7621-gpio

This commit add missing dt bindings documentation for mt7621-gpio
driver. There is some missing stuff here about interrupts with is
not also being used in the mt7621.dtsi file. So just include in
staging a incomplete version before moving this to kernel's dt-bindings
place.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8723bs: Fix grammar error in comment.
Quytelda Kahja [Tue, 22 May 2018 07:26:37 +0000 (00:26 -0700)]
staging: rtl8723bs: Fix grammar error in comment.

Fix a grammatical error in the comment describing 'struct
rt_firmware_hdr'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8723bs: Fix camel-case in 'struct rt_firmware_hdr'.
Quytelda Kahja [Tue, 22 May 2018 07:26:36 +0000 (00:26 -0700)]
staging: rtl8723bs: Fix camel-case in 'struct rt_firmware_hdr'.

Replace camel-case member names with snake-case names per the linux
kernel coding style guidelines.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8723bs: Fix spelling/grammar errors in comment.
Quytelda Kahja [Tue, 22 May 2018 07:26:35 +0000 (00:26 -0700)]
staging: rtl8723bs: Fix spelling/grammar errors in comment.

Fix the spelling/grammar errors in the comment block describing
the 'Function' member of 'struct rt_firmware_hdr'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8723bs: Fix camel-case in 'struct rt_firmware'.
Quytelda Kahja [Tue, 22 May 2018 07:26:34 +0000 (00:26 -0700)]
staging: rtl8723bs: Fix camel-case in 'struct rt_firmware'.

Change the members of 'struct rt_firmware' to be snake case instead
of camel-case, per the kernel coding style guide.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8723bs: Fix camel-case in IS_FW_HEADER_EXIST_8723B().
Quytelda Kahja [Tue, 22 May 2018 07:26:33 +0000 (00:26 -0700)]
staging: rtl8723bs: Fix camel-case in IS_FW_HEADER_EXIST_8723B().

Change the parameter of the macro to the snake case 'fw_hdr' instead
of '_pFwHdr'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8723bs: Clean up whitespace in 'rtl8723_hal.h'.
Quytelda Kahja [Tue, 22 May 2018 07:26:32 +0000 (00:26 -0700)]
staging: rtl8723bs: Clean up whitespace in 'rtl8723_hal.h'.

Make alignment and whitespace more consistent within the file
'rtl8723_hal.h' and with the kernel coding style guidelines.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8723bs: Rename 'Hal8723BPhyCfg.h' using snake case.
Quytelda Kahja [Tue, 22 May 2018 07:26:31 +0000 (00:26 -0700)]
staging: rtl8723bs: Rename 'Hal8723BPhyCfg.h' using snake case.

Camel-case is discouraged in the linux kernel coding style.  Rename
this header file using snake case instead.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8723bs: Rename 'Hal8723bPhyReg.h' using snake case.
Quytelda Kahja [Tue, 22 May 2018 07:26:30 +0000 (00:26 -0700)]
staging: rtl8723bs: Rename 'Hal8723bPhyReg.h' using snake case.

Camel-case is discouraged in the linux kernel coding style.  Rename
this header using snake case instead.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8723bs: Rename 'Hal8723BPwrSeq.{c, h}' to 'hal_pwr_seq.*'.
Quytelda Kahja [Tue, 22 May 2018 07:26:29 +0000 (00:26 -0700)]
staging: rtl8723bs: Rename 'Hal8723BPwrSeq.{c, h}' to 'hal_pwr_seq.*'.

Camel-case naming is discouraged int the linux kernel coding style.
Rename these files using snake case, and update the makefile to use
the new names.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: fsl-dpaa2/rtc: fix PTP dependency
Arnd Bergmann [Fri, 25 May 2018 15:37:12 +0000 (17:37 +0200)]
staging: fsl-dpaa2/rtc: fix PTP dependency

We can't select PTP_1588_CLOCK when posix timers are completely
disabled:

WARNING: unmet direct dependencies detected for PTP_1588_CLOCK
  Depends on [n]: NET [=y] && POSIX_TIMERS [=n]
  Selected by [y]:
  - FSL_DPAA2_PTP_CLOCK [=y] && STAGING [=y] && FSL_DPAA2_ETH [=y]

This adds the necessary dependency.

Fixes: 9bdf43b3d40f ("staging: fsl-dpaa2/rtc: add rtc driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: Avoid overriding rates_no while parsing ies element.
Adham Abozaeid [Thu, 24 May 2018 00:02:14 +0000 (17:02 -0700)]
staging: wilc1000: Avoid overriding rates_no while parsing ies element.

Commit d4b4aaba515a ("staging: wilc1000: fix line over 80 characters in
host_int_parse_join_bss_param()") introduced a bug by not keeping the
rates_no value while parsing ies elements.
It also increments auth_total_cnt as a pointer instead of its reference.

This commit fixes the bug by passing reference to rates_no to
host_int_parse_join_bss_param() and by incrementing reference of
auth_total_cnt

Fixes: d4b4aaba515a (staging: wilc1000: fix line over 80 characters in host_int_parse_join_bss_param())
Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wlan-ng: convert P80211SKB_RXMETA to inline function in p80211conv
Tim Collier [Wed, 23 May 2018 07:30:25 +0000 (08:30 +0100)]
staging: wlan-ng: convert P80211SKB_RXMETA to inline function in p80211conv

To avoid possible issues with repeated reference to the macro argument
as reported by checkpatch, macro P80211SKB_RXMETA is replaced with an
equivalent inline function. The function is named p80211skb_rxmeta to
follow the coding style guidelines; references to the macro are
updated to reference the new function.

This change depends on the similar change for P80211SKB_FRMMETA having
been applied.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wlan-ng: convert P80211SKB_FRMMETA to inline function in p80211conv
Tim Collier [Wed, 23 May 2018 07:30:24 +0000 (08:30 +0100)]
staging: wlan-ng: convert P80211SKB_FRMMETA to inline function in p80211conv

To avoid possible issues with repeated reference to the macro argument
as reported by checkpatch, macro P80211SKB_FRMMETA is replaced with an
equivalent inline function. The function is named p80211skb_frmmeta to
follow the coding style guidelines; references to the macro are
updated to reference the new function.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8192e: rtllib_tx: fix spelling issue.
Davide Spataro [Mon, 21 May 2018 20:48:57 +0000 (22:48 +0200)]
staging: rtl8192e: rtllib_tx: fix spelling issue.

Fix a spelling problem. Issue found by checkpatch.pl.

Signed-off-by: Davide Spataro <davide90.spataro@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: fix spelling mistake: "Illgal" -> "Illegal"
Colin Ian King [Tue, 22 May 2018 08:29:22 +0000 (09:29 +0100)]
staging: mt7621-mmc: fix spelling mistake: "Illgal" -> "Illegal"

Trivial fix to another spelling mistake in N_MSG message text

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: greybus: fix spelling mistake: "Inavlid" -> "Invalid"
Colin Ian King [Tue, 22 May 2018 08:33:42 +0000 (09:33 +0100)]
staging: greybus: fix spelling mistake: "Inavlid" -> "Invalid"

Trivial fix to spelling mistake in dev_err error message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Vaibhav Agarwal <vaibhav.sr@gmail.com>
Acked-by: Mark Greer <mgreer@animalcreek.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtlwifi: fix spelling mistake: "Platfoem" -> "Platform"
Colin Ian King [Tue, 22 May 2018 16:44:24 +0000 (17:44 +0100)]
staging: rtlwifi: fix spelling mistake: "Platfoem" -> "Platform"

Trivial fix to spelling mistake in ODM_RT_TRACE message text

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: fix spelling mistake: "Preamle" -> "Preamble"
Colin Ian King [Tue, 22 May 2018 16:49:05 +0000 (17:49 +0100)]
staging: wilc1000: fix spelling mistake: "Preamle" -> "Preamble"

Trivial fix to spelling mistake in netdev_err error message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: libcfs: add parens around macros args
Ivan Bornyakov [Tue, 22 May 2018 13:34:39 +0000 (16:34 +0300)]
staging: lustre: libcfs: add parens around macros args

One may call 'CFS_FAIL_TIMEOUT(id, secs + 5);' and get unexpected result
after macro substitution, viz., 'secs + 5' will turn into
'secs + 5 * 1000'

Signed-off-by: Ivan Bornyakov <brnkv.i1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: Fix block comments style
Sabin Mihai Rapan [Mon, 21 May 2018 17:34:30 +0000 (19:34 +0200)]
staging: lustre: Fix block comments style

This patch fixes the checkpatch.pl warning:

WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line

Signed-off-by: Sabin Mihai Rapan <sabin.rapan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: Fix "unsigned"->"unsigned int"
Sabin Mihai Rapan [Mon, 21 May 2018 17:34:29 +0000 (19:34 +0200)]
staging: lustre: Fix "unsigned"->"unsigned int"

This patch fixes the checkpatch.pl warning:

WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'

Signed-off-by: Sabin Mihai Rapan <sabin.rapan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: Fix "Possible intergrate"->"Possibly integrate"
Sabin Mihai Rapan [Mon, 21 May 2018 17:34:28 +0000 (19:34 +0200)]
staging: lustre: Fix "Possible intergrate"->"Possibly integrate"

Trivial fix to spelling mistake in TODO file.

Signed-off-by: Sabin Mihai Rapan <sabin.rapan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: Fix "from from"->"from"
Sabin Mihai Rapan [Mon, 21 May 2018 17:34:27 +0000 (19:34 +0200)]
staging: lustre: Fix "from from"->"from"

Trivial fix to spelling mistake in README.txt

Signed-off-by: Sabin Mihai Rapan <sabin.rapan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: remove libcfs_all.h
NeilBrown [Mon, 21 May 2018 04:35:13 +0000 (14:35 +1000)]
staging: lustre: remove libcfs_all.h

In the remaining files that include libcfs_all.h,
replace it with other include files as necessary,
then remove libcfs_all.h

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: move all libcfs_all includes except in lustre/lnet/libcfs/
NeilBrown [Mon, 21 May 2018 04:35:13 +0000 (14:35 +1000)]
staging: lustre: move all libcfs_all includes except in lustre/lnet/libcfs/

Again, most of these are not needed.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: remove remaining libcfs_all.h includes from lustre/lustre
NeilBrown [Mon, 21 May 2018 04:35:13 +0000 (14:35 +1000)]
staging: lustre: remove remaining libcfs_all.h includes from lustre/lustre

Most of these aren't needed, a few can be simplified.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: remove libcfs_all.h from fid, fld, obdclass
NeilBrown [Mon, 21 May 2018 04:35:13 +0000 (14:35 +1000)]
staging: lustre: remove libcfs_all.h from fid, fld, obdclass

None of these files seem to nee libcfs_all.h

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: remove libcfs_all from ptlrpc
NeilBrown [Mon, 21 May 2018 04:35:13 +0000 (14:35 +1000)]
staging: lustre: remove libcfs_all from ptlrpc

Some files didn't need it at all, others just needed
one or two includes.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: remove libcfs_all.h from remaining .h files.
NeilBrown [Mon, 21 May 2018 04:35:13 +0000 (14:35 +1000)]
staging: lustre: remove libcfs_all.h from remaining .h files.

Now no *.h files include libcfs_all.h - only *.c files.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: remove libcfs_all.h from lustre/include/*.h
NeilBrown [Mon, 21 May 2018 04:35:13 +0000 (14:35 +1000)]
staging: lustre: remove libcfs_all.h from lustre/include/*.h

Instead of the catch-all libcfs_all.h, just include the
files actually needed in different places.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: remove libcfs_all.h from includes lustre/lnet
NeilBrown [Mon, 21 May 2018 04:35:13 +0000 (14:35 +1000)]
staging: lustre: remove libcfs_all.h from includes lustre/lnet

Some of these include files didn't need to
include libcfs_all.h.  A couple did so replace with just the
base include files needed.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: remove libcfs_all.h includes from lnet/klnd
NeilBrown [Mon, 21 May 2018 04:35:13 +0000 (14:35 +1000)]
staging: lustre: remove libcfs_all.h includes from lnet/klnd

Other smaller include files are sufficient.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: don't include libcfs.h in lnet/lib-lnet.h
NeilBrown [Mon, 21 May 2018 04:35:13 +0000 (14:35 +1000)]
staging: lustre: don't include libcfs.h in lnet/lib-lnet.h

We want to be more focused in what is included where.
So we remove libcfs.h from where it isn't needed.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: start moving includes out of libcfs.h
NeilBrown [Mon, 21 May 2018 04:35:13 +0000 (14:35 +1000)]
staging: lustre: start moving includes out of libcfs.h

Lots of places include libcfs.h, and it includes lots of other include
files.  Many of these aren't needed in many places.  It is tidier and
better documentation to just include what is needed.

So remove all the includes from libcfs.h and create libcfs_all.h which
contains them.  Then change every reference to libcfs.h to instead
include libcfs_all.h

Next several patches will remove that from various files
in small batches

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: discard libcfs_prim.h
NeilBrown [Mon, 21 May 2018 04:35:13 +0000 (14:35 +1000)]
staging: lustre: discard libcfs_prim.h

This file no longer contains enough content
to justify a separate file.  So merge with
libcfs.h.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: replace memory_presure funcitons by standard interfaces.
NeilBrown [Mon, 21 May 2018 04:35:13 +0000 (14:35 +1000)]
staging: lustre: replace memory_presure funcitons by standard interfaces.

Use memalloc_noreclaim_save() and memalloc_noreclaim_restore(),
and for testing, just directly test the flag in current->flags

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: move RESV_PORT definitions to lnet/lib-lnet.h
NeilBrown [Mon, 21 May 2018 04:35:13 +0000 (14:35 +1000)]
staging: lustre: move RESV_PORT definitions to lnet/lib-lnet.h

These are network related on only used in lnet, so move
to lib-lnet.h

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: move lnet_debug_log_upcall declaration to tracefile.h
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: move lnet_debug_log_upcall declaration to tracefile.h

Both files that use this variable include tracefile.h, and it
seems a more suitable home for the declaration.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: make lnet_debugfs_symlink_def local to libcfs/modules.c
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: make lnet_debugfs_symlink_def local to libcfs/modules.c

This type is only used in libcfs/module.c, so make it local to there.
If any other module ever wanted to add its own symlinks,
it would probably be easiest to export lnet_debugfs_root
and just call debugfs_create_symlink as required.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: clean up __LIBCFS_H macro
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: clean up __LIBCFS_H macro

There is some confusion with names here - make it all uniform.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: replace libcfs_register_ioctl with a blocking notifier_chain
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: replace libcfs_register_ioctl with a blocking notifier_chain

libcfs allows other modules to register handlers for ioctls.
The implementation it uses for this is nearly identical to a
blocking notifier chain, so change to use that.

The biggest difference is that the return value from notifier has a
defined format, where libcfs_register_ioctl uses -EINVAL to mean
"continue".  This requires a little bit of conversion.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: discard cfs_block_sigsinv()
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: discard cfs_block_sigsinv()

cfs_block_sigsinv() and cfs_restore_sigs() are simple
wrappers which save a couple of line of code and
hurt readability for people not familiar with them.
They aren't used often enough to be worthwhile,
so discard them and open-code the functionality.

The sigorsets() call isn't needed as or-ing with current->blocked is
exactly what sigprocmask(SIG_BLOCK) does.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: move LERRCHKSUM() to libcfs_debug.h
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: move LERRCHKSUM() to libcfs_debug.h

This macro is only used for debug messages, so use
it to the debug code.
Also improve the documentation slightly.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: discard CFS_TICK
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: discard CFS_TICK

This undocumented macro seems to represent "a small amount of time".
Sometimes it is used as-is, some times it is multiplied by 5 for no
obvious reason.
It does not appear that there is any connection between the different
places it is used - they all just want a short period for different
purposes and of different durarions.

So discard CFS_TICK and lets each use-site just use whatever number
of jiffies seems appropriate in that case.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: discard LOWEST_BIT_SET()
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: discard LOWEST_BIT_SET()

This macro is only used once to test if a value is
a power of two.  So use is_power_of_2() instead and
discard the macro.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: discard cfs_cap_t, use kernel_cap_t
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: discard cfs_cap_t, use kernel_cap_t

lustre only sends 32bits of capabilities in on-the-wire RPC calls.
It current strips off higher bits and uses a 32bit cfs_cap_t
throughout.
Though there is a small memory cost, it is cleaner to use
kernel_cap_t throughout and only truncate when marshalling
data for RPC calls.

So this patch replaces cfs_cap_t with kernel_cap_t throughout,
and where a cfs_cap_t was previous stored in a __u32, we now
store cap.cap[0] instead.

With this, we can remove include/linux/libcfs/curproc.h

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: simplify capability dropping.
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: simplify capability dropping.

Lustre has a 'squash credentials' concept similar to the "anon_uid"
for nfsd.  When accessing a file with squashed credentials, we
need to also drop capabilities.
Linux has cap_drop_fs_set() and cap_drop_nfsd_set().  Rather than
taking a completely different approach, this patch changes lustre
to use this same cap_drop_*_set() approach.

With this change we also drop CAP_MKNOD and CAP_MAC_OVERRIDE
which are probably appropriate, and don't drop
CAP_SYS_ADMIN or CAP_SYS_BOOT which should be irrelevant for
file permission checking

Calling both cap_drop_*_set() seems a bit clumsy, but gets
the job done.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: remove current_pid() and current_comm()
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: remove current_pid() and current_comm()

Just use current->pid and current->comm directly, instead
of having wrappers.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: remove conditional compilation from libcfs_cpu.c
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: remove conditional compilation from libcfs_cpu.c

libcfs_cpu.c manages CPU partitions.  In the !CONFIG_SMP case, most
of this disappears and 'static inline's from libcfs_cpu.h are used.
However we still allocate a 'struct cfs_cpt_table' and keep some
dummy data in it.  This is a bit pointless.

This patch removes all the !CONFIG_SMP code from libcfs_cpu.c and
conditionally compiles the whole file only when CONFIG_SMP.
We no longer allocate a 'struct cfs_cpt_table' on !CONFIG_SMP,
and don't even declare a structure.  The name "cfs_cpt_tab"
becomes always "NULL", which allows some code to be optimized away.

This means that cfs_cpt_tab can sometimes be NULL, so we need to
discard the assertion that it isn't.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: rename cfs_cpt_table to cfs_cpt_tab
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: rename cfs_cpt_table to cfs_cpt_tab

The variable "cfs_cpt_table" has the same name as
the structure "struct cfs_cpt_table".
This makes it hard to use #define to make one disappear
on a uni-processor build, but keep the other.
So rename the variable to cfs_cpt_tab.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: move files out of lustre/lnet/libcfs/linux/
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: move files out of lustre/lnet/libcfs/linux/

There is no longer any value in having this separate
subdirectory, so promote the files in it.
Also tidy the Makefile a little to use the common "*-obj-y"
macro name.  This will allow individual files to be conditionally
compiled.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: refactor libcfs initialization.
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: refactor libcfs initialization.

Many lustre modules depend on libcfs having initialized
properly, but do not explicit check that it did.
When lustre is built as discrete modules, this does not
cause a problem because if the libcfs module fails
initialization, the other modules don't even get loaded.

When lustre is compiled into the kernel, all module_init()
routines get run, so they need to check the required initialization
succeeded.

This patch splits out the initialization of libcfs into a new
libcfs_setup(), and has all modules call that.

The misc_register() call is kept separate as it does not allocate any
resources and if it fails, it fails hard - no point in retrying.
Other set-up allocates resources and so is best delayed until they
are needed, and can be worth retrying.

Ideally, the initialization would happen at mount time (or similar)
rather than at load time.  Doing this requires each module to
check dependencies when they are activated rather than when
they are loaded.  Achieving that is a much larger job that would
have to progress in stages.

For now, this change ensures that if some initialization in libcfs
fails, other modules will fail-safe.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: osc: tidy up osc_init()
NeilBrown [Mon, 21 May 2018 04:35:12 +0000 (14:35 +1000)]
staging: lustre: osc: tidy up osc_init()

A module_init() function that registers the services
of the module should do that last, after all other
initialization has succeeded.
This patch moves the class_register_type() call to the
end and ensures everything else that might have been
set up, is cleaned up on error.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: comedi: comedidev.h: Fix SPDX-License-Identifier tag style
Nishad Kamdar [Thu, 24 May 2018 17:44:40 +0000 (23:14 +0530)]
staging: comedi: comedidev.h: Fix SPDX-License-Identifier tag style

Replace // SPDX-License-Identifier: GPL-2.0+ by
/* SPDX-License-Identifier: GPL-2.0+ */ as per licensing rule
for C header files. Issue found by checkpatch. Part of
Eudyptula Challenge.

Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoMerge tag 'iio-for-4.18b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Fri, 25 May 2018 16:07:31 +0000 (18:07 +0200)]
Merge tag 'iio-for-4.18b' of git://git./linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

Second set of new device support, features and cleanup for IIO in the 4.18 cycle

Usual mixture of new devices support and other stuff.  A couple of
staging graduations in here and some old driver drops.

New device support
* ad5686
  - Add support for AD5691R, AD5692R, AD5693 and AD5693R i2c DACs
  - Add support for AD5681R, AD5682R, AD5683 and AD5683R SPI DACs
* lmp91000
  - Add ID for LMP91002
* stm32-dfsdm
  - Add support for the stm32mp1 devices.

Drivers dropped
* ADE7753
  - No longer easily available, no users came forward and needs a lot
    of work to move out of staging.
* ADE7754
* ADE7758
* ADE7759

Staging graduations
- ad2s1200 - good cleanup from David Veenstra.
- tsl2772 (was tsl2x7x) - Brian's quest is at an end and
  staging/iio/light is no more!

Features
* tools
  - loop forever on a negative number of loops being specified.
* ltc 2632
  - add of_match_table
  - support an external reference regulator.
* mag3110
  - Support continuous mode when running fast as it increases the
    posssible sampling rate.
* ti-ads8688
  - Add trigger and buffer support to this ADC.

Cleanups / minor tweaks.
* tools
  - tidy up types in iio_generic_buffer.
* ad2s1200
  - Whitespace cleanup.
  - Drop pointless initializations.
  - Improve kernel docs.
  - Reorder to setup the SPI prior to device registration (race fix).
  - Change to modern gpiod framework.
  - Drop platform data and move to DT bindings. There are no in
    kernel users of the platform data. Any out of tree boards will
    need changes.
  - Add an explicit compatible table.
  - Provide _scale for angular velocity and angle channels.
  - Add David Veenstra to copyright notice as this cleanup was non
    trivial.
* ade8366
  - Avoid a race by ensuring channel init is before registration
    with the subsystem.
* afe
  - binding spelling fix.
* imx7d-adc
  - typo fix in Freescale
* inv_mpu6050
  - tidy up an ugly loop to take advantage of known entry condition.
  - add a comment explaining why the sensible sampling frequencies
    are more limited than might be immediately apparent (aliasing).
* mma8452
  - reduce the sleep time on data not ready when running at high
    frequency.
* stm32-dfsdm
  - add missing header.
* tsl2583
  - fix integration_time_availabe which was in microsecs rather the
    millisecs.
* tsl2x7x/tsl2772
  - Whitespace cleanup.
  - Change to direct returns where sensible.
  - Turn the chip off in the registration error path.
  - Use macro to reduce repition when setting up the device_info
    structures.
  - Change the _available attributes over to read_avail callback,
    and the range definitions that supports.
  - Fix some wrong period values.
  - Add some range checkign for _write_raw.
  - Rename the driver to tsl2772 to avoid wild card clash problems
    in future.

6 years agoiio: imu: inv_mpu6050: add comment about frequencies
Martin Kelly [Mon, 21 May 2018 18:41:54 +0000 (11:41 -0700)]
iio: imu: inv_mpu6050: add comment about frequencies

Although the driver allows frequencies between 4 and 1000 Hz, only the
frequencies advertised in the available frequencies file are backed
properly by a low-pass filter to prevent aliasing, so it's best to use
them. Since this is not obvious to the user, add a comment explaining
what's going on.

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Acked-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: dac: Add support for external reference voltage through the regulator framework.
Silvan Murer [Mon, 21 May 2018 12:21:28 +0000 (14:21 +0200)]
iio: dac: Add support for external reference voltage through the regulator framework.

Signed-off-by: Silvan Murer <silvan.murer@gmail.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: dac: fix missing of_match_table assignment in the LTC 2632 device
Silvan Murer [Mon, 21 May 2018 12:21:27 +0000 (14:21 +0200)]
iio: dac: fix missing of_match_table assignment in the LTC 2632 device

Signed-off-by: Silvan Murer <silvan.murer@gmail.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: fix spelling mistake: "Freeacale" -> "Freescale"
Colin Ian King [Mon, 21 May 2018 09:16:54 +0000 (10:16 +0100)]
iio: adc: fix spelling mistake: "Freeacale" -> "Freescale"

Trivial fix to spelling mistake in module description text

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: amplifiers: ad8366: move channel init before iio_device_register()
Alexandru Ardelean [Mon, 21 May 2018 06:40:05 +0000 (09:40 +0300)]
iio: amplifiers: ad8366: move channel init before iio_device_register()

Otherwise a race condition can occur, where userspace can start operations
before the channels have been properly initialized.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agotools: iio: iio_generic_buffer: allow continuous looping
Martin Kelly [Fri, 18 May 2018 00:14:46 +0000 (17:14 -0700)]
tools: iio: iio_generic_buffer: allow continuous looping

Sometimes it's useful to stream samples forever, such as when
stress-testing a driver overnight to check for memory leaks or other
issues. When the program receives a signal, it will gracefully cleanup,
so it is still safe to terminate at any time.

Add support for specifying a negative -c option, meaning that we should
loop forever. To do so, we need to use a long long (instead of just
long) for num_loops so that current code specifying num_loops greater
than UNSIGNED_LONG_MAX doesn't break.

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>